/* ============================================================================
   An Vu Gia Ltd — anvugia.io
   Design language: editorial data-storytelling.
   Warm paper + deep navy, high-contrast display serif, mono uppercase labels,
   hairline borders, parenthesised stat callouts, film grain.
   No build step. No framework. No dependencies beyond Google Fonts.
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  /* Surfaces */
  --paper:        #efede7;
  --paper-raised: #f4f2ed;
  --paper-sunk:   #e6e3db;
  --navy:         #16242f;
  --navy-raised:  #1d3040;
  --navy-deep:    #101b24;

  /* Ink */
  --ink:        #1c2b36;
  --ink-strong: #12202a;
  /* Functional secondary text on paper. 5.0:1 on --paper — clears WCAG AA. */
  --ink-soft:   #556772;
  /* Decorative marks only (the parenthesis glyphs, the ◆ superscript).
     Never use this for copy someone has to read — it is 2.6:1 on paper. */
  --ink-faint:  #8a979f;
  --ink-invert:       #e9eef1;
  --ink-invert-soft:  #9db0bd;

  /* Accent — the CRT blue of the reference monitor */
  --accent:      #3f7ba8;
  --accent-soft: #7fa9c9;
  --accent-glow: #9fd0ee;
  /* Darker accent for accent-coloured *text* on paper: 5.8:1. */
  --accent-ink:  #2c5f88;

  /* Hairlines */
  --line:          rgba(28, 43, 54, 0.14);
  --line-soft:     rgba(28, 43, 54, 0.08);
  --line-strong:   rgba(28, 43, 54, 0.26);
  --line-dark:     rgba(233, 238, 241, 0.14);
  --line-dark-soft:rgba(233, 238, 241, 0.08);

  /* Type */
  --display: "Instrument Serif", "Playfair Display", "Iowan Old Style",
             Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
          Consolas, "Liberation Mono", monospace;

  /* Metrics */
  --frame: 1440px;
  --gutter: clamp(1.15rem, 4vw, 4.5rem);
  --section-y: clamp(4.5rem, 11vh, 9.5rem);
  --radius: 3px;
  --nav-h: 58px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- 2. Reset ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-menu-open { overflow: hidden; }

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Film grain — one fixed overlay across the whole document. */
.grain {
  position: fixed;
  inset: -120px;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.34;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  will-change: transform;
}
.navy .grain { mix-blend-mode: overlay; opacity: 0.22; }

/* --- 3. Layout primitives ----------------------------------------------- */

.frame {
  width: 100%;
  max-width: var(--frame);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
}

/* The reference frames its content with faint vertical rules. */
@media (min-width: 1180px) {
  .frame--ruled::before,
  .frame--ruled::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line-soft);
  }
  .frame--ruled::before { left: calc(var(--gutter) * 0.5); }
  .frame--ruled::after  { right: calc(var(--gutter) * 0.5); }
  .navy .frame--ruled::before,
  .navy .frame--ruled::after { background: var(--line-dark-soft); }
}

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(3rem, 7vh, 5.5rem); }
.section--flush-top { padding-top: 0; }

.navy {
  background: var(--navy);
  color: var(--ink-invert);
}
.navy .display,
.navy h2, .navy h3 { color: var(--ink-invert); }

.hair-top    { border-top: 1px solid var(--line); }
.hair-bottom { border-bottom: 1px solid var(--line); }
.navy .hair-top    { border-top-color: var(--line-dark); }
.navy .hair-bottom { border-bottom-color: var(--line-dark); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- 4. Typography ------------------------------------------------------ */

.display {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.35rem, 6.2vw, 5.4rem);
  line-height: 0.99;
  letter-spacing: -0.018em;
  color: var(--ink);
  text-wrap: balance;
}
.display--sm { font-size: clamp(1.9rem, 4vw, 3.3rem); line-height: 1.04; }
.display--xl { font-size: clamp(2.3rem, 6.4vw, 5.4rem); }
.display em { font-style: italic; }

