/* Gridvanta PowerTech — typewriter lab notes + research list */
:root {
  --cyan: #0090E0;
  --cyan-2: #33A8E8;
  --navy: #000838;
  --navy-deep: #000028;
  --paper: #F4F7FA;
  --sheet: #FFFFFF;
  --ink: #000838;
  --muted: #3A4E66;
  --line: #C5D4E0;
  --on-dark: #F4F8FC;
  --on-dark-muted: #C9DCEB;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --maxw: 1120px;
  --mono: "Azeret Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

html, body { overflow-x: hidden; }
body {
  margin: 0;
  background:
    linear-gradient(rgba(0, 8, 56, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 8, 56, .045) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px, 24px 24px, auto;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, blockquote {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.14;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--navy); color: var(--on-dark);
  padding: 10px 16px; font-weight: 600;
}
.skip-link:focus { left: 0; }

.kicker {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--cyan);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn-primary { background: var(--navy); color: var(--on-dark); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--navy); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 247, 250, .92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.scrolled {
  background: rgba(244, 247, 250, .98);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px -18px rgba(0, 8, 56, .35);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand img {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 1px var(--line);
}
.brand-lock { display: flex; flex-direction: column; line-height: 1.1; }
.brand-lock strong {
  font-family: var(--mono); font-size: 13px; letter-spacing: .16em; font-weight: 700;
}
.brand-lock em {
  font-style: normal; font-size: 10px; letter-spacing: .2em;
  color: var(--cyan); font-weight: 600;
}

.nav { display: flex; align-items: center; gap: 22px; }
.nav a {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 600; color: var(--muted);
  transition: color .2s var(--ease), transform .25s var(--ease), background .25s var(--ease);
}
.nav .nav-cta {
  color: var(--on-dark); background: var(--navy);
  padding: 8px 14px; letter-spacing: .1em;
}

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav-toggle span {
  width: 22px; height: 2px; background: var(--navy); border-radius: 1px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero notebook */
.hero { padding: 28px 0 8px; }
.notebook {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 28px 32px 28px 72px;
  box-shadow: 0 18px 40px -28px rgba(0, 8, 56, .35);
  overflow: hidden;
}
.nb-holes {
  position: absolute; left: 0; top: 0; bottom: 0; width: 44px;
  display: flex; flex-direction: column; justify-content: space-evenly; align-items: center;
}
.nb-holes i {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 1px 2px rgba(0, 8, 56, .25);
}
.nb-rule {
  position: absolute; left: 52px; top: 0; bottom: 0; width: 2px;
  background: var(--cyan);
  opacity: .85;
}

.nb-head {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  justify-content: space-between;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 600; color: var(--muted);
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 22px;
}
.nb-live {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--navy);
}
.nb-live i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan);
  animation: rec 1.2s steps(2) infinite;
}
@keyframes rec {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: .2; }
}

/* Typewriter line */
.tty {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--navy);
  font-weight: 600;
  margin: 0 0 18px;
  min-height: 1.4em;
  white-space: nowrap;
  overflow: hidden;
}
.tty-text {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  vertical-align: bottom;
  animation: type 2.6s steps(28) .2s forwards;
}
@keyframes type { to { max-width: 28ch; } }
.caret {
  display: inline-block;
  width: 8px; height: 1.05em;
  background: var(--cyan);
  margin-left: 3px;
  vertical-align: -3px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero h1 {
  font-size: clamp(2rem, 5.4vw, 3.55rem);
  font-weight: 600;
  max-width: 18ch;
  color: var(--navy);
  margin-bottom: 18px;
}
.h-caret {
  display: inline-block;
  width: 3px; height: .72em;
  background: var(--cyan);
  margin-left: 6px;
  vertical-align: -2px;
  animation: blink 1s step-end infinite .4s;
}
.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }

