/* ============ Tokens ============ */
:root {
  /* Light theme (default) — blues from the Eternotec logo */
  --bg: #f5f7f9;
  --bg-alt: #edf1f4;
  --surface: #ffffff;
  --line: rgba(10, 30, 45, 0.1);
  --line-strong: rgba(10, 30, 45, 0.2);
  --text: #0d1b26;
  --muted: #55636e;
  --accent: #00688a;
  --accent-rgb: 0, 104, 138;
  --accent-hover: #005573;
  --accent-ink: #ffffff;
  --accent-text: #00688a;
  --nav-bg: rgba(245, 247, 249, 0.8);
  --hero-fade: rgba(245, 247, 249, 0.92);
  --glow: rgba(0, 140, 190, 0.16);
  --case-a: #e2eef3; --case-b: #e6ebf3; --case-c: #e8eef1;
  --bubble: #ffffff;
  --bar: #8dbccf;
  --featured-border: #00688a;
  --featured-tint: rgba(0, 104, 138, 0.08);
  --focus-ring: rgba(0, 104, 138, 0.18);
  --error: #c0392b;
  /* hero canvas (r,g,b) */
  --canvas-line: 0, 104, 138;
  --canvas-dot: 13, 27, 38;
  --canvas-hot: 0, 104, 138;
  color-scheme: light;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 18px;
  --container: 1200px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  transition: background-color 0.4s, color 0.4s;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.05; }
h2 { font-family: var(--serif); font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 500; line-height: 1.3; }
em { font-family: var(--serif); font-style: italic; color: var(--accent-text); }
p { margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; }
::selection { background: var(--accent); color: var(--accent-ink); }

.container { width: min(var(--container), 100% - 48px); margin-inline: auto; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 16px; }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 6px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin-bottom: 20px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-text);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px; font-weight: 500; font-size: 0.98rem;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-hover); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--text); }
.btn--small { padding: 9px 18px; font-size: 0.9rem; }
.btn--block { width: 100%; }

/* ============ Nav ============ */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; }
.brand__logo { height: 30px; width: auto; }
.brand__logo--dark, [data-theme="dark"] .brand__logo--light { display: none; }
[data-theme="dark"] .brand__logo--dark { display: block; }
.nav__links { display: flex; align-items: center; gap: 32px; font-size: 0.95rem; }
.nav__links a:not(.btn) { color: var(--muted); transition: color 0.2s; }
.nav__links a:not(.btn):hover { color: var(--text); }
.nav__toggle { display: none; }

@media (max-width: 860px) {
  .nav__toggle {
    display: grid; gap: 6px; place-content: center;
    width: 44px; height: 44px; background: none; border: 1px solid var(--line-strong);
    border-radius: 50%; cursor: pointer;
  }
  .nav__toggle span { display: block; width: 18px; height: 1.5px; background: var(--text); transition: transform 0.3s var(--ease); }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

  .nav__links {
    position: fixed; inset: 72px 0 auto; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 24px 24px; font-size: 1.15rem;
    transform: translateY(-12px); opacity: 0; pointer-events: none; visibility: hidden;
    transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
  .nav__links a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text); }
  .nav__cta { margin-top: 20px; padding: 14px; }
}

