/* ============================================================================
   Ben Keilman — portfolio · shared design system
   ============================================================================
   ONE stylesheet for every page. Tune the whole site from the :root variables.

   Light bands are warm cream / smokey grey (not bright white) with a subtle
   diagonal-hairline texture so they read like paper, not a glowing screen.
   Dark bands are soft charcoal with a matching faint texture. Bands are flat
   (no angled seams). Edit --paper / --mist / --ink to re-tone everything; edit
   the .band background-image rules to change the texture.
   ============================================================================ */

:root {
  /* ---- band palette (warm, easy on the eyes) ---- */
  --paper:   #ece6d7;   /* warm cream band       */
  --mist:    #dcdcd4;   /* smokey grey band      */
  --ink:     #2b2f37;   /* soft charcoal band    */
  --ink-2:   #353a44;   /* lighter charcoal      */

  /* ---- text (softened — no pure black, no pure white) ---- */
  --on-light:      #2a2d33;
  --on-light-soft: #545a61;
  --on-light-faint:#83887f;
  --on-dark:       #eef0f3;
  --on-dark-soft:  #c7ccd4;
  --on-dark-faint: #9aa0aa;

  /* ---- accent (single, with a light variant for dark bands) ---- */
  --accent:       #2f5bea;
  --accent-deep:  #1d3fb0;
  --accent-lite:  #7fa0ff;
  --accent-warm:  #ff6a3d;

  --line-light: #d8d2c4;
  --line-dark:  #444a55;
  --good:       #199e72;

  /* ---- textures (subtle diagonal hairlines) ---- */
  --texture-light: repeating-linear-gradient(45deg, rgba(74,62,38,0.045) 0px, rgba(74,62,38,0.045) 1px, transparent 1px, transparent 9px);
  --texture-dark:  repeating-linear-gradient(45deg, rgba(255,255,255,0.026) 0px, rgba(255,255,255,0.026) 1px, transparent 1px, transparent 9px);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --maxw: 1000px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--on-light);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---- Unified header (identical on every page) ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(236,230,215,0.9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-light);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-weight: 700; letter-spacing: -0.02em; color: var(--on-light); font-size: 1.02rem; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { color: var(--on-light-soft); font-size: 0.93rem; font-weight: 500; }
.nav-links a:hover { color: var(--on-light); text-decoration: none; }
.nav-links a.cta-link { color: var(--accent-deep); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--on-light); }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%; background: var(--accent); z-index: 100; transition: width 0.1s linear; }

/* ---- Bands (flat, alternating tones, subtle texture) ---- */
.band { position: relative; padding: clamp(78px, 12vh, 144px) 0; }
.band--paper { background-color: var(--paper); background-image: var(--texture-light); color: var(--on-light); }
.band--mist  { background-color: var(--mist);  background-image: var(--texture-light); color: var(--on-light); }
.band--ink   { background-color: var(--ink);   background-image: var(--texture-dark);  color: var(--on-dark); }
.band--ink-2 { background-color: var(--ink-2); background-image: var(--texture-dark);  color: var(--on-dark); }
.band--accent{ background-color: var(--accent);color: #fff; }
.band.tight  { padding: clamp(56px, 9vh, 100px) 0; }

/* ---- Type inside bands ---- */
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-deep); margin: 0 0 18px;
}
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--accent); display: inline-block; }
.statement { font-size: clamp(1.7rem, 4.4vw, 2.95rem); font-weight: 800; letter-spacing: -0.025em; margin: 0; max-width: 20ch; }
.statement.full { max-width: 24ch; }
.statement .em { color: var(--accent); }
.body-lg { font-size: clamp(1.04rem, 2vw, 1.22rem); color: var(--on-light-soft); max-width: 60ch; margin: 24px 0 0; }
.body-lg + .body-lg { margin-top: 18px; }
.lead-in { color: var(--on-light-faint); font-size: 0.95rem; margin: 0 0 10px; font-style: italic; }
.teaser-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; font-weight: 600; font-size: 1.02rem; color: var(--accent-deep); }