/* Oscilloscope */
.scope {
  margin: 0 0 8px;
  border: 1px solid var(--line);
  background: #F7FBFD;
}
.scope figcaption {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 12px;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.scope-svg { display: block; width: 100%; height: auto; }
.scope-zero { stroke: var(--navy); stroke-opacity: .18; stroke-width: 1; stroke-dasharray: 4 6; }
.scope-wave {
  fill: none;
  stroke: url(#trace);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 920;
  stroke-dashoffset: 920;
  animation: draw 3.4s var(--ease) .4s forwards, pulse 4.8s ease-in-out 3.8s infinite;
}
.scope-wave.delay {
  stroke: var(--cyan);
  stroke-opacity: .45;
  stroke-width: 1.4;
  animation-delay: .9s, 4.4s;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
.scan {
  fill: rgba(0, 144, 224, .12);
  animation: scan 4.2s linear infinite;
}
@keyframes scan {
  from { transform: translateX(-48px); }
  to { transform: translateX(640px); }
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 18px 0 0;
  border-top: 1px dashed var(--line);
}
.meta { padding: 16px 12px 4px 0; }
.meta dt {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 6px;
}
.meta dd {
  font-family: var(--serif);
  font-size: 1.25rem; font-weight: 600; margin: 0; color: var(--navy);
}

/* Sections */
.section { padding: 72px 0; }
.notes-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 18px;
}
.log-card {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 28px 26px 30px;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}
.log-card h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  color: var(--navy);
  margin-bottom: 14px;
}
.log-card p { color: var(--muted); }
.log-card p + p { margin-top: 12px; }
.log-meta {
  list-style: none; margin-top: 20px;
  border-top: 1px dashed var(--line);
}
.log-meta li {
  display: grid; grid-template-columns: 56px 1fr; gap: 10px;
  padding: 12px 0 0;
  font-size: 13px; color: var(--muted);
  transition: background .25s var(--ease), transform .25s var(--ease), padding .25s var(--ease);
}
.log-meta span {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 700; color: var(--cyan);
}
.log-meta a { color: var(--navy); font-weight: 600; }

/* Research list */
.section-index { padding-top: 24px; }
.index-head { max-width: 640px; margin-bottom: 28px; }
.index-head h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  color: var(--navy);
  margin-bottom: 12px;
}
.index-head p { color: var(--muted); }

.research { list-style: none; border-top: 1px solid var(--navy); }
.r-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 18px;
  align-items: start;
  padding: 22px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), background .28s var(--ease), border-color .28s var(--ease);
}
.r-id {
  font-size: 12px; letter-spacing: .14em; font-weight: 700;
  color: var(--cyan); padding-top: 6px;
}
.r-body h3 {
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  color: var(--navy); margin-bottom: 6px;
}
.r-body p { color: var(--muted); font-size: 14px; max-width: 62ch; }
.r-flag {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 700; color: var(--navy);
  border: 1px solid var(--navy);
  padding: 5px 8px;
  white-space: nowrap;
  margin-top: 4px;
}

/* Quote — dark, near-white text */
.quote-band {
  background: var(--navy);
  color: var(--on-dark);
  padding: 80px 0;
}
.quote-inner { text-align: center; max-width: 820px; margin: 0 auto; }
.quote-kicker {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--cyan-2); font-weight: 700; margin-bottom: 18px;
}
.quote-band blockquote {
  font-size: clamp(1.6rem, 4.2vw, 2.7rem);
  font-style: italic;
  font-weight: 500;
  color: var(--on-dark);
  line-height: 1.22;
}
.quote-attr {
  margin-top: 20px;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--on-dark-muted); font-weight: 600;
}

/* Protocol rows */
.protocol { list-style: none; }
.p-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  padding: 24px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), background .28s var(--ease);
}
.p-row:first-child { border-top: 1px solid var(--navy); }
.p-id {
  font-size: 12px; letter-spacing: .14em; font-weight: 700;
  color: var(--cyan); padding-top: 6px;
}
.p-row h3 { font-size: 1.35rem; color: var(--navy); margin-bottom: 8px; }
.p-row p { color: var(--muted); max-width: 62ch; }

