/* ============================================================
   NEXARIO — Shared Stylesheet
   Aesthetic: engineered-editorial. Deep ink canvas, warm amber
   signal accent, characterful serif display + clean grotesque
   body + monospace technical labels. Hairline grid system.
   ============================================================ */

/* ---------- Fonts ---------- */
/* Loaded via <link> in each HTML <head> (Google Fonts):
   Fraunces (display serif), Hanken Grotesk (body), JetBrains Mono (labels) */

/* ---------- Design tokens ---------- */
:root {
  --ink:        #0B0E13;   /* page canvas            */
  --ink-2:      #10141C;   /* raised panels          */
  --ink-3:      #161C26;   /* cards                  */
  --ink-4:      #1E2632;   /* card hover / borders   */
  --paper:      #ECE7DC;   /* primary text           */
  --paper-dim:  #B9BFC9;   /* secondary text         */
  --muted:      #7C8696;   /* tertiary / captions    */
  --line:       rgba(236, 231, 220, 0.10);
  --line-soft:  rgba(236, 231, 220, 0.055);

  --amber:      #F2A93B;   /* primary signal accent  */
  --amber-deep: #C9821F;
  --amber-glow: rgba(242, 169, 59, 0.16);
  --teal:       #46C9B4;   /* secondary (Tokkor)     */
  --teal-deep:  #2A9C8B;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Hanken Grotesk", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--paper);
  line-height: 1.6;
  font-size: 17px;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Subtle grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

/* Faint vertical grid lines on the page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 100% 100%, 25vw 100%;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 80%);
          mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 80%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); position: relative; z-index: 2; }
.section { padding-block: clamp(72px, 11vw, 150px); position: relative; z-index: 2; }
.section + .section { border-top: 1px solid var(--line-soft); }

/* Mono kicker / index label */
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--amber);
  display: inline-block;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.02; letter-spacing: -0.02em; }
.serif-italic { font-style: italic; font-weight: 400; color: var(--amber); }

p.lead { font-size: clamp(18px, 2.2vw, 22px); color: var(--paper-dim); line-height: 1.55; max-width: 62ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 22px; border-radius: 2px;
  border: 1px solid var(--amber); color: var(--ink); background: var(--amber);
  cursor: pointer; transition: transform 0.25s var(--ease), background 0.25s, box-shadow 0.25s;
  box-shadow: 0 0 0 0 var(--amber-glow);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px var(--amber-glow); }