.eyebrow {
  font-family: var(--mono);
  font-size: clamp(0.6rem, 0.78vw, 0.68rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.navy .eyebrow { color: var(--ink-invert-soft); }
.eyebrow--ink { color: var(--ink); }

.lede {
  font-size: clamp(0.98rem, 1.15vw, 1.075rem);
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 60ch;
}
.navy .lede { color: var(--ink-invert-soft); }

.body-sm {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.navy .body-sm { color: var(--ink-invert-soft); }

.mono-tag {
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.section__head {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
  display: grid;
  gap: 0.95rem;
  justify-items: center;
}
.section__head--left {
  margin-inline: 0;
  text-align: left;
  justify-items: start;
}
/* Lets a display headline sit on two long lines instead of wrapping again. */
.section__head--wide { max-width: 60rem; }
.section__head .lede { margin-inline: auto; }
.section__head--left .lede { margin-inline: 0; }

.section__head + .section__body { margin-top: clamp(2.6rem, 6vh, 4.5rem); }

/* --- 5. Buttons --------------------------------------------------------- */

.btn {
  --btn-bg: rgba(255, 255, 255, 0.55);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.72em 1.15em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.645rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: background 0.28s var(--ease), color 0.28s var(--ease),
              border-color 0.28s var(--ease), transform 0.28s var(--ease);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset,
              0 1px 2px rgba(28, 43, 54, 0.06);
}
.btn:hover, .btn:focus-visible {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  --btn-bd: var(--ink);
  transform: translateY(-1px);
}
.btn__icon { flex: none; }
.btn--ghost { --btn-bg: transparent; }
.btn--onDark {
  --btn-bg: rgba(255, 255, 255, 0.04);
  --btn-fg: var(--ink-invert);
  --btn-bd: rgba(233, 238, 241, 0.3);
  box-shadow: none;
}
.btn--onDark:hover, .btn--onDark:focus-visible {
  --btn-bg: var(--ink-invert);
  --btn-fg: var(--navy);
  --btn-bd: var(--ink-invert);
}
.btn--lg { padding: 0.95em 1.5em; font-size: 0.7rem; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.btn-row--center { justify-content: center; }

/* Inline text link with a rule that grows on hover. */
.link-underline {
  position: relative;
  display: inline-block;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.28s var(--ease), color 0.28s var(--ease);
}
.link-underline:hover { color: var(--accent-ink); border-bottom-color: var(--accent-ink); }
.navy .link-underline { color: var(--ink-invert); border-bottom-color: var(--line-dark); }
.navy .link-underline:hover { color: var(--accent-glow); border-bottom-color: var(--accent-glow); }

/* --- 6. Navigation ------------------------------------------------------ */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 8000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(239, 237, 231, 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(239, 237, 231, 0.9);
}

.nav__inner {
  width: 100%;
  max-width: var(--frame);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.brand__mark {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--ink);
  transition: transform 0.6s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(90deg); }
.brand__sub {
  color: var(--ink-soft);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
}
@media (max-width: 620px) { .brand__sub { display: none; } }

.nav__tabs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
}
.nav__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.44rem 0.8rem;
  font-family: var(--mono);
  font-size: 0.615rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-left: 1px solid var(--line);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.nav__tab:first-child { border-left: 0; }
.nav__tab svg { width: 11px; height: 11px; opacity: 0.75; }
.nav__tab:hover { background: rgba(28, 43, 54, 0.06); color: var(--ink); }
.nav__tab.is-active {
  background: var(--ink);
  color: var(--paper);
}
.nav__tab.is-active svg { opacity: 1; }

.nav__cta { flex: none; }
/* The tab stands in for the CTA wherever the CTA is hidden, so a way to reach
   the contact section is always present in the bar. */
.nav__tab--mobile-only { display: none; }
@media (max-width: 1080px) {
  .nav__tab--mobile-only { display: inline-flex; }
}
@media (max-width: 1080px) { .nav__cta { display: none; } }
@media (max-width: 860px) {
  .nav__tabs {
    border: 0;
    background: none;
    gap: 0.15rem;
    overflow-x: auto;
    min-width: 0;
    flex-shrink: 1;
    scrollbar-width: none;
  }
  .nav__tabs::-webkit-scrollbar { display: none; }
  .nav__tab {
    border: 0;
    padding: 0.3rem 0.45rem;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }
  .nav__tab svg { display: none; }
  .nav__inner { justify-content: flex-start; gap: 0.9rem; }
  .nav__tabs { margin-left: auto; }
}
/* Progressive narrowing: drop the lower-priority tabs before the bar has to
   scroll, so Services, Tools and Contact always remain reachable in place. */
@media (max-width: 560px) {
  .nav__tab[data-compact-hide] { display: none; }
}
@media (max-width: 420px) {
  .nav__tab { padding: 0.25rem 0.3rem; letter-spacing: 0.08em; }
}

/* --- 7. Hero ------------------------------------------------------------ */

.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(1.4rem, 4vh, 2.6rem));
  padding-bottom: clamp(3rem, 8vh, 6rem);
  overflow: hidden;
}

/* Sky wash + faint plotter grid, echoing the reference hero. */
.hero__wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 8%, rgba(255, 255, 255, 0.85) 0%, rgba(239, 237, 231, 0) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(230, 227, 219, 0.35) 100%);
}
.hero__grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px),
    linear-gradient(0deg, var(--line-soft) 1px, transparent 1px);
  background-size: 72px 72px;
  /* Fades in from the top and out at the bottom so it never reads as a band. */
  mask-image: linear-gradient(180deg, transparent 0%, #000 20%, #000 48%, transparent 94%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 20%, #000 48%, transparent 94%);
}