/* FAQ */
.faq-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 48px;
  align-items: start;
}
.faq-lead h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  color: var(--navy);
}
.faq-lead p { color: var(--muted); margin-top: 16px; }
.faq { border-top: 1px solid var(--navy); }
.faq-item { border-bottom: 1px solid var(--line); background: var(--sheet); }
.faq-q {
  width: 100%; background: none; border: 0; cursor: pointer; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px 10px;
  font-family: var(--serif); font-size: clamp(1.08rem, 2vw, 1.28rem);
  color: var(--navy); font-weight: 600;
}
.faq-ico { position: relative; flex: 0 0 16px; width: 16px; height: 16px; }
.faq-ico::before, .faq-ico::after {
  content: ""; position: absolute; background: var(--cyan); border-radius: 1px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.faq-ico::before { top: 7px; left: 0; width: 16px; height: 2px; }
.faq-ico::after { top: 0; left: 7px; width: 2px; height: 16px; }
.faq-item.open .faq-ico::after { transform: scaleY(0); opacity: 0; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq-item.open .faq-a { max-height: 280px; }
.faq-a p { color: var(--muted); margin: 0 0 20px; padding: 0 10px 0 10px; }

/* Contact — dark band, near-white copy, light form */
.contact {
  background: var(--navy);
  color: var(--on-dark);
  padding: 80px 0;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.contact .kicker { color: var(--cyan-2); }
.contact-copy h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  color: var(--on-dark);
}
.contact-copy p { color: var(--on-dark-muted); margin: 16px 0 22px; }
.contact-email {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--on-dark);
  border-bottom: 1px solid var(--cyan);
  padding-bottom: 4px;
  transition: border-color .2s, color .2s, transform .25s var(--ease);
}
.contact-addr {
  margin-top: 18px !important;
  font-size: .9rem;
}
.contact-form {
  background: var(--sheet);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 28px;
  display: grid; gap: 16px;
  transition: box-shadow .28s var(--ease), transform .28s var(--ease);
}
.field { display: grid; gap: 7px; }
.field label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.field input, .field textarea {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  padding: 12px 14px;
  font: inherit; font-size: 14px;
  width: 100%; resize: vertical;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: #6A7C8E; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 144, 224, .22);
}
.contact-form .btn { justify-self: start; }

/* Footer — dark, near-white */
.site-footer {
  background: var(--navy-deep);
  color: var(--on-dark);
  padding: 48px 0 28px;
}
.site-footer .brand-lock strong { color: var(--on-dark); }
.site-footer .brand-lock em { color: var(--cyan-2); }
.footer-inner { display: flex; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-tag { color: var(--on-dark-muted); font-size: 13px; max-width: 42ch; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.footer-nav a {
  color: var(--on-dark-muted);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
  transition: color .2s, transform .25s var(--ease);
}
.footer-bottom {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-top: 22px; margin-top: 28px;
  border-top: 1px solid rgba(244, 248, 252, .16);
  color: var(--on-dark-muted); font-size: 13px;
}

/* Reveal — must sit before hover transforms */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .tty-text { max-width: 28ch; animation: none; }
  .caret, .h-caret, .nb-live i, .scope-wave, .scan { animation: none; }
  .scope-wave { stroke-dashoffset: 0; }
}

/* Hover AFTER .reveal.in so lift is not overwritten.
   Fine-pointer only: avoids sticky low-contrast hover on mobile tap. */
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--navy); }
  .nav .nav-cta:hover {
    background: var(--cyan); color: #fff;
    transform: translateY(-2px);
  }
  .btn-primary:hover {
    transform: translateY(-2px);
    background: var(--cyan);
    color: #fff;
    box-shadow: 0 14px 28px -12px rgba(0, 8, 56, .45);
  }
  .btn-ghost:hover {
    transform: translateY(-2px);
    background: var(--navy);
    color: var(--on-dark);
  }
  .log-card:hover {
    transform: translateY(-5px);
    border-color: var(--cyan);
    box-shadow: 0 18px 40px -24px rgba(0, 8, 56, .4);
  }
  .r-row:hover {
    transform: translateX(6px);
    background: #EAF5FB;
    box-shadow: inset 3px 0 0 var(--cyan);
  }
  .r-row:hover .r-body h3, .r-row:hover .r-body p, .r-row:hover .r-id {
    color: var(--navy);
  }
  .r-row:hover .r-flag {
    background: var(--navy);
    color: var(--on-dark);
    border-color: var(--navy);
  }
  .p-row:hover {
    transform: translateX(6px);
    background: #EAF5FB;
    box-shadow: inset 3px 0 0 var(--cyan);
  }
  .log-meta li:hover {
    transform: translateX(4px);
    padding-left: 4px;
  }
  .faq-q:hover { color: var(--navy); background: #EAF5FB; }
  .contact-email:hover { border-bottom-color: var(--on-dark); color: #fff; }
  .contact-form:hover { box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .45); }
  .footer-nav a:hover { color: var(--on-dark); }
  .meta:hover dd { color: var(--cyan); }
}