.btn--ghost { background: transparent; color: var(--paper); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn .arr { transition: transform 0.25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-size: 21px; letter-spacing: -0.02em; }
.brand__logo { height: 30px; width: auto; display: block; }
.footer__logo { height: 64px; width: auto; display: block; }
.brand__mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, var(--amber), var(--amber-deep));
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 15px; color: var(--ink);
  box-shadow: 0 4px 14px -4px var(--amber-glow);
}
.brand small { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--muted); align-self: flex-end; padding-bottom: 4px; }
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a { font-size: 14px; color: var(--paper-dim); transition: color 0.2s; font-family: var(--font-mono); letter-spacing: 0.02em; }
.nav__links a:hover { color: var(--amber); }
.nav__cta { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 9px 16px; border: 1px solid var(--line); border-radius: 2px; transition: 0.2s; }
.nav__cta:hover { border-color: var(--amber); color: var(--amber); }
.nav__toggle { display: none; background: none; border: 1px solid var(--line); color: var(--paper); width: 42px; height: 38px; border-radius: 2px; cursor: pointer; font-size: 18px; }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .nav__links.open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
    position: absolute; top: 70px; left: 0; right: 0;
    background: var(--ink-2); padding: 26px var(--gutter); border-bottom: 1px solid var(--line);
  }
}

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(60px, 9vw, 120px); padding-bottom: clamp(60px, 9vw, 110px); position: relative; }
.hero__glow {
  position: absolute; top: -120px; right: -10%; width: 620px; height: 620px;
  background: radial-gradient(circle, var(--amber-glow), transparent 62%);
  filter: blur(8px); pointer-events: none; z-index: 0;
}
.hero h1 { font-size: clamp(44px, 8.2vw, 104px); max-width: 16ch; }
.hero .lead { margin-top: 28px; }
.hero__meta { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 18px; }
.hero__stats { margin-top: 64px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.stat { background: var(--ink); padding: 24px 22px; }
.stat__n { font-family: var(--font-display); font-size: clamp(26px, 4vw, 40px); color: var(--paper); }
.stat__l { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
@media (max-width: 760px) { .hero__stats { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.shead { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: clamp(40px, 6vw, 72px); flex-wrap: wrap; }
.shead h2 { font-size: clamp(32px, 5vw, 56px); max-width: 18ch; }
.shead p { color: var(--paper-dim); max-width: 40ch; }

/* ============================================================
   WHAT WE DO  (services grid)
   ============================================================ */
.svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.svc {
  background: var(--ink); padding: 38px 34px; position: relative;
  transition: background 0.3s var(--ease);
}
.svc:hover { background: var(--ink-2); }
.svc__no { font-family: var(--font-mono); font-size: 12px; color: var(--amber); letter-spacing: 0.1em; }
.svc h3 { font-size: 26px; margin-top: 16px; }
.svc p { color: var(--paper-dim); margin-top: 12px; font-size: 15.5px; }
.svc__tags { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); border: 1px solid var(--line); padding: 5px 10px; border-radius: 2px; }
@media (max-width: 760px) { .svc-grid { grid-template-columns: 1fr; } }

/* ============================================================
   PRODUCTS
   ============================================================ */
.products { display: grid; gap: 26px; }
.product {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--ink-2); position: relative;
}
.product__body { padding: clamp(30px, 4vw, 52px); }
.product__visual { position: relative; min-height: 320px; display: grid; place-items: center; overflow: hidden; border-left: 1px solid var(--line); }
.product:nth-child(even) .product__visual { border-left: none; border-right: 1px solid var(--line); order: -1; }
.product__eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.product h3 { font-size: clamp(30px, 4vw, 46px); margin-top: 18px; }
.product__desc { color: var(--paper-dim); margin-top: 16px; max-width: 46ch; }
.product__feats { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 18px 28px; }
.feat { display: flex; flex-direction: column; }
.feat b { font-family: var(--font-display); font-size: 24px; }
.feat span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.product__link { margin-top: 30px; display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--amber); border-bottom: 1px solid transparent; padding-bottom: 3px; transition: 0.25s; }
.product__link:hover { border-color: var(--amber); gap: 14px; }

/* Visual canvases (CSS-drawn, no external assets) */
.viz { position: absolute; inset: 0; }
.viz-grid { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 38px 38px; opacity: 0.5; }
.viz-td .glyph, .viz-tk .glyph { position: relative; z-index: 2; text-align: center; }
.viz-td { background: radial-gradient(120% 120% at 80% 10%, rgba(242,169,59,0.14), transparent 55%); }
.viz-tk { background: radial-gradient(120% 120% at 20% 20%, rgba(70,201,180,0.16), transparent 55%); }
.stack { display: grid; gap: 10px; transform: rotate(-7deg); }
.stack .card { width: 168px; height: 96px; border-radius: 6px; border: 1px solid var(--line); background: var(--ink-3); box-shadow: 0 18px 40px -20px rgba(0,0,0,0.8); display: grid; grid-template-columns: 1fr; }
.stack .card .bar { height: 8px; margin: 12px 14px 0; border-radius: 99px; background: var(--ink-4); }
.stack .card .bar.am { background: linear-gradient(90deg, var(--amber), transparent); width: 60%; }
.trophy { font-size: 64px; filter: drop-shadow(0 10px 24px rgba(70,201,180,0.4)); }
.bracket { display: flex; gap: 8px; margin-top: 18px; align-items: center; justify-content: center; }
.bracket .b { width: 40px; height: 22px; border: 1px solid var(--teal); border-radius: 3px; opacity: 0.7; }
.bracket .b.win { background: var(--teal); opacity: 1; }

@media (max-width: 820px) {
  .product { grid-template-columns: 1fr; }
  .product__visual, .product:nth-child(even) .product__visual { border: none; border-top: 1px solid var(--line); order: 0; min-height: 240px; }
}

/* ============================================================
   APPROACH / PROCESS
   ============================================================ */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.step { background: var(--ink); padding: 32px 26px; }
.step__no { font-family: var(--font-mono); font-size: 28px; color: var(--amber); }
.step h4 { font-family: var(--font-display); font-size: 21px; margin-top: 14px; font-weight: 500; }
.step p { color: var(--muted); font-size: 14px; margin-top: 8px; }
@media (max-width: 820px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* ============================================================
   OFFICES
   ============================================================ */
.offices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.office { border: 1px solid var(--line); border-radius: 8px; padding: clamp(30px, 4vw, 46px); background: var(--ink-2); position: relative; overflow: hidden; }
.office__flag { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em; color: var(--amber); text-transform: uppercase; }
.office h3 { font-size: 30px; margin-top: 14px; }
.office address { font-style: normal; color: var(--paper-dim); margin-top: 16px; line-height: 1.8; }
.office .role { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 18px; letter-spacing: 0.06em; text-transform: uppercase; }
@media (max-width: 760px) { .offices { grid-template-columns: 1fr; } }

/* ============================================================
   CONTACT + FORM
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(36px, 6vw, 80px); align-items: start; }
.contact-grid h2 { font-size: clamp(34px, 5.5vw, 60px); }
.contact-info { margin-top: 30px; display: grid; gap: 22px; }
.cinfo { border-top: 1px solid var(--line); padding-top: 16px; }
.cinfo span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cinfo a, .cinfo p { display: block; margin-top: 6px; font-size: 16px; color: var(--paper); }

form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 3px; padding: 14px 16px; color: var(--paper);
  font-family: var(--font-body); font-size: 16px; transition: border-color 0.2s, background 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--amber); background: var(--ink-3); }
.field textarea { resize: vertical; min-height: 120px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

.consent {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 4px; padding: 16px 18px;
}
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--amber); cursor: pointer; }
.consent label { font-size: 13px; color: var(--paper-dim); line-height: 1.6; cursor: pointer; }
.consent label a { color: var(--amber); text-decoration: underline; text-underline-offset: 2px; }
.form-note { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.03em; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); background: var(--ink-2); position: relative; z-index: 2; }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-block: 64px; }
.footer__brand p { color: var(--muted); font-size: 14px; margin-top: 16px; max-width: 34ch; }
.fcol h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); margin-bottom: 16px; }
.fcol a, .fcol p { display: block; color: var(--paper-dim); font-size: 14px; margin-bottom: 11px; transition: color 0.2s; }
.fcol a:hover { color: var(--amber); }
.footer__bot { border-top: 1px solid var(--line); padding-block: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.footer__bot p, .footer__bot a { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--muted); }
.footer__bot a:hover { color: var(--amber); }
@media (max-width: 820px) { .footer__top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer__top { grid-template-columns: 1fr; } }

/* ============================================================
   LEGAL / DOC PAGES
   ============================================================ */
.doc-hero { padding-block: clamp(60px, 9vw, 120px) clamp(30px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.doc-hero h1 { font-size: clamp(38px, 6.5vw, 72px); }
.doc-hero .updated { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--muted); margin-top: 18px; text-transform: uppercase; }
.doc-layout { display: grid; grid-template-columns: 240px 1fr; gap: clamp(30px, 5vw, 70px); align-items: start; padding-block: clamp(50px, 7vw, 90px); }
.toc { position: sticky; top: 92px; border-left: 1px solid var(--line); padding-left: 20px; }
.toc h6 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.toc a { display: block; font-size: 13.5px; color: var(--paper-dim); padding: 6px 0; transition: color 0.2s; line-height: 1.4; }
.toc a:hover { color: var(--amber); }
.doc-body { max-width: 70ch; }
.doc-body h2 { font-size: clamp(24px, 3.5vw, 34px); margin-top: 52px; scroll-margin-top: 90px; padding-top: 14px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { font-family: var(--font-body); font-weight: 700; font-size: 18px; margin-top: 30px; color: var(--paper); letter-spacing: 0; }
.doc-body p, .doc-body li { color: var(--paper-dim); margin-top: 14px; font-size: 16px; line-height: 1.72; }
.doc-body ul, .doc-body ol { margin-top: 14px; padding-left: 22px; }
.doc-body li { margin-top: 8px; }
.doc-body strong { color: var(--paper); }
.doc-body a { color: var(--amber); text-decoration: underline; text-underline-offset: 2px; }
.callout {
  border: 1px solid var(--amber); border-left-width: 3px; background: var(--amber-glow);
  border-radius: 4px; padding: 20px 22px; margin-top: 26px;
}
.callout p { color: var(--paper); margin-top: 0; }
.callout p + p { margin-top: 10px; }
.placeholder { color: var(--amber); font-family: var(--font-mono); font-size: 0.92em; background: rgba(242,169,59,0.10); padding: 1px 6px; border-radius: 3px; }
@media (max-width: 860px) {
  .doc-layout { grid-template-columns: 1fr; }
  .toc { position: relative; top: 0; border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 22px; }
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