.hero__inner { position: relative; }

/* Parenthesised corner statistics — the signature element. */
.corner-stats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.stat-corner {
  position: absolute;
  max-width: 15rem;
  display: grid;
  gap: 0.22rem;
  pointer-events: auto;
}
.stat-corner--tl { top: 0; left: 0; text-align: left; }
.stat-corner--tr { top: 0; right: 0; text-align: right; }
.stat-corner--bl { bottom: 0; left: 0; text-align: left; }
.stat-corner--br { bottom: 0; right: 0; text-align: right; }

.stat-corner__value {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}
.stat-corner__value .paren { color: var(--ink-faint); }
.stat-corner__label {
  font-size: 0.735rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.navy .stat-corner__value { color: var(--ink-invert); }
.navy .stat-corner__label { color: var(--ink-invert-soft); }

@media (max-width: 900px) {
  .corner-stats {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem 1.5rem;
    margin-top: 2.6rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
  }
  .stat-corner {
    position: static;
    max-width: none;
    text-align: left !important;
  }
}

/* Hero stage: monitor centred, zero-height so stats stay at the corners. */
.hero__stage {
  min-height: clamp(20rem, 46vh, 30rem);
  display: grid;
  place-items: center;
  padding-block: clamp(1.5rem, 4vh, 3rem);
}

/* --- 8. The CRT monitor ------------------------------------------------- */

.monitor {
  position: relative;
  width: clamp(15rem, 30vw, 25rem);
  perspective: 900px;
}
.monitor::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -7%;
  height: 8%;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(28, 43, 54, 0.34), rgba(28, 43, 54, 0) 72%);
  filter: blur(5px);
  z-index: -1;
}

.monitor__case {
  position: relative;
  aspect-ratio: 1 / 1.06;
  padding: 6.5% 7.5% 0;
  border-radius: 13px 13px 9px 9px;
  background: linear-gradient(178deg, #f6f5f2 0%, #eceae4 46%, #dedbd4 88%, #d3d0c8 100%);
  border: 1px solid rgba(28, 43, 54, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 2px 3px rgba(28, 43, 54, 0.07),
    0 34px 56px -26px rgba(28, 43, 54, 0.5);
}
/* Bezel seam across the top of the case. */
.monitor__case::before {
  content: "";
  position: absolute;
  inset: 2.6% 1.2% auto 1.2%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(28, 43, 54, 0.16), transparent);
}
/* Vent slots along the top edge. */
.monitor__vent {
  position: absolute;
  top: 1.1%;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 0.9%;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, rgba(28, 43, 54, 0.24) 0 1px, transparent 1px 4px);
  opacity: 0.55;
}

.monitor__crt {
  position: relative;
  border-radius: 9px;
  padding: 5.5%;
  background: linear-gradient(168deg, #3a3a3d 0%, #26262a 42%, #1c1c20 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.5),
    0 2px 6px rgba(9, 20, 30, 0.35) inset,
    0 10px 18px -12px rgba(9, 20, 30, 0.6);
}

.monitor__screen {
  position: relative;
  aspect-ratio: 4 / 3.05;
  overflow: hidden;
  border-radius: 6px / 9px;
  background:
    radial-gradient(115% 105% at 30% 18%, #8fc0dd 0%, #5b95bd 32%, #2f6690 66%, #1a4463 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14) inset,
    0 0 26px rgba(6, 24, 38, 0.7) inset,
    0 0 60px rgba(130, 185, 220, 0.16) inset;
}
.monitor__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.07) 0 1px,
    rgba(4, 20, 32, 0.13) 1px 2px
  );
}
.monitor__glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(158deg, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.08) 24%, rgba(255, 255, 255, 0) 46%),
    radial-gradient(60% 40% at 82% 92%, rgba(180, 225, 255, 0.16), transparent 70%);
}
.monitor__scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 22%;
  top: -22%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  animation: sweep 7.5s linear infinite;
}