.band--ink .kicker, .band--ink-2 .kicker, .band--accent .kicker { color: var(--accent-lite); }
.band--ink .kicker::before, .band--ink-2 .kicker::before { background: var(--accent-lite); }
.band--accent .kicker, .band--accent .kicker::before { color: #fff; background: rgba(255,255,255,0.7); }
.band--ink .statement .em, .band--ink-2 .statement .em { color: var(--accent-lite); }
.band--ink .body-lg, .band--ink-2 .body-lg { color: var(--on-dark-soft); }
.band--accent .body-lg { color: #eef1ff; }
.band--ink .teaser-link, .band--ink-2 .teaser-link { color: var(--accent-lite); }
.band--ink .lead-in, .band--ink-2 .lead-in { color: var(--on-dark-faint); }

/* ---- Hero (dark, full-screen) — front page only ---- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  min-height: calc(100vh - 62px); display: flex; align-items: center;
  background: radial-gradient(1100px 560px at 72% -12%, #2c3a58 0%, #23272f 60%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 22px 22px; opacity: 0.5;
}
.hero .wrap { position: relative; z-index: 1; padding: 40px 24px 92px; }
.hero .eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-lite); margin-bottom: 26px; }
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 4.3rem); margin: 0 0 24px; max-width: 16ch; }
.hero h1 .em { color: var(--accent-lite); }
.hero .lede { font-size: clamp(1.05rem, 2.2vw, 1.32rem); color: #c4ccda; max-width: 54ch; margin: 0 0 38px; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.scroll-cue { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: #8b94a6; font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; z-index: 1; }
.scroll-cue span { display: block; text-align: center; font-size: 1.2rem; margin-top: 6px; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

.subhero { color: #fff; background: radial-gradient(900px 480px at 78% -20%, #2c3a58 0%, #23272f 62%); }
.subhero .eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-lite); margin-bottom: 20px; }
.subhero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 0 0 22px; max-width: 20ch; }
.subhero h1 .em { color: var(--accent-lite); }
.subhero .lede { font-size: clamp(1.03rem, 2vw, 1.24rem); color: #c4ccda; max-width: 60ch; }
.subhero .cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.subhero .meta-line { margin-top: 24px; font-size: 0.92rem; color: #8b94a6; }

/* ---- Buttons ---- */
.btn { display: inline-block; padding: 13px 24px; border-radius: 10px; font-weight: 600; font-size: 0.97rem; border: 1px solid transparent; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ondark { background: transparent; color: #fff; border-color: rgba(255,255,255,0.3); }
.btn-ondark:hover { border-color: #fff; }
.btn-ghost { background: transparent; color: var(--on-light); border-color: var(--line-light); }
.btn-ghost:hover { border-color: var(--on-light-faint); }
.band--ink .btn-ghost, .band--ink-2 .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.3); }

/* ---- Count-up stats ---- */
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 46px; }
.bigstat .n { font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.bigstat .l { font-size: 0.9rem; margin-top: 12px; }
.band--paper .bigstat .n, .band--mist .bigstat .n { color: var(--on-light); }
.band--paper .bigstat .l, .band--mist .bigstat .l { color: var(--on-light-soft); }
.band--ink .bigstat .n, .band--ink-2 .bigstat .n { color: #fff; }
.band--ink .bigstat .l, .band--ink-2 .bigstat .l { color: var(--on-dark-faint); }

/* ---- "Rare combination" split ---- */
.combo { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 44px; }
.combo .side { border-radius: var(--radius); padding: 30px; border: 1px solid var(--line-dark); background: rgba(255,255,255,0.04); }
.band--paper .combo .side, .band--mist .combo .side { border-color: var(--line-light); background: rgba(255,255,255,0.5); }
.combo .side h3 { font-size: 1.15rem; margin: 0 0 10px; }
.combo .side p { margin: 0; font-size: 0.97rem; color: inherit; opacity: 0.82; }
.combo-result { margin-top: 26px; text-align: center; font-size: clamp(1.15rem, 2.6vw, 1.55rem); font-weight: 700; letter-spacing: -0.02em; }
.combo-result .em { color: var(--accent); }
.band--ink .combo-result .em, .band--ink-2 .combo-result .em { color: var(--accent-lite); }

/* ---- Project cards (portfolio page) ---- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
.card { background: #f4f0e7; border: 1px solid var(--line-light); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; }
.card.feature { grid-column: 1 / -1; border-color: #b9c4ec; }
.card .tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--good); background: #dfeee5; padding: 4px 10px; border-radius: 999px; align-self: flex-start; margin-bottom: 14px; }
.card .tag.flagship { color: var(--accent-deep); background: #e1e8f8; }
.card .tag.soon { color: var(--on-light-faint); background: #e4e2d8; }
.card h3 { font-size: 1.24rem; margin: 0 0 6px; }
.card .stack { font-family: var(--mono); font-size: 0.79rem; color: var(--on-light-faint); margin-bottom: 14px; }
.card p { margin: 0 0 16px; color: var(--on-light-soft); font-size: 0.95rem; }
.card .metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { font-size: 0.8rem; font-weight: 600; color: var(--on-light-soft); background: var(--mist); border: 1px solid var(--line-light); border-radius: 999px; padding: 5px 11px; }
.card .links { margin-top: auto; display: flex; gap: 18px; font-weight: 600; font-size: 0.92rem; }

/* ---- Simple two-column groups ---- */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 38px; margin-top: 8px; }
.cols-2 li, .cols-2 p { color: inherit; opacity: 0.9; }
.group h3 { font-size: 1rem; margin: 0 0 8px; }
.group p { margin: 0; font-size: 0.93rem; opacity: 0.85; }

/* ---- Footer ---- */
footer.site-footer { background: var(--ink); color: var(--on-dark-faint); padding: 40px 0; font-size: 0.88rem; text-align: center; }
footer.site-footer a { color: var(--on-dark-soft); }

/* ---- Reveal-on-scroll (scoped under .js so no-JS = visible) ---- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: 0.08s; }
.js .reveal.d2 { transition-delay: 0.16s; }
.js .reveal.d3 { transition-delay: 0.24s; }

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

/* ---- Responsive ---- */
@media (max-width: 780px) {
  .nav-links { position: absolute; top: 62px; left: 0; right: 0; background: var(--paper); flex-direction: column; gap: 0; border-bottom: 1px solid var(--line-light); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 15px 24px; border-top: 1px solid var(--line-light); }
  .nav-toggle { display: block; }
  .statgrid { grid-template-columns: 1fr 1fr; gap: 28px 18px; }
  .combo, .cards, .cols-2 { grid-template-columns: 1fr; }
}

/* ---- nav arrow convention: trailing → marks a link to a DIFFERENT page ---- */
.nav-links a.ext::after { content: "→"; margin-left: 6px; font-size: 0.9em; opacity: 0.6; }
.nav-links a.active { color: var(--accent-deep); font-weight: 600; }

/* ============================================================================
   Shared components used by portfolio.html and first-90-days.html
   (themed for light bands; placed on cream/mist sections)
   ============================================================================ */
.trio { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 8px; }
.panel { border-radius: var(--radius); padding: 26px; border: 1px solid var(--line-light); background: rgba(255,255,255,0.5); }
.panel h3 { font-size: 1.1rem; margin: 0 0 8px; color: var(--on-light); }
.panel p { margin: 0; font-size: 0.95rem; color: var(--on-light-soft); }
.fail-label { font-weight: 800; color: #c0492f; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }

.principle { background: #e3e8fb; border: 1px solid #c2cef3; border-radius: var(--radius); padding: 26px 30px; margin: 36px 0 0; }
.principle p { margin: 0; font-size: 1.1rem; color: var(--accent-deep); font-weight: 600; line-height: 1.5; }

.stack-rows { display: flex; flex-direction: column; gap: 10px; }
.layer { display: grid; grid-template-columns: 1.1fr 1.4fr 1.3fr auto; gap: 18px; align-items: center; background: rgba(255,255,255,0.55); border: 1px solid var(--line-light); border-radius: var(--radius); padding: 16px 20px; }
.layer .lname { font-weight: 700; font-size: 0.98rem; color: var(--on-light); }
.layer .lwhat { color: var(--on-light-soft); font-size: 0.9rem; }
.layer .lsrc { color: var(--on-light-faint); font-size: 0.84rem; font-family: var(--mono); }
.badge { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; white-space: nowrap; text-align: center; }
.badge.given { color: var(--good); background: #dfeee5; }
.badge.buy { color: var(--accent-deep); background: #e1e8f8; }
.badge.build { color: #8a5a12; background: #f3e6cf; }
.stack-note { margin: 22px 0 0; color: var(--on-light-soft); font-size: 0.95rem; max-width: 70ch; }
.stack-note strong { color: var(--on-light); }

.phases { display: flex; flex-direction: column; gap: 22px; }
.phase { background: rgba(255,255,255,0.5); border: 1px solid var(--line-light); border-radius: var(--radius); padding: 28px 30px; border-left: 4px solid var(--accent); }
.phase .ptag { font-family: var(--mono); font-size: 0.82rem; font-weight: 700; color: var(--accent-deep); letter-spacing: 0.02em; }
.phase h3 { font-size: 1.3rem; margin: 6px 0 4px; }
.phase .goal { color: var(--on-light-soft); font-size: 0.98rem; margin: 0 0 18px; }
.phase ul { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.phase li { color: var(--on-light-soft); font-size: 0.96rem; padding-left: 24px; position: relative; }
.phase li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.phase li strong { color: var(--on-light); font-weight: 700; }
.win { margin-top: 18px; font-size: 0.92rem; color: #16654a; background: #dfeee5; border-radius: 8px; padding: 12px 16px; font-weight: 600; }

.metric-card ul { margin: 0; padding-left: 20px; color: var(--on-light-soft); font-size: 0.94rem; }
.metric-card li { margin-bottom: 8px; }
.metric-card .sub { color: var(--on-light-faint); font-size: 0.86rem; margin: 0 0 16px; }

@media (max-width: 780px) {
  .trio { grid-template-columns: 1fr; }
  .layer { grid-template-columns: 1fr; gap: 8px; align-items: start; }
  .badge { justify-self: start; }
}

/* ---- section headings (content pages) ---- */
.sec-label { display: inline-flex; align-items: center; gap: 10px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-deep); margin: 0 0 12px; }
.sec-label::before { content: ""; width: 26px; height: 2px; background: var(--accent); display: inline-block; }
.sec-title { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; }
.sec-intro { color: var(--on-light-soft); max-width: 66ch; margin: 0 0 36px; font-size: 1.02rem; }
.band--ink .sec-label, .band--ink-2 .sec-label { color: var(--accent-lite); }
.band--ink .sec-label::before, .band--ink-2 .sec-label::before { background: var(--accent-lite); }
.band--ink .sec-intro, .band--ink-2 .sec-intro { color: var(--on-dark-soft); }

/* ---- failure-mode pillars (3-col) ---- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillar { background: rgba(255,255,255,0.5); border: 1px solid var(--line-light); border-radius: var(--radius); padding: 24px; }
.pillar h3 { font-size: 1.05rem; margin: 0 0 8px; color: var(--on-light); }
.pillar p { margin: 0; color: var(--on-light-soft); font-size: 0.95rem; }
.pillar .x { font-weight: 800; color: #c0492f; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }

/* ---- two-col grids for metric cards + why-me ---- */
.metric-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.metric-card { background: rgba(255,255,255,0.5); border: 1px solid var(--line-light); border-radius: var(--radius); padding: 26px; }
.metric-card h3 { font-size: 1.05rem; margin: 0 0 6px; color: var(--on-light); }
.whyme { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.whyme-item h3 { font-size: 1rem; margin: 0 0 8px; color: var(--on-light); }
.whyme-item p { margin: 0; color: var(--on-light-soft); font-size: 0.94rem; }

/* ---- contact block (transparent, centered — sits on a dark band) ---- */
.contact-box { text-align: center; }
.contact-box h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 3vw, 2rem); }
.contact-box p { max-width: 54ch; margin: 0 auto 26px; opacity: 0.86; }
.contact-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

@media (max-width: 780px) {
  .pillars, .metric-cols, .whyme { grid-template-columns: 1fr; }
}

/* positive pillars (principles / ladder) - label in accent, not alarm red */
.pillars.pos .x { color: var(--accent-deep); }
