/* NARTECH — 404 Ideas Not Found. Yet. */
:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: #101923;
  --panel-soft: #0d141d;
  --cyan: #55c8ff;
  --cyan-soft: rgba(85, 200, 255, .14);
  --text: #f1f5f9;
  --muted: #a8b4c2;
  --dim: #71859a;
  --line: #26394b;
  --amber: #e7b96b;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.65; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(85, 200, 255, .28); color: white; }
.cyan { color: var(--cyan); }
.section-shell { width: min(1160px, calc(100% - 48px)); margin-inline: auto; position: relative; }
.ambient { position: fixed; z-index: -2; pointer-events: none; width: 420px; height: 420px; border-radius: 50%; filter: blur(110px); opacity: .10; }
.ambient-one { top: 90px; right: -180px; background: #087fc0; }
.ambient-two { top: 640px; left: -240px; background: #1556a0; opacity: .06; }
.scanline { position: fixed; z-index: 5; pointer-events: none; top: -20%; left: 0; width: 100%; height: 1px; opacity: .16; background: linear-gradient(90deg, transparent, var(--cyan), transparent); animation: scan 14s linear infinite; }
.site-header { height: 78px; width: min(1240px, calc(100% - 48px)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(38,57,75,.72); position: relative; z-index: 10; }
.brand, .footer-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 600; letter-spacing: .08em; font-size: 15px; }
.brand-mark { width: 10px; height: 10px; display: inline-block; background: var(--cyan); border-radius: 2px; box-shadow: 0 0 18px rgba(85,200,255,.42); }
.main-nav { display: flex; gap: 30px; margin-left: auto; margin-right: 36px; }
.main-nav a { font: 12px var(--mono); color: var(--muted); transition: color .2s ease; }
.main-nav a:hover, .main-nav a:focus-visible { color: var(--cyan); }
.header-status, .terminal-live, .eyebrow, .hero-footnote, .terminal-bottom, .thought-label, .thought-index, .card-number, .card-meta, .section-note, .log-header, .log-date, .log-status, .log-footer, .aside-label, .about-signature, .footer-status, .copyright { font-family: var(--mono); letter-spacing: .035em; }
.header-status { font-size: 9px; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.status-dot, .tiny-pulse { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(85,200,255,.5); }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; }
.menu-toggle span { display: block; width: 21px; height: 1px; background: var(--cyan); margin: 5px 0; }
.hero { min-height: 650px; display: grid; grid-template-columns: 1.03fr .97fr; align-items: center; gap: 58px; padding-top: 66px; padding-bottom: 82px; }
.hero-grid-overlay { position: absolute; z-index: -1; inset: 20px -40px 30px 35%; opacity: .13; pointer-events: none; background-image: linear-gradient(rgba(85,200,255,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(85,200,255,.10) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(90deg, transparent, black 45%, transparent); }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--cyan); font-size: 10px; margin: 0 0 24px; }
.eyebrow-line { width: 22px; height: 1px; background: var(--cyan); }
.hero-kicker { color: #aebbc9; font: 600 14px var(--mono); letter-spacing: .18em; margin: 0 0 -10px; }
.hero h1 { font-size: clamp(42px, 5.4vw, 70px); line-height: 1.08; letter-spacing: -.065em; margin: 16px 0 25px; font-weight: 800; }
.hero-taglines { margin: 0 0 22px; }
.hero-taglines p { font-size: clamp(19px, 2vw, 25px); line-height: 1.42; letter-spacing: -.04em; margin: 3px 0; font-weight: 600; }
.headline-second { color: #c2ceda; }
.hero-description { max-width: 490px; color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0; }
.hero-description em { display: inline; color: var(--text); font-style: normal; }
.question-highlight { color: #B7F34A !important; font-weight: 600; text-shadow: 0 0 14px rgba(183, 243, 74, .16); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 44px; padding: 0 17px; border-radius: 5px; font-size: 12px; font-weight: 600; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--cyan); color: #07111b; }
.button-primary:hover { background: #8cddff; }
.button-quiet { color: #d5e0ea; border: 1px solid #34485b; }
.button-quiet:hover { border-color: var(--cyan); }
.hero-footnote { display: flex; align-items: center; gap: 9px; font-size: 9px; color: var(--dim); margin-top: 32px; }
.tiny-pulse { animation: pulse 2.5s ease-in-out infinite; }
.terminal-window { position: relative; background: rgba(13,20,29,.96); border: 1px solid #2a4054; border-radius: 9px; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.28), 0 0 45px rgba(34,135,195,.06); transform: translateZ(0); }
.terminal-window::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(130deg, rgba(85,200,255,.035), transparent 40%); }
.terminal-topbar { height: 46px; display: flex; align-items: center; padding: 0 15px; gap: 12px; border-bottom: 1px solid #223242; background: rgba(16,25,35,.86); }
.window-dots { display: flex; gap: 5px; }
.window-dots span { width: 7px; height: 7px; border-radius: 50%; background: #405365; }
.window-dots span:first-child { background: #5d7488; }
.terminal-title { color: #94a6b8; font: 10px var(--mono); }
.terminal-live { margin-left: auto; color: var(--dim); font-size: 8px; display: flex; align-items: center; gap: 6px; }
.terminal-live .status-dot { width: 5px; height: 5px; }
.terminal-body { padding: 25px 23px 17px; min-height: 282px; font: 11px/1.8 var(--mono); position: relative; }
.terminal-line { margin: 0 0 3px; white-space: nowrap; }
.prompt { color: var(--cyan); }
.command { color: #edf5fb; }
.terminal-output { margin: 0 0 17px 0; color: #9eafc0; overflow-wrap: anywhere; }
.terminal-output.cyan { color: var(--cyan); }
.file-list { display: flex; flex-wrap: wrap; gap: 8px 15px; }
.file-list span:nth-child(odd) { color: #c6d5e3; }
.file-list span:nth-child(even) { color: #7f9bb4; }
.final-prompt { margin-top: 8px; }
.cursor { display: inline-block; width: 7px; height: 13px; background: var(--cyan); vertical-align: -2px; animation: blink 1.1s steps(2, start) infinite; }
.terminal-bottom { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px; border-top: 1px solid #223242; color: #64788d; font-size: 8px; }
.thought-strip { border-top: 1px solid #1e2d3c; border-bottom: 1px solid #1e2d3c; background: rgba(13,20,29,.62); }
.thought-inner { min-height: 86px; width: min(1160px, calc(100% - 48px)); margin: auto; display: grid; grid-template-columns: 190px 1fr 110px; align-items: center; gap: 24px; }
.thought-label, .thought-index { font-size: 9px; color: var(--dim); }
.thought-label span { color: var(--cyan); }
.rotating-thought { margin: 0; font-size: clamp(16px, 2vw, 21px); font-weight: 600; letter-spacing: -.035em; transition: opacity .22s ease, transform .22s ease; }
.rotating-thought.is-changing { opacity: 0; transform: translateY(5px); }
.thought-index { text-align: right; }
.thought-index span { color: var(--cyan); }
.projects-section { padding-top: 105px; padding-bottom: 110px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.section-heading .eyebrow { margin-bottom: 11px; }
.section-heading h2, .about-terminal h2 { font-size: clamp(30px, 4vw, 43px); line-height: 1.15; letter-spacing: -.055em; margin: 0; }
.section-intro { max-width: 380px; margin: 0 0 3px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.project-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.project-card { min-height: 276px; padding: 21px 18px 17px; border: 1px solid #243647; border-radius: 7px; background: linear-gradient(145deg, rgba(16,25,35,.92), rgba(10,15,22,.94)); display: flex; flex-direction: column; position: relative; overflow: hidden; transition: transform .22s ease, border-color .22s ease, background .22s ease; }
.project-card::after { content: ""; position: absolute; width: 90px; height: 90px; top: -58px; right: -58px; border-radius: 50%; background: var(--cyan); opacity: 0; filter: blur(30px); transition: opacity .25s ease; }
.project-card:hover { transform: translateY(-4px); border-color: rgba(85,200,255,.7); background: linear-gradient(145deg, rgba(17,31,43,.98), rgba(10,15,22,.96)); }
.project-card:hover::after { opacity: .18; }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 23px; }
.card-icon { width: 37px; height: 37px; border: 1px solid #294458; background: #0c1721; display: grid; place-items: center; border-radius: 5px; color: var(--cyan); font: 600 15px var(--mono); }
.card-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.card-number { font-size: 8px; color: #61778c; }
.project-card h3 { margin: 0 0 9px; font-size: 16px; letter-spacing: -.025em; }
.project-card p { margin: 0 0 20px; color: #91a2b4; font-size: 11px; line-height: 1.8; }
.card-meta { display: flex; align-items: center; gap: 7px; margin-top: auto; color: #8195a8; font-size: 8px; }
.meta-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); }
.meta-amber { background: var(--amber); }
.card-link { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #243647; margin-top: 15px; padding-top: 13px; font: 9px var(--mono); color: #b4c3d1; }
.card-link span { color: var(--cyan); transition: transform .2s ease; }
.card-link:hover { color: var(--cyan); }
.card-link:hover span { transform: translate(2px,-2px); }
.section-note { margin: 19px 0 0; color: #657b8f; font-size: 9px; }
.experiments-section { background: #0b1017; border-top: 1px solid #1d2c3a; border-bottom: 1px solid #1d2c3a; padding: 90px 0 92px; }
.log-panel { border: 1px solid #293c4e; border-radius: 7px; background: #080d13; overflow: hidden; }
.log-header { display: flex; justify-content: space-between; gap: 14px; padding: 14px 18px; color: #74899d; font-size: 9px; border-bottom: 1px solid #233444; background: #101923; }
.log-entry { display: grid; grid-template-columns: 80px 1fr 65px; gap: 18px; align-items: start; padding: 19px 18px; border-bottom: 1px solid #1b2a38; transition: background .2s ease; }
.log-entry:hover { background: rgba(85,200,255,.035); }
.log-date { color: var(--cyan); font-size: 10px; padding-top: 2px; }
.log-entry h3 { font-size: 13px; margin: 0 0 3px; font-weight: 600; }
.log-entry p { font-size: 11px; color: #8fa1b3; margin: 0; }
.log-status { justify-self: end; font-size: 8px; color: #7d91a5; border: 1px solid #2c4053; padding: 3px 6px; border-radius: 3px; }
.log-footer { padding: 13px 18px; font-size: 9px; color: #75889b; }
.about-section { display: grid; grid-template-columns: 1.3fr .7fr; gap: 70px; padding-top: 110px; padding-bottom: 110px; align-items: center; }
.about-terminal .eyebrow { margin-bottom: 17px; }
.about-terminal h2 { margin-bottom: 24px; }
.about-terminal > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.95; max-width: 650px; }
.about-signature { display: flex; align-items: center; gap: 12px; margin-top: 30px; color: var(--cyan); font-size: 9px; }
.signature-line { width: 30px; height: 1px; background: var(--cyan); }
.about-aside { border: 1px solid #293c4e; background: linear-gradient(145deg, #101923, #0b1118); border-radius: 7px; padding: 22px; }
.aside-stat { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0; border-bottom: 1px solid #253545; }
.aside-label { font-size: 8px; color: #7b90a5; }
.aside-stat strong { font: 500 11px var(--mono); color: #d8e5f0; text-align: right; }
.aside-quote { color: var(--cyan); font-size: 15px; font-weight: 600; letter-spacing: -.03em; padding-top: 21px; }
.site-footer { width: min(1240px, calc(100% - 48px)); min-height: 105px; border-top: 1px solid #223242; margin: auto; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; gap: 16px; padding: 22px 0; }
.footer-brand { font-size: 12px; }
.site-footer > p { color: #8a9caf; font-size: 11px; text-align: center; margin: 0; }
.footer-status { display: flex; align-items: center; justify-content: end; gap: 8px; font-size: 8px; color: #8093a7; }
.copyright { grid-column: 1 / -1; color: #586d81; font-size: 8px; text-align: center; margin-top: 4px; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .65s ease, transform .65s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@keyframes blink { to { visibility: hidden; } }
@keyframes pulse { 0%,100% { opacity: .5; box-shadow: 0 0 3px rgba(85,200,255,.3); } 50% { opacity: 1; box-shadow: 0 0 12px rgba(85,200,255,.8); } }
@keyframes scan { from { transform: translateY(0); } to { transform: translateY(130vh); } }
@media (max-width: 980px) {
  .hero { gap: 32px; grid-template-columns: 1fr .92fr; min-height: 610px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .project-card { min-height: 245px; }
  .about-section { gap: 38px; }
  .header-status { display: none; }
}
@media (max-width: 720px) {
  .section-shell, .site-header, .thought-inner, .site-footer { width: min(100% - 36px, 560px); }
  .site-header { height: 68px; }
  .main-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; margin: 0; padding: 14px; border: 1px solid #293c4e; background: #0d141d; border-radius: 7px; flex-direction: column; gap: 0; }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px 8px; }
  .menu-toggle { display: block; }
  .hero { grid-template-columns: 1fr; gap: 36px; min-height: auto; padding-top: 68px; padding-bottom: 55px; }
  .hero h1 { font-size: clamp(43px, 12vw, 64px); }
  .hero-grid-overlay { inset: 0 -18px 20px 10%; }
  .terminal-body { padding: 22px 17px 15px; min-height: 260px; font-size: 10px; }
  .terminal-topbar { padding: 0 12px; }
  .terminal-bottom { font-size: 7px; }
  .thought-inner { min-height: 104px; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 17px 0; }
  .thought-label { grid-column: 1 / -1; }
  .rotating-thought { font-size: 16px; line-height: 1.45; }
  .thought-index { font-size: 8px; }
  .projects-section, .about-section { padding-top: 72px; padding-bottom: 75px; }
  .section-heading { display: block; margin-bottom: 25px; }
  .section-intro { margin-top: 14px; }
  .project-grid { gap: 10px; }
  .project-card { min-height: 270px; padding: 16px 13px 14px; }
  .card-top { margin-bottom: 17px; }
  .project-card h3 { font-size: 14px; }
  .project-card p { font-size: 10px; }
  .card-link { font-size: 8px; }
  .experiments-section { padding: 72px 0; }
  .log-header { font-size: 8px; padding: 12px; }
  .log-entry { grid-template-columns: 54px 1fr; gap: 10px; padding: 16px 12px; }
  .log-status { grid-column: 2; justify-self: start; margin-top: 4px; }
  .log-entry h3 { font-size: 12px; }
  .log-entry p { font-size: 10px; }
  .about-section { grid-template-columns: 1fr; gap: 28px; }
  .site-footer { grid-template-columns: 1fr auto; }
  .site-footer > p { display: none; }
  .footer-status { font-size: 7px; }
  .copyright { text-align: left; }
}
@media (max-width: 380px) {
  .section-shell, .site-header, .thought-inner, .site-footer { width: calc(100% - 28px); }
  .project-grid { grid-template-columns: 1fr; }
  .project-card { min-height: 220px; }
  .hero-actions { gap: 8px; }
  .button { padding-inline: 12px; }
  .terminal-live { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}


/* v1.2: pin rotating thought to the bottom of the initial hero viewport */
html { scroll-padding-top: 20px; }
section[id] { scroll-margin-top: 20px; }
.hero {
  min-height: max(650px, calc(100svh - 78px));
  padding-top: 50px;
  padding-bottom: 104px;
  row-gap: 0;
}
.hero-thought-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  border: 1px solid #1e2d3c;
  border-radius: 7px;
  background: rgba(13,20,29,.88);
}
.hero-thought-strip .thought-inner {
  width: 100%;
  min-height: 76px;
  padding: 12px 18px;
  grid-template-columns: 190px 1fr 110px;
}
@media (max-width: 980px) {
  .hero { min-height: max(680px, calc(100svh - 68px)); padding-bottom: 100px; }
  .hero-thought-strip .thought-inner { grid-template-columns: 155px 1fr 100px; gap: 16px; }
}
@media (max-width: 720px) {
  .hero {
    min-height: auto;
    padding-top: 48px;
    padding-bottom: 0;
  }
  .hero-thought-strip {
    position: relative;
    margin-top: 28px;
    left: auto;
    right: auto;
  }
  .hero-thought-strip .thought-inner {
    grid-template-columns: 1fr auto;
    min-height: 94px;
    padding: 13px 14px;
    gap: 7px 12px;
  }
}


/* v1.4: show the rotating thought inside the opening hero viewport */
.hero {
  min-height: max(760px, calc(100svh - 78px));
  padding-top: 50px;
  padding-bottom: 0;
  row-gap: 0;
  align-content: center;
}
.hero-thought-strip {
  position: relative;
  grid-column: 1 / -1;
  left: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  margin-top: 26px;
  border: 1px solid #1e2d3c;
  border-radius: 7px;
  background: rgba(13,20,29,.88);
}
.hero-thought-strip .thought-inner {
  width: 100%;
  min-height: 76px;
  padding: 12px 18px;
  grid-template-columns: 190px 1fr 110px;
}
/* Anchor links should land at the top of the destination section. */
html { scroll-padding-top: 0; }
section[id] { scroll-margin-top: 0; }
#projects:target, #about:target, #experiments:target {
  scroll-margin-top: 0;
  padding-top: 24px;
}
@media (max-width: 980px) {
  .hero { min-height: max(800px, calc(100svh - 68px)); padding-bottom: 0; }
  .hero-thought-strip .thought-inner {
    grid-template-columns: 155px 1fr 100px;
    gap: 16px;
  }
}
@media (max-width: 720px) {
  .hero {
    min-height: auto;
    padding-top: 48px;
    padding-bottom: 44px;
    align-content: start;
  }
  .hero-thought-strip { margin-top: 28px; }
  .hero-thought-strip .thought-inner {
    grid-template-columns: 1fr auto;
    min-height: 94px;
    padding: 13px 14px;
    gap: 7px 12px;
  }
}


/* v1.5 FIX: compact hero so the navigation buttons and rotating thought are visible together.
   Do not vertically center a tall hero grid; let its content determine the height. */
@media (min-width: 721px) {
  .hero {
    min-height: 0 !important;
    height: auto !important;
    padding-top: 42px !important;
    padding-bottom: 24px !important;
    align-content: start !important;
    row-gap: 0 !important;
  }
  .hero-copy,
  .terminal-window {
    align-self: center;
  }
  .hero-thought-strip {
    position: relative !important;
    inset: auto !important;
    grid-column: 1 / -1 !important;
    margin-top: 20px !important;
    width: 100% !important;
  }
  .hero-thought-strip .thought-inner {
    min-height: 68px !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
  }
}
@media (min-width: 721px) and (max-height: 850px) {
  .hero {
    padding-top: 26px !important;
    padding-bottom: 18px !important;
    column-gap: 34px !important;
  }
  .hero h1 {
    font-size: clamp(42px, 4.6vw, 62px) !important;
    margin-top: 12px !important;
    margin-bottom: 18px !important;
  }
  .hero-taglines p {
    font-size: clamp(18px, 1.8vw, 23px) !important;
  }
  .hero-description {
    font-size: 13px !important;
    line-height: 1.7 !important;
  }
  .hero-actions {
    margin-top: 20px !important;
  }
  .hero-footnote {
    margin-top: 20px !important;
  }
  .terminal-body {
    min-height: 245px !important;
    padding-top: 20px !important;
    padding-bottom: 12px !important;
  }
}
@media (max-width: 720px) {
  .hero {
    min-height: 0 !important;
    height: auto !important;
    padding-top: 38px !important;
    padding-bottom: 32px !important;
    align-content: start !important;
  }
  .hero-thought-strip {
    position: relative !important;
    inset: auto !important;
    margin-top: 22px !important;
  }
}


/* v1.6: highlight the terminal motto with distinct cyan emphasis */
.motto-highlight {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 5px;
  padding: 5px 9px;
  margin-top: -5px;
  border-left: 2px solid var(--cyan);
  border-radius: 0 4px 4px 0;
  background: rgba(85, 200, 255, .075);
  color: #dceaf5;
}
.motto-quote {
  color: var(--cyan);
  font-weight: 600;
  text-shadow: 0 0 14px rgba(85, 200, 255, .16);
}
.motto-dash { color: #718ba2; }
.motto-answer { color: #eaf5fc; font-weight: 500; }


/* v1.7: highlighter-lime motto treatment */
.motto-highlight {
  border-left-color: #B7F34A;
  background: rgba(183, 243, 74, .075);
}
.motto-quote {
  color: #B7F34A;
  text-shadow: 0 0 14px rgba(183, 243, 74, .2);
}
.motto-dash { color: #718ba2; }
.motto-answer { color: #eaf5fc; font-weight: 500; }

/* LAB_RULE output: lime markers, restrained terminal text */
.lab-rule-output { margin-top: -5px; margin-bottom: 17px; color: #eaf5fc; }
.lab-rule-output p { margin: 0 0 4px; }
.lab-rule-marker { color: #B7F34A; font-weight: 700; padding-right: 4px; }


/* v1.8: mobile retouch — tighter rhythm, readable terminal, and safer wrapping */
@media (max-width: 720px) {
  html { scroll-padding-top: 12px; }
  section[id] { scroll-margin-top: 12px; }

  .section-shell,
  .site-header,
  .thought-inner,
  .site-footer {
    width: calc(100% - 32px);
  }

  .site-header {
    height: 64px;
  }
  .brand {
    font-size: 13px;
    letter-spacing: .1em;
  }
  .brand-mark {
    width: 9px;
    height: 9px;
  }
  .main-nav {
    top: 56px;
    padding: 8px;
  }
  .main-nav a {
    font-size: 11px;
    padding: 11px 9px;
  }
  .header-status { display: none; }

  .hero {
    padding-top: 42px !important;
    padding-bottom: 30px !important;
    gap: 0;
  }
  .hero-copy { min-width: 0; }
  .eyebrow {
    font-size: 9px;
    margin-bottom: 21px;
  }
  .hero-kicker {
    font-size: 11px;
    letter-spacing: .16em;
    margin-bottom: -7px;
  }
  .hero h1 {
    font-size: clamp(39px, 11.4vw, 56px);
    line-height: 1.02;
    letter-spacing: -.07em;
    margin: 15px 0 23px;
    overflow-wrap: normal;
  }
  .hero-taglines {
    margin-bottom: 18px;
  }
  .hero-taglines p {
    font-size: clamp(19px, 5.3vw, 24px);
    line-height: 1.36;
    letter-spacing: -.045em;
  }
  .hero-description {
    font-size: 13px;
    line-height: 1.8;
    max-width: 100%;
  }
  .hero-description em { font-weight: 600; }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 23px;
  }
  .button {
    width: 100%;
    min-height: 44px;
    padding: 0 10px;
    gap: 7px;
    font-size: 11px;
    white-space: nowrap;
  }
  .hero-footnote {
    margin-top: 22px;
    font-size: 8px;
    letter-spacing: .025em;
  }

  .terminal-window {
    width: 100%;
    min-width: 0;
    margin-top: 30px;
    border-radius: 7px;
  }
  .terminal-topbar {
    height: 42px;
    padding: 0 11px;
    gap: 9px;
  }
  .terminal-title { font-size: 9px; }
  .terminal-live { font-size: 7px; }
  .window-dots { gap: 4px; }
  .window-dots span { width: 6px; height: 6px; }
  .terminal-body {
    min-height: 0 !important;
    padding: 18px 13px 15px;
    font-size: 9px;
    line-height: 1.85;
    overflow-wrap: anywhere;
  }
  .terminal-line {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .terminal-output {
    margin-bottom: 15px;
  }
  .file-list { gap: 5px 11px; }
  .terminal-bottom {
    min-height: 32px;
    padding: 0 10px;
    font-size: 6.5px;
    letter-spacing: .015em;
  }
  .motto-highlight {
    display: flex;
    width: fit-content;
    max-width: 100%;
    padding: 4px 7px;
    gap: 3px;
  }

  .hero-thought-strip {
    margin-top: 18px !important;
    border-radius: 6px;
  }
  .hero-thought-strip .thought-inner {
    min-height: 0;
    padding: 13px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
  }
  .thought-label {
    grid-column: 1 / -1;
    font-size: 8px;
  }
  .rotating-thought {
    min-width: 0;
    font-size: clamp(14px, 4vw, 17px);
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .thought-index {
    font-size: 7px;
    white-space: nowrap;
  }

  .projects-section,
  .about-section {
    padding-top: 64px;
    padding-bottom: 66px;
  }
  .section-heading h2,
  .about-terminal h2 {
    font-size: clamp(29px, 8vw, 36px);
  }
  .section-intro {
    font-size: 12px;
    line-height: 1.8;
  }
  .project-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }
  .project-card {
    min-height: 0;
    padding: 18px 16px 15px;
  }
  .card-top { margin-bottom: 16px; }
  .project-card h3 { font-size: 15px; }
  .project-card p {
    font-size: 11px;
    line-height: 1.8;
    margin-bottom: 17px;
  }
  .card-link { font-size: 9px; }
  .section-note {
    font-size: 8px;
    line-height: 1.8;
  }

  .experiments-section { padding: 64px 0; }
  .log-header {
    flex-wrap: wrap;
    font-size: 7px;
    line-height: 1.7;
  }
  .log-entry {
    grid-template-columns: 47px minmax(0, 1fr);
    gap: 9px;
  }
  .log-date { font-size: 8px; }
  .log-entry h3 { font-size: 12px; }
  .log-entry p { font-size: 10px; line-height: 1.75; }

  .about-section { gap: 25px; }
  .about-terminal > p:not(.eyebrow) {
    font-size: 12px;
    line-height: 1.85;
  }
  .about-aside { padding: 17px; }
  .aside-label { font-size: 7px; }
  .aside-stat strong { font-size: 10px; }
  .aside-quote { font-size: 14px; }

  .site-footer {
    min-height: 90px;
    padding: 18px 0;
    gap: 12px;
  }
  .footer-brand { font-size: 10px; }
  .footer-status { font-size: 6px; }
  .copyright { font-size: 7px; line-height: 1.7; }
}

@media (max-width: 390px) {
  .section-shell,
  .site-header,
  .thought-inner,
  .site-footer {
    width: calc(100% - 28px);
  }
  .hero h1 { font-size: clamp(36px, 10.8vw, 43px); }
  .hero-taglines p { font-size: 18px; }
  .hero-actions { grid-template-columns: 1fr; }
  .button { justify-content: space-between; padding-inline: 14px; }
  .terminal-live { font-size: 6px; }
  .terminal-body { font-size: 8px; padding-inline: 10px; }
  .terminal-bottom { font-size: 5.8px; }
  .thought-index { font-size: 6.5px; }
  .rotating-thought { font-size: 14px; }
  .footer-status { letter-spacing: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .scanline { display: none; }
}


/* v1.9: mobile-only refinement — compact side-by-side hero buttons and 2x2 project cards.
   Desktop rules remain unchanged. */
@media (max-width: 720px) {
  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .hero-actions .button {
    min-width: 0;
    min-height: 40px;
    justify-content: center;
    padding: 0 8px;
    gap: 6px;
    font-size: 10px;
    white-space: nowrap;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .project-card {
    min-width: 0;
    min-height: 238px;
    padding: 13px 11px 11px;
  }
  .card-top {
    margin-bottom: 15px;
    gap: 6px;
  }
  .card-icon {
    width: 31px;
    height: 31px;
    font-size: 12px;
  }
  .card-icon svg {
    width: 18px;
    height: 18px;
  }
  .card-number {
    font-size: 7px;
  }
  .project-card h3 {
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .project-card p {
    font-size: 9px;
    line-height: 1.65;
    margin-bottom: 13px;
    overflow-wrap: anywhere;
  }
  .card-meta {
    font-size: 7px;
    line-height: 1.5;
    gap: 5px;
    overflow-wrap: anywhere;
  }
  .card-link {
    margin-top: 11px;
    padding-top: 10px;
    font-size: 7.5px;
    gap: 4px;
  }
}
@media (max-width: 390px) {
  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px;
  }
  .hero-actions .button {
    min-height: 39px;
    font-size: 9px;
    padding-inline: 6px;
    gap: 4px;
  }
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }
  .project-card {
    min-height: 242px;
    padding: 11px 9px 10px;
  }
  .project-card p { font-size: 8.5px; }
  .card-link { font-size: 7px; }
}


/* v2.1 mobile-only: show Current Thought with the opening hero content.
   Reorder only the mobile grid; desktop layout remains untouched. */
@media (max-width: 720px) {
  .hero {
    padding-bottom: 24px !important;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    row-gap: 0;
  }
  .hero-copy {
    grid-column: 1;
    grid-row: 1;
  }
  .hero-thought-strip {
    grid-column: 1;
    grid-row: 2;
    margin-top: 18px !important;
    position: relative !important;
    inset: auto !important;
    width: 100%;
  }
  .hero-thought-strip .thought-inner {
    min-height: 0;
    padding: 12px 11px;
  }
  .terminal-window {
    grid-column: 1;
    grid-row: 3;
    margin-top: 22px;
  }
}

/* v2.1.1 FIX: keep the Current Thought strip fully visible on shorter desktop viewports.
   Compact only the terminal's vertical rhythm; preserve the established layout. */
@media (min-width: 721px) and (max-height: 950px) {
  .terminal-body {
    padding-top: 15px !important;
    padding-bottom: 8px !important;
    line-height: 1.65 !important;
  }
  .terminal-output {
    margin-bottom: 11px !important;
  }
  .lab-rule-output {
    margin-bottom: 10px !important;
  }
  .hero-thought-strip {
    margin-top: 14px !important;
  }
}

/* v2.1.2 mobile-only: fit the full terminal in the phone viewport.
   Keep navigation and desktop styling unchanged. */
@media (max-width: 720px) {
  .hero {
    padding-top: 30px !important;
    padding-bottom: 18px !important;
  }
  .hero h1 {
    font-size: clamp(35px, 10.2vw, 48px) !important;
    margin-top: 12px;
    margin-bottom: 17px;
  }
  .eyebrow { margin-bottom: 16px; }
  .hero-taglines { margin-bottom: 14px; }
  .hero-description { line-height: 1.65; }
  .hero-actions { margin-top: 17px; }
  .hero-footnote { margin-top: 16px; }
  .hero-thought-strip { margin-top: 14px !important; }
  .hero-thought-strip .thought-inner { padding-top: 10px; padding-bottom: 10px; }
  .terminal-window { margin-top: 16px; }
  .terminal-topbar { height: 36px; }
  .terminal-body {
    padding: 12px 11px 10px;
    line-height: 1.65;
    font-size: 8.5px;
  }
  .terminal-output { margin-bottom: 10px; }
  .lab-rule-output { margin-bottom: 8px; }
  .terminal-bottom { min-height: 28px; }
}