.monitor__term {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 8% 7.5%;
  font-family: var(--mono);
  font-size: clamp(0.42rem, 0.85vw, 0.68rem);
  line-height: 1.72;
  letter-spacing: 0.01em;
  color: #ecf6fd;
  text-shadow: 0 0 7px rgba(160, 215, 255, 0.85), 0 0 1px rgba(255, 255, 255, 0.9);
  white-space: pre-wrap;
}
.monitor__term .ln { display: block; }
.monitor__term .ln--dim { color: rgba(226, 240, 250, 0.62); }
.monitor__term .ln--head {
  color: #ffffff;
  letter-spacing: 0.13em;
  margin-top: 0.35em;
}
.monitor__term .caret {
  display: inline-block;
  width: 0.58em;
  height: 1em;
  margin-left: 0.15em;
  vertical-align: -0.16em;
  background: #eaf6ff;
  box-shadow: 0 0 8px rgba(170, 220, 255, 0.9);
  animation: blink 1.05s steps(1, end) infinite;
}

.monitor__foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 27%;
}
/* Embossed brand mark on the lower-left of the case. */
.monitor__badge {
  position: absolute;
  left: 8%;
  bottom: 12%;
  width: 9%;
  color: rgba(28, 43, 54, 0.32);
}
/* Drive bay: dark slot, floppy, eject bar. */
.monitor__bay {
  position: absolute;
  right: 11%;
  bottom: 15.5%;
  width: 34%;
  height: 8.5%;
  border-radius: 3px;
  background: linear-gradient(180deg, #585b60 0%, #2c2f34 60%, #21242a 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 5px rgba(9, 20, 30, 0.3) inset;
  display: flex;
  align-items: center;
  padding: 0 6%;
}
.monitor__floppy {
  width: 42%;
  height: 190%;
  margin-top: -14%;
  border-radius: 2px;
  background: linear-gradient(180deg, #d9d7d1 0%, #bdbab3 100%);
  border: 1px solid rgba(28, 43, 54, 0.3);
  box-shadow: 0 3px 6px -2px rgba(9, 20, 30, 0.5);
}
.monitor__slot {
  flex: 1;
  height: 16%;
  margin-left: 8%;
  border-radius: 1px;
  background: rgba(9, 14, 20, 0.85);
}
.monitor__led {
  position: absolute;
  right: 11%;
  bottom: 6.5%;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent-glow);
  box-shadow: 0 0 8px rgba(159, 208, 238, 0.9);
  opacity: 0.85;
}

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes sweep {
  0%   { transform: translateY(0); opacity: 0; }
  12%  { opacity: 0.9; }
  88%  { opacity: 0.9; }
  100% { transform: translateY(560%); opacity: 0; }
}
@keyframes termIn {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: none; }
}

/* Terminal lines type in once the hero is on screen (JS adds .is-visible). */
.monitor .ln { opacity: 0; }
.monitor.is-visible .ln {
  animation: termIn 0.26s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 0.24s + 0.15s);
}
.monitor .caret { opacity: 0; }
.monitor.is-visible .caret {
  animation: blink 1.05s steps(1, end) infinite;
  animation-delay: 2.1s;
}

/* --- 9. Rule-bounded strip (hero → statement) --------------------------- */

.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: 0.85rem;
  text-align: center;
}
.strip__text {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 0.85rem;
  font-family: var(--mono);
  font-size: clamp(0.55rem, 0.75vw, 0.665rem);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.strip__sep { color: var(--line-strong); }
.strip__phrase { display: inline-block; }
/* On narrow screens the phrases stack; drop the slashes so none dangle. */
@media (max-width: 680px) {
  .strip__sep { display: none; }
  .strip__text { flex-direction: column; gap: 0.4rem; letter-spacing: 0.2em; }
}

/* --- 10. Practice cards ------------------------------------------------- */

.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.4vw, 1.15rem);
}
@media (max-width: 900px) { .practice-grid { grid-template-columns: 1fr; } }