/* ============ Hero ============ */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 140px 0 48px; overflow: hidden; isolation: isolate;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 40%, var(--hero-fade), transparent 70%),
    linear-gradient(to bottom, transparent 70%, var(--bg));
}
.hero__content { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.hero__title {
  font-family: var(--serif); font-size: clamp(3.4rem, 10vw, 8.5rem);
  letter-spacing: -0.025em; line-height: 0.95; max-width: 11ch;
}
.hero__lede { margin-top: 32px; max-width: 34rem; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.hero__meta {
  display: flex; gap: 48px; padding-top: 24px; margin-top: 64px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem;
}
.hero__meta .mono { color: var(--accent-text); margin-right: 8px; }

/* ============ Marquee ============ */
.marquee {
  border-block: 1px solid var(--line); overflow: hidden; padding: 22px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track {
  display: flex; gap: 40px; width: max-content; white-space: nowrap;
  font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 2rem); color: var(--muted);
  animation: marquee 40s linear infinite;
}
.marquee__track span:nth-child(even) { color: var(--accent-text); font-size: 0.8em; align-self: center; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ Sections ============ */
.section { padding: clamp(88px, 12vw, 150px) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section__head { max-width: 46rem; margin-bottom: 64px; }
.section__head--row { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.section__note { font-size: 0.9rem; }

/* ============ Services ============ */
.services {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.service {
  padding: 40px 32px 36px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 16px; position: relative;
  transition: background 0.35s;
}
.service::before {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 0; background: var(--accent);
  transition: width 0.5s var(--ease);
}
.service:hover { background: var(--surface); }
.service:hover::before { width: 100%; }
.service__num { color: var(--accent-text); }
.service p { color: var(--muted); flex: 1; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 8px 0 0; }
.tags li {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  border: 1px solid var(--line-strong); padding: 4px 10px; border-radius: 999px;
}
@media (max-width: 980px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .services { grid-template-columns: 1fr; } }

/* ============ Process ============ */
.process { display: grid; grid-template-columns: 1fr 1.2fr; gap: 80px; align-items: start; }
.process__intro { position: sticky; top: 120px; }
.process__intro h2 { margin-bottom: 24px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step {
  display: grid; grid-template-columns: 120px 1fr; gap: 24px;
  padding: 32px 0; border-bottom: 1px solid var(--line);
}
.step:first-child { border-top: 1px solid var(--line); }
.step__time { color: var(--accent-text); padding-top: 4px; }
.step h3 { font-family: var(--serif); font-size: 2rem; margin-bottom: 8px; }
.step p { color: var(--muted); }
@media (max-width: 860px) {
  .process { grid-template-columns: 1fr; gap: 48px; }
  .process__intro { position: static; }
  .step { grid-template-columns: 1fr; gap: 8px; }
}

/* ============ Work ============ */
.work { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.case {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.4s var(--ease), border-color 0.4s;
}
.case:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.case--lg { grid-column: 1 / -1; flex-direction: row; }
.case--lg .case__visual { flex: 1.1; min-height: 340px; }
.case--lg .case__body { flex: 1; justify-content: center; padding: 48px; }
.case__visual { position: relative; min-height: 220px; display: grid; place-items: center; overflow: hidden; }
.case__visual--a { background: radial-gradient(circle at 30% 30%, var(--glow), transparent 60%), var(--case-a); }
.case__visual--b { background: radial-gradient(circle at 70% 20%, rgba(120,200,255,0.16), transparent 60%), var(--case-b); }
.case__visual--c { background: radial-gradient(circle at 50% 90%, rgba(var(--accent-rgb),0.14), transparent 60%), var(--case-c); }
.case__body { padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.case__sector { color: var(--accent-text); }
.case h3 { font-family: var(--serif); font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 400; line-height: 1.1; }
.case__stats { display: flex; gap: 40px; margin: 12px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.case__stats dt { font-size: 0.82rem; color: var(--muted); }
.case__stats dd { margin: 0; font-family: var(--serif); font-size: 2.4rem; line-height: 1.1; }

/* case visuals */
.chat { width: min(340px, 80%); display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; }
.chat__bubble {
  background: var(--bubble); border: 1px solid var(--line); padding: 12px 16px;
  border-radius: 16px 16px 16px 4px; max-width: 85%;
}
.chat__bubble--user {
  align-self: flex-end; background: var(--accent); color: var(--accent-ink);
  border-color: transparent; border-radius: 16px 16px 4px 16px;
}
.chat__typing { display: flex; gap: 4px; padding: 12px 16px; background: var(--bubble); border-radius: 16px; width: fit-content; }
.chat__typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.4s infinite; }
.chat__typing span:nth-child(2) { animation-delay: 0.2s; }
.chat__typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

.doc {
  width: 150px; height: 180px; background: #e9ece4; border-radius: 8px; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 10px; transform: rotate(-4deg);
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}
.doc span { height: 8px; border-radius: 4px; background: #c6cbc0; }
.doc span:nth-child(odd) { width: 70%; }
.doc span.hl { background: #7cc8ff; animation: scan 2.6s var(--ease) infinite alternate; }
@keyframes scan { from { opacity: 0.4; } to { opacity: 1; } }

.bars { display: flex; align-items: end; gap: 12px; height: 130px; }
.bars span {
  width: 26px; height: var(--h); border-radius: 6px 6px 2px 2px;
  background: linear-gradient(to top, transparent, var(--bar));
  transform-origin: bottom; animation: grow 1.2s var(--ease) both;
}
.bars span:nth-child(1) { --h: 35%; }
.bars span:nth-child(2) { --h: 52%; }
.bars span:nth-child(3) { --h: 44%; }
.bars span:nth-child(4) { --h: 70%; }
.bars span:nth-child(5) { --h: 88%; }
.bars span:last-child { background: linear-gradient(to top, rgba(var(--accent-rgb),0.3), var(--accent)); }
@keyframes grow { from { transform: scaleY(0); } }

@media (max-width: 860px) {
  .work { grid-template-columns: 1fr; }
  .case--lg { flex-direction: column; }
  .case--lg .case__visual { min-height: 260px; }
  .case--lg .case__body { padding: 32px; }
}

/* ============ Principles ============ */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.principle { border-top: 1px solid var(--line-strong); padding-top: 24px; }
.principle__big { display: block; font-family: var(--serif); font-size: clamp(1.8rem, 2.8vw, 2.4rem); line-height: 1.05; margin-bottom: 14px; }
.principle p { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 980px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .principles { grid-template-columns: 1fr; } }

/* ============ Plans ============ */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 36px 32px; display: flex; flex-direction: column; gap: 16px;
}
.plan h3 { font-family: var(--serif); font-size: 2.2rem; }
.plan__price { font-family: var(--mono); color: var(--accent-text); font-size: 0.9rem; }
.plan--featured { border-color: var(--featured-border); background: linear-gradient(180deg, var(--featured-tint), var(--surface) 50%); }
.plan__badge {
  position: absolute; top: 20px; right: 20px; background: var(--accent); color: var(--accent-ink);
  padding: 4px 10px; border-radius: 999px; font-size: 0.7rem;
}
.checks { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 10px; flex: 1; }
.checks li { position: relative; padding-left: 26px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 12px; height: 7px;
  border-left: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text); transform: rotate(-45deg);
}
@media (max-width: 920px) { .plans { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } }

/* ============ FAQ ============ */
.faq { display: grid; grid-template-columns: 1fr 1.6fr; gap: 80px; }
.faq__list details { border-bottom: 1px solid var(--line); }
.faq__list details:first-child { border-top: 1px solid var(--line); }
.faq__list summary {
  list-style: none; cursor: pointer; padding: 26px 48px 26px 0; position: relative;
  font-size: 1.15rem; font-weight: 500;
}
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 1.4rem; color: var(--accent-text); transition: transform 0.3s var(--ease);
}
.faq__list details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq__list details p { color: var(--muted); padding: 0 48px 28px 0; max-width: 44rem; }
@media (max-width: 860px) { .faq { grid-template-columns: 1fr; gap: 32px; } }

/* ============ Contact ============ */
.contact { position: relative; overflow: hidden; }
.contact::before {
  content: ""; position: absolute; width: 700px; height: 700px; right: -200px; top: -100px; z-index: -1;
  background: radial-gradient(circle, var(--glow), transparent 65%);
}
.contact__inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: 80px; align-items: start; }
.contact__copy h2 { margin-bottom: 24px; }
.contact__list { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 16px; }
.contact__list li { display: flex; gap: 20px; align-items: baseline; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.contact__list .mono { color: var(--muted); width: 90px; text-transform: uppercase; }
.contact__list a { border-bottom: 1px solid var(--accent-text); }

.form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px; display: grid; gap: 20px;
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: grid; gap: 8px; font-size: 0.88rem; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 13px 14px; transition: border-color 0.2s, box-shadow 0.2s; resize: vertical;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--focus-ring);
}
.field__error { display: none; color: var(--error); font-size: 0.8rem; }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--error); }
.field.is-invalid .field__error { display: block; }
.form__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form__status.is-error { color: var(--error); }
.form__status { font-size: 0.92rem; min-height: 1.4em; text-align: center; color: var(--accent-text); }
@media (max-width: 920px) {
  .contact__inner { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 560px) {
  .form { padding: 24px; }
  .form__row { grid-template-columns: 1fr; }
  .hero__meta { gap: 24px; font-size: 0.85rem; }
}

/* ============ Footer ============ */
.footer { border-top: 1px solid var(--line); padding: 48px 0; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.footer__tag { margin-top: 8px; font-size: 0.9rem; }
.footer__links { display: flex; gap: 28px; color: var(--muted); font-size: 0.95rem; }
.footer__links a:hover { color: var(--text); }
.footer__copy { font-size: 0.85rem; }


/* ============ Dark theme ============ */
[data-theme="dark"] {
  --bg: #0a0f14;
  --bg-alt: #0e151c;
  --surface: #131c24;
  --line: rgba(225, 236, 245, 0.1);
  --line-strong: rgba(225, 236, 245, 0.2);
  --text: #e6eef4;
  --muted: #93a3b0;
  --accent: #38b6e8;
  --accent-rgb: 56, 182, 232;
  --accent-hover: #5cc6f0;
  --accent-ink: #04121a;
  --accent-text: #5cc3ee;
  --nav-bg: rgba(10, 15, 20, 0.75);
  --hero-fade: rgba(10, 15, 20, 0.9);
  --glow: rgba(56, 182, 232, 0.16);
  --case-a: #12202a; --case-b: #141c28; --case-c: #121b22;
  --bubble: rgba(255, 255, 255, 0.06);
  --bar: #2f6f8c;
  --featured-border: rgba(56, 182, 232, 0.5);
  --featured-tint: rgba(56, 182, 232, 0.08);
  --focus-ring: rgba(56, 182, 232, 0.2);
  --error: #ff8a7a;
  --canvas-line: 56, 182, 232;
  --canvas-dot: 230, 238, 244;
  --canvas-hot: 92, 195, 238;
  color-scheme: dark;
}
html:not([data-theme="dark"]) .doc { box-shadow: 0 20px 40px rgba(0,0,0,0.12); background: #fff; }
html:not([data-theme="dark"]) .chat__bubble { box-shadow: 0 4px 14px rgba(0,0,0,0.05); }
html:not([data-theme="dark"]) .plan { box-shadow: 0 1px 2px rgba(0,0,0,0.03); }

/* Theme toggle */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: none; border: 1px solid var(--line-strong); color: var(--text); cursor: pointer;
  transition: border-color 0.2s, transform 0.3s var(--ease);
}
.theme-toggle:hover { border-color: var(--text); transform: rotate(20deg); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun, [data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.nav__right { display: flex; align-items: center; gap: 12px; }

/* ============ Reveal ============ */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
