/* =========================================================================
   smithai.me — Ryan Smith, AI Product Executive
   Design system: dark, editorial, AI-forward
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg:        #09090B;
  --bg-2:      #0C0C0F;
  --panel:     #131318;
  --panel-2:   #17171D;
  --line:      rgba(255,255,255,0.08);
  --line-2:    rgba(255,255,255,0.14);

  --text:      #ECECEE;
  --muted:     #A2A2AC;
  --faint:     #82828C;

  --accent:    #5EEAD4;   /* luminous teal */
  --accent-2:  #2DD4BF;
  --accent-ink:#03130F;   /* dark ink for text on accent */
  --indigo:    #6366F1;   /* atmospheric glow only */

  --radius:    14px;
  --radius-lg: 22px;
  --container: 1120px;

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* Keep anchored sections clear of the 66px fixed nav when jumped to */
section[id] { scroll-margin-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Layout primitives ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: clamp(72px, 11vw, 132px); position: relative; }
.section--tight { padding-block: clamp(56px, 8vw, 96px); }
.divider { height: 1px; background: var(--line); border: 0; }

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 470;
  font-size: clamp(1.95rem, 4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-top: 18px;
}
.lede { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.18rem); max-width: 60ch; margin-top: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 550; font-size: 0.95rem;
  padding: 13px 22px; border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer; transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #7df3e1; box-shadow: 0 0 0 4px rgba(94,234,212,0.14); }
.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(94,234,212,0.05); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: 66px;
  display: flex; align-items: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(9,9,11,0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-family: var(--font-serif); font-size: 1.18rem; font-weight: 500; letter-spacing: -0.01em; }
.brand .dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 0.92rem; color: var(--muted); transition: color 0.2s var(--ease); position: relative; }
.nav-links a:hover { color: var(--text); }
.nav-links a.btn { color: var(--text); }
.nav-links a.btn:hover { color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 8px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(128px, 17vw, 188px); padding-bottom: clamp(72px, 10vw, 112px); overflow: hidden; }
.hero-glow { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-glow::before, .hero-glow::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px);
}
.hero-glow::before { width: 620px; height: 620px; top: -260px; left: -120px;
  background: radial-gradient(circle, rgba(94,234,212,0.16), transparent 68%); }
.hero-glow::after { width: 560px; height: 560px; top: -180px; right: -160px;
  background: radial-gradient(circle, rgba(99,102,241,0.13), transparent 66%); }
.hero-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 10%, transparent 72%);
          mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 10%, transparent 72%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 460;
  font-size: clamp(2.7rem, 6.4vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
  max-width: 16ch;
  margin-top: 26px;
}
.hero h1 .accent { color: var(--accent); font-style: italic; }
.hero-sub { color: var(--muted); font-size: clamp(1.05rem, 1.8vw, 1.28rem); max-width: 56ch; margin-top: 26px; line-height: 1.6; }
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero-meta { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; color: var(--faint); font-size: 0.9rem; }
.hero-meta .pip { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* ---------- Impact band ---------- */
.impact-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; margin-top: 44px;
}
.impact-cell { background: var(--bg); padding: 30px clamp(20px, 3vw, 34px); transition: background 0.3s var(--ease); }
.impact-cell:hover { background: var(--panel); }
.impact-num {
  font-family: var(--font-serif); font-weight: 480;
  font-size: clamp(2.4rem, 5vw, 3.7rem); line-height: 1; letter-spacing: -0.02em;
}
.impact-num .unit { color: var(--accent); }
.impact-cap { color: var(--muted); font-size: 0.96rem; margin-top: 14px; max-width: 30ch; }

/* ---------- Work cards ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 48px; }
.work-card {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(26px, 3vw, 36px);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  position: relative; overflow: hidden; min-height: 260px;
}
.work-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, rgba(94,234,212,0.08), transparent 55%);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.work-card:hover { border-color: var(--line-2); transform: translateY(-4px); box-shadow: 0 20px 50px -28px rgba(0,0,0,0.85); }
.work-card:hover::after { opacity: 1; }
.work-tag { font-size: 0.74rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.work-card h3 { font-family: var(--font-serif); font-weight: 480; font-size: clamp(1.4rem, 2.4vw, 1.85rem); line-height: 1.12; letter-spacing: -0.015em; margin-top: 16px; }
.work-card p { color: var(--muted); margin-top: 12px; font-size: 1rem; }
.work-foot { margin-top: auto; padding-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.work-metric { font-family: var(--font-serif); color: var(--accent); font-size: 1.05rem; font-style: italic; }
.work-link { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 550; color: var(--text); }
.work-link .arrow { transition: transform 0.25s var(--ease); }
.work-card:hover .work-link .arrow { transform: translateX(4px); }
.work-card:hover .work-link { color: var(--accent); }

/* ---------- Approach ---------- */
.split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.principles { display: grid; gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principle { background: var(--bg); padding: 26px 4px; display: grid; grid-template-columns: 40px 1fr; gap: 18px; align-items: baseline; }
.principle .pn { font-family: var(--font-serif); color: var(--faint); font-size: 1.05rem; }
.principle h4 { font-size: 1.12rem; font-weight: 620; letter-spacing: -0.01em; }
.principle p { color: var(--muted); margin-top: 7px; font-size: 0.99rem; }

/* ---------- About ---------- */
.about-body p { color: var(--muted); font-size: clamp(1.02rem, 1.5vw, 1.16rem); max-width: 64ch; }
.about-body p + p { margin-top: 18px; }
.about-body strong { color: var(--text); font-weight: 600; }
.cred-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.chip { border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 16px; font-size: 0.85rem; color: var(--muted); }
.chip b { color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact .section-title { font-size: clamp(2.3rem, 5.5vw, 3.8rem); max-width: 18ch; margin-inline: auto; }
.contact .lede { margin-inline: auto; }
.contact-cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 38px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 40px; }
.footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer .brand { font-size: 1.05rem; }
.footer-meta { color: var(--faint); font-size: 0.86rem; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--muted); font-size: 0.88rem; transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--accent); }