.practice {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: clamp(1.5rem, 2.4vw, 2.2rem);
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease),
              transform 0.35s var(--ease);
}
.practice:hover {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.practice__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  text-align: center;
}
.practice__title {
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink-strong);
}
.practice__sub {
  font-size: 0.775rem;
  color: var(--ink-soft);
  margin-top: 0.12rem;
  font-style: italic;
  font-family: var(--display);
  font-size: 0.95rem;
}

.practice__art {
  display: grid;
  place-items: center;
  padding-block: clamp(1.1rem, 3vw, 2.2rem);
}
.practice__art svg { width: 100%; max-width: 15rem; height: auto; }

.practice__figure {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.1rem;
  font-family: var(--display);
  color: var(--ink);
  line-height: 0.78;
}
.practice__figure .n {
  font-size: clamp(3.6rem, 7vw, 5.9rem);
  letter-spacing: -0.02em;
}
.practice__figure .sup {
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  color: var(--ink-faint);
  transform: translateY(-0.15em);
}

.practice__list {
  margin-top: 1.4rem;
  border-top: 1px solid var(--line-soft);
}
.practice__list li {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.845rem;
  color: var(--ink-soft);
}
.practice__list li:last-child { border-bottom: 0; }
.practice__list .b {
  flex: none;
  width: 4px; height: 4px;
  transform: rotate(45deg);
  background: var(--accent);
  opacity: 0.75;
  translate: 0 -2px;
}

/* --- 11. Dark band with the orbiting globe ------------------------------ */

.band { position: relative; overflow: hidden; }
.band__wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 60% at 50% 46%, rgba(63, 123, 168, 0.22) 0%, rgba(22, 36, 47, 0) 68%),
    linear-gradient(180deg, rgba(16, 27, 36, 0.7) 0%, rgba(22, 36, 47, 0) 30%, rgba(16, 27, 36, 0.6) 100%);
}

.orbit-wrap {
  position: relative;
  margin-top: clamp(1.5rem, 4vh, 3rem);
}
.orbit { width: 100%; height: auto; overflow: visible; }

.orbit__ring {
  fill: none;
  stroke: rgba(233, 238, 241, 0.55);
  stroke-width: 1;
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  transition: stroke-dashoffset 2.4s var(--ease);
}
.is-visible .orbit__ring { stroke-dashoffset: 0; }

.orbit__globe { transform-origin: 450px 250px; }
.orbit__node { transition: opacity 0.6s var(--ease); }

.phase-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-dark-soft);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  overflow: hidden;
}
@media (max-width: 860px) { .phase-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .phase-list { grid-template-columns: 1fr; } }

.phase {
  background: var(--navy);
  padding: clamp(1.1rem, 2vw, 1.6rem);
  /* Column layout so every card's deliverable line sits on the same baseline. */
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: background 0.35s var(--ease);
}
.phase:hover { background: var(--navy-raised); }
.phase__idx {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--accent-soft);
}
.phase__title {
  font-family: var(--display);
  font-size: 1.42rem;
  line-height: 1.1;
  color: var(--ink-invert);
}
.phase__body { font-size: 0.83rem; line-height: 1.65; color: var(--ink-invert-soft); }
.phase__meta {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line-dark-soft);
  font-family: var(--mono);
  font-size: 0.575rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(157, 176, 189, 0.85);
}

/* --- 12. Investment tools: chart + feature table ------------------------ */

.tools-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1.4rem, 3vw, 3rem);
  align-items: start;
}
@media (max-width: 960px) { .tools-layout { grid-template-columns: 1fr; } }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.45);
  overflow: hidden;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
}
.panel__title {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.panel__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.565rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.panel__badge .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(63, 123, 168, 0.85);
}
.panel__body { padding: clamp(1rem, 2vw, 1.6rem); }

.chart { position: relative; }
/* pan-y keeps vertical page scrolling on touch devices while leaving
   horizontal scrubbing of the series to the crosshair handler. */