/* Tablet */
@media (max-width: 960px) {
  .notes-grid, .faq-grid, .contact-grid { grid-template-columns: 1fr; gap: 18px; }
  .meta-row { grid-template-columns: 1fr 1fr; }
  .r-row { grid-template-columns: 64px 1fr; }
  .r-flag { grid-column: 2; margin-top: 0; }
}

/* Mobile */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0; align-items: stretch;
    background: #F4F7FA;
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 22px;
    transform: translateY(-120%);
    transition: transform .35s var(--ease);
    z-index: 90;
  }
  .nav.open { transform: translateY(0); }
  .nav a {
    padding: 14px 4px; font-size: 14px;
    border-bottom: 1px solid var(--line);
    color: var(--navy);
  }
  .nav .nav-cta {
    text-align: center; margin-top: 12px; border: 0;
    background: var(--navy); color: var(--on-dark);
  }

  .wrap { padding: 0 18px; }
  .hero { padding: 16px 0 0; }
  .notebook { padding: 20px 16px 20px 36px; }
  .nb-holes { width: 22px; }
  .nb-holes i { width: 8px; height: 8px; }
  .nb-rule { left: 26px; }
  .nb-head { justify-content: flex-start; gap: 8px 14px; }
  .nb-head span:nth-child(4) { display: none; }
  .section { padding: 56px 0; }
  .quote-band, .contact { padding: 56px 0; }
  .hero-actions .btn, .contact-form .btn { width: 100%; }
  .contact-form { padding: 22px 16px; }
  .footer-inner, .footer-bottom { flex-direction: column; }
  .p-row { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .r-row { grid-template-columns: 1fr auto; gap: 10px; padding: 18px 0; }
  .r-id { grid-column: 1; padding-top: 0; }
  .r-flag { grid-column: 2; grid-row: 1; }
  .r-body { grid-column: 1 / -1; }
  .header-inner { height: 64px; }
  .nav { inset: 64px 0 auto 0; }
  .tty { font-size: 12px; }
}

@media (max-width: 420px) {
  .section { padding: 48px 0; }
  .hero h1 { font-size: 1.85rem; max-width: none; }
  .log-card { padding: 20px 16px 22px; }
  .log-card h2, .index-head h2, .faq-lead h2, .contact-copy h2 { font-size: 1.55rem; }
  .meta-row { grid-template-columns: 1fr; }
  .meta { padding: 12px 0; border-bottom: 1px dashed var(--line); }
  .meta:last-child { border-bottom: 0; }
  .tty { white-space: normal; }
  .tty-text { max-width: 100%; animation: none; }
  .nb-head span:nth-child(1) { width: 100%; }
}
