:root {
  --bg: #0a0a0a;
  --bg-panel: #131313;
  --bg-panel-2: #1a1a1a;
  --line: #262626;
  --text: #ededed;
  --text-dim: #9a9a9a;
  --red: #d7232c;
  --red-dim: #8c171e;
  --moon: #eeeeea;
  --max-w: 1180px;
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(215,35,44,0.06), transparent 40%),
                     radial-gradient(circle at 80% 0%, rgba(215,35,44,0.05), transparent 45%),
                     repeating-linear-gradient(to bottom, rgba(255,255,255,0.018) 0px, rgba(255,255,255,0.018) 1px, transparent 1px, transparent 3px);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem clamp(1.2rem, 4vw, 3rem);
  background: rgba(10,10,10,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.brand-name strong { color: var(--red); }

.nav {
  display: flex;
  gap: 1.8rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.nav a:hover { color: var(--text); }

.lang-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lang-toggle:hover { border-color: var(--red); color: var(--red); }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(5rem, 14vw, 9rem) clamp(1.2rem, 4vw, 3rem) clamp(4rem, 10vw, 6rem);
  max-width: var(--max-w);
  margin: 0 auto;
  overflow: hidden;
}

.hero-eclipse {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 360px;
  height: 360px;
  object-fit: contain;
  opacity: 0.85;
  z-index: 0;
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; max-width: 760px; }

.eyebrow {
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.4rem, 6.2vw, 4.2rem);
  line-height: 1.06;
  margin: 0 0 1.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.hero h1 .accent { color: var(--red); display: inline-block; cursor: default; }

.hero h1 .accent:hover {
  animation: glitch 0.35s steps(2, end) 1;
}

@keyframes glitch {
  0%   { text-shadow: none; transform: translate(0); }
  20%  { text-shadow: -2px 0 var(--red), 2px 0 var(--moon); transform: translate(-1px, 1px); }
  40%  { text-shadow: 2px 0 var(--red), -2px 0 var(--moon); transform: translate(1px, -1px); }
  60%  { text-shadow: -1px 0 var(--red), 1px 0 var(--moon); transform: translate(-1px, 0); }
  80%  { text-shadow: 1px 0 var(--red), -1px 0 var(--moon); transform: translate(1px, 0); }
  100% { text-shadow: none; transform: translate(0); }
}

.hero-terminal {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  margin-bottom: 1.6rem;
  position: relative;
  z-index: 1;
}

.term-dots { display: flex; gap: 5px; }
.term-dots span { width: 7px; height: 7px; border-radius: 50%; display: block; background: var(--line); }
.term-dots span:nth-child(1) { background: #5c5c5c; }
.term-dots span:nth-child(2) { background: #8a8a8a; }
.term-dots span:nth-child(3) { background: var(--red-dim); }

.hero-terminal-text { color: var(--text); white-space: pre; }

.term-cursor {
  color: var(--red);
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero h1 .accent:hover { animation: none; }
  .term-cursor { animation: none; }
}

.hero-sub {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 0 2.2rem;
}

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover { background: #e8323c; transform: translateY(-1px); }

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--red); color: var(--red); }

/* ---------- Sections ---------- */

section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.2rem, 4vw, 3rem);
}

.section-title {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  margin: 0 0 0.6rem;
  font-weight: 700;
}

.section-sub {
  color: var(--text-dim);
  margin: 0 0 2.6rem;
  max-width: 560px;
}

/* ---------- Services ---------- */

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.service-card {
  background: var(--bg-panel);
  padding: 1.8rem;
  transition: background 0.2s ease;
}

.service-card:hover { background: var(--bg-panel-2); }

.service-index {
  display: block;
  color: var(--red-dim);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
}

.service-card h3 {
  font-size: 1.08rem;
  margin: 0 0 0.6rem;
}

.service-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- Solutions ---------- */

.solutions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.solution-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 1.8rem;
}

.solution-card h3 {
  font-size: 1.08rem;
  margin: 0 0 0.6rem;
}

.solution-card p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- About ---------- */

.about {
  background: var(--bg-panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  max-width: none;
}

.about-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(1.2rem, 4vw, 3rem); }

.about p {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 720px;
  margin: 0 0 1.2rem;
}

.about-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
  margin-top: 2.4rem;
}

.about-pillars li {
  border-top: 2px solid var(--red);
  padding-top: 0.8rem;
}

.about-pillars strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.about-pillars span {
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* ---------- Work ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.work-card:not(.work-more):hover {
  border-color: var(--red-dim);
  transform: translateY(-2px);
}

.work-name { font-weight: 700; font-size: 1.05rem; }

.work-desc { color: var(--text-dim); font-size: 0.9rem; }

.work-link { color: var(--red); font-size: 0.85rem; margin-top: 0.4rem; }

.work-more { opacity: 0.6; }

/* ---------- Contact ---------- */

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.contact-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.contact-link:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-1px);
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2.5rem 1.2rem 3rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

.footer-logo { width: 22px; height: 22px; border-radius: 50%; opacity: 0.85; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .solutions-grid { grid-template-columns: repeat(2, 1fr); }
  .about-pillars { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .service-grid { grid-template-columns: 1fr; }
  .solutions-grid { grid-template-columns: 1fr; }
  .about-pillars { grid-template-columns: 1fr 1fr; }
  .hero-eclipse { width: 150px; height: 150px; top: -60px; right: -30px; opacity: 0.4; }
}

body.nav-open .nav {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 1rem clamp(1.2rem, 4vw, 3rem) 1.6rem;
  gap: 1rem;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