.chart svg { width: 100%; height: auto; touch-action: pan-y; cursor: crosshair; }
.chart__readout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
}
.readout {
  display: grid;
  gap: 0.1rem;
}
.readout__k {
  font-family: var(--mono);
  font-size: 0.555rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.readout__v {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}
.readout__v.is-up { color: #2f6b4f; }
.readout__v.is-down { color: #9a4a3f; }

.feature-list { border-top: 1px solid var(--line); }
.feature {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.3s var(--ease);
}
.feature:last-child { border-bottom: 0; }
.feature:hover { background: rgba(255, 255, 255, 0.5); }
.feature__id {
  font-family: var(--mono);
  font-size: 0.585rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  padding-top: 0.22rem;
}
.feature__name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-strong);
  letter-spacing: -0.003em;
}
.feature__desc { font-size: 0.845rem; color: var(--ink-soft); margin-top: 0.18rem; }
@media (max-width: 560px) {
  .feature { grid-template-columns: 1fr; gap: 0.35rem; }
  .feature__id { padding-top: 0; }
}

.callout {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.callout svg { flex: none; width: 13px; height: 13px; margin-top: 0.22rem; color: var(--accent); }

/* --- 13. Integration dome ---------------------------------------------- */

.dome {
  position: relative;
  margin-top: clamp(1rem, 3vh, 2rem);
}
.dome svg { width: 100%; height: auto; overflow: visible; }
.dome__node rect { transition: fill 0.3s var(--ease), stroke 0.3s var(--ease); }
.dome__node:hover rect { fill: #ffffff; stroke: var(--line-strong); }
.dome__label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; }
.dome__dash {
  stroke-dasharray: 3 4;
  stroke: var(--line-strong);
  fill: none;
  stroke-width: 1;
}

/* --- 14. Numbers band --------------------------------------------------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(1.6rem, 4vh, 2.6rem);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
@media (max-width: 900px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.metric {
  padding: clamp(1.3rem, 2.6vw, 2.2rem);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.4rem;
  align-content: start;
  transition: background 0.35s var(--ease);
}
.metric:hover { background: rgba(255, 255, 255, 0.55); }
.metric__v {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--ink);
  /* flex-end puts the ◆ marker on the baseline, matching the practice figures */
  display: flex;
  align-items: flex-end;
  gap: 0.06em;
}
.metric__v sup {
  font-size: 0.34em;
  line-height: 1;
  color: var(--ink-faint);
  margin-bottom: 0.16em;
}
.metric__k {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.metric__d { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.55; }

/* --- 15. Contact -------------------------------------------------------- */

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  padding: clamp(1.6rem, 4vw, 3.4rem);
  display: grid;
  gap: clamp(1.4rem, 3vw, 2.4rem);
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 780px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-cell {
  background: var(--paper-raised);
  padding: 1.15rem 1.25rem;
  display: grid;
  gap: 0.3rem;
}
.contact-cell__k {
  font-family: var(--mono);
  font-size: 0.565rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contact-cell__v {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-strong);
  word-break: break-word;
}

/* --- 16. Footer --------------------------------------------------------- */

.footer { padding-top: clamp(2.5rem, 6vh, 4rem); }
.footer__corners {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.4rem;
  padding-bottom: clamp(1.8rem, 4vh, 2.8rem);
}
.footer__corner { display: grid; gap: 0.3rem; max-width: 20rem; }
.footer__corner--r { text-align: right; margin-left: auto; }
.footer__corner .k {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-invert);
}
.footer__corner .v { font-size: 0.775rem; color: var(--ink-invert-soft); line-height: 1.55; }

.footer__mid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding-block: clamp(1.4rem, 3vh, 2rem);
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.35rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-invert-soft);
}
.footer__links a { transition: color 0.25s var(--ease); }
.footer__links a:hover { color: var(--ink-invert); }

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem 2.4rem;
  font-size: 0.72rem;
  line-height: 1.65;
  color: rgba(157, 176, 189, 0.85);
}
.footer__legal p { max-width: 62ch; }
.footer__disclaimer {
  border-left: 2px solid rgba(157, 176, 189, 0.35);
  padding-left: 0.9rem;
}

/* --- 17. Reveal-on-scroll ---------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .monitor .ln, .monitor .caret { opacity: 1 !important; animation: none !important; }
  .monitor__scan { display: none; }
  .orbit__ring { stroke-dashoffset: 0; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- 18. Print --------------------------------------------------------- */

@media print {
  .nav, .grain, .monitor__scan { display: none !important; }
  body { background: #fff; }
  .navy { background: #fff; color: #000; }
  .reveal { opacity: 1; transform: none; }
}