/* ---------- Case study ---------- */
.cs-hero { padding-top: clamp(120px, 16vw, 168px); padding-bottom: clamp(40px, 6vw, 64px); position: relative; overflow: hidden; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; transition: color 0.2s var(--ease); }
.back-link:hover { color: var(--accent); }
.back-link .arrow { transition: transform 0.25s var(--ease); }
.back-link:hover .arrow { transform: translateX(-3px); }
.cs-title { font-family: var(--font-serif); font-weight: 460; font-size: clamp(2.4rem, 5.6vw, 4.1rem); line-height: 1.04; letter-spacing: -0.025em; max-width: 18ch; margin-top: 22px; }
.cs-sub { color: var(--muted); font-size: clamp(1.08rem, 1.8vw, 1.32rem); max-width: 60ch; margin-top: 22px; }
.cs-meta { display: flex; flex-wrap: wrap; gap: 14px 40px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.cs-meta div { display: flex; flex-direction: column; gap: 4px; }
.cs-meta dt { font-size: 0.74rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.cs-meta dd { color: var(--text); font-size: 0.98rem; }

.cs-body { max-width: 720px; }
.cs-block + .cs-block { margin-top: clamp(40px, 5vw, 60px); }
.cs-block h2 { font-family: var(--font-serif); font-weight: 480; font-size: clamp(1.5rem, 2.8vw, 2.05rem); letter-spacing: -0.015em; margin-bottom: 18px; }
.cs-block p { color: var(--muted); font-size: 1.1rem; }
.cs-block p + p { margin-top: 16px; }
.cs-block strong { color: var(--text); font-weight: 600; }

.pullquote {
  font-family: var(--font-serif); font-style: italic; font-weight: 440;
  font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.3; letter-spacing: -0.015em;
  color: var(--text); padding: clamp(30px,4vw,44px) 0; border-block: 1px solid var(--line); margin-block: clamp(40px,5vw,60px);
}
.pullquote .accent { color: var(--accent); }

.cs-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-block: clamp(36px,4vw,48px); }
.cs-metrics .impact-cell { padding: 26px 24px; }

.callout { background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--radius); padding: 24px 26px; margin-top: 30px; }
.callout .work-tag { color: var(--accent); }
.callout h4 { font-size: 1.05rem; font-weight: 640; margin-top: 10px; }
.callout p { color: var(--muted); font-size: 0.99rem; margin-top: 8px; }

.cs-next { border-top: 1px solid var(--line); }
.cs-next a { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 8px; }
.cs-next .label { font-size: 0.78rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.cs-next h3 { font-family: var(--font-serif); font-weight: 480; font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -0.015em; margin-top: 10px; transition: color 0.25s var(--ease); }
.cs-next a:hover h3 { color: var(--accent); }
.cs-next .arrow { color: var(--accent); transition: transform 0.25s var(--ease); }
.cs-next a:hover .arrow { transform: translateX(5px); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
/* Above-the-fold hero content never waits on JS — a throttled background tab
   (recruiter cmd-clicking from Slack/LinkedIn) must not land on a blank hero. */
.hero .reveal, .cs-hero .reveal, .ai-hero .reveal { opacity: 1; transform: none; }
/* No-JS / script-failure fallback: never hide content when JS can't reveal it */
.no-js .reveal { opacity: 1 !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  .btn, .work-card, .arrow { transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links { position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 4px;
    background: rgba(9,9,11,0.96); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
    padding: 18px 24px 26px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: all 0.28s var(--ease); }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 10px 0; font-size: 1.02rem; width: 100%; }
  .nav-links a.btn { margin-top: 8px; }
  .nav-toggle { display: inline-flex; }
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 28px; }
  .cs-metrics { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .impact-grid { grid-template-columns: 1fr; }
  .hero-cta .btn, .contact-cta .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Accessibility: visible keyboard focus ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
:focus:not(:focus-visible) { outline: none; }
.btn:focus-visible { outline-offset: 4px; }

/* ---------- Recommendations ---------- */
.rec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 48px; }
.rec { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(26px, 3vw, 38px); margin: 0; display: flex; flex-direction: column; }
.rec-mark { font-family: var(--font-serif); color: var(--accent); font-size: 2.4rem; line-height: 1; opacity: 0.5; margin-bottom: 4px; }
.rec-quote { font-family: var(--font-serif); font-weight: 430; font-size: clamp(1.04rem, 1.4vw, 1.18rem); line-height: 1.55; letter-spacing: -0.01em; color: var(--text); margin: 0; }
.rec-foot { margin-top: auto; padding-top: 26px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rec-avatar { width: 44px; height: 44px; border-radius: 50%; background: rgba(94,234,212,0.10); border: 1px solid var(--line-2); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.9rem; flex-shrink: 0; }
.rec-who { display: flex; flex-direction: column; gap: 1px; }
.rec-name { font-weight: 620; font-size: 1rem; }
.rec-title { color: var(--muted); font-size: 0.85rem; }
.rec-rel { color: var(--faint); font-size: 0.8rem; }
.rec-link { margin-left: auto; color: var(--accent); font-size: 0.82rem; font-weight: 550; white-space: nowrap; }
.rec-link:hover { text-decoration: underline; }
@media (max-width: 760px) { .rec-grid { grid-template-columns: 1fr; } .rec-link { margin-left: 58px; } }
