/* =========================================================================
   Cory Wilson — AI Portfolio
   Brand tokens, layout primitives, sections, cards.
   Lifted from personal-brand-board/index.html, extended for portfolio use.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ───── Tokens ───── */
:root {
  --ink:       #0B1014;
  --ink-2:     #11181E;
  --midnight:  #1A2E3B;
  --tidewater: #234052;
  --stoneware: #6F6357;
  --vellum:    #E8DCC8;
  --whitewash: #F1EEE7;
  --ember:     #B45A3C;
  --rule:      rgba(232,220,200,0.14);
  --rule-strong: rgba(232,220,200,0.28);
  --muted:     rgba(241,238,231,0.62);
  --serif:     "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:      "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --max:       1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; background: var(--ink); color: var(--whitewash); }

body {
  font-family: var(--sans);
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.55;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(35,64,82,0.45), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(180,90,60,0.10), transparent 55%),
    var(--ink);
  background-attachment: fixed;
  min-height: 100vh;
}

/* film grain — same as brand-board */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  z-index: 100;
}

a { color: var(--vellum); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s ease, color 0.2s ease; }
a:hover { color: var(--whitewash); border-bottom-color: var(--ember); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
img { max-width: 100%; display: block; }

/* ───── Layout shells ───── */
.page { max-width: var(--max); margin: 0 auto; padding: 0 72px; }
.section { padding: 88px 0; border-top: 1px solid var(--rule); position: relative; }
.section:first-of-type { border-top: 0; }
.section-head { margin-bottom: 56px; max-width: 820px; }
.section-head h2 { font-size: 44px; line-height: 1.05; margin: 0 0 14px; }
.section-head h2 em { font-style: italic; color: var(--vellum); }
.section-head p { color: var(--muted); margin: 0; font-size: 16px; max-width: 620px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--vellum);
  opacity: 0.7;
  margin: 0 0 18px;
}

/* ───── Sticky header ───── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(14px);
  background: rgba(11,16,20,0.72);
  border-bottom: 1px solid var(--rule);
}
.site-header .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}
.site-header .wordmark {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--whitewash);
  border-bottom: 0;
}
.site-header .wordmark em { font-style: italic; color: var(--vellum); }
.site-header nav {
  display: flex;
  gap: 28px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}
.site-header nav a { color: var(--vellum); opacity: 0.75; border-bottom: 0; padding: 4px 0; }
.site-header nav a:hover { opacity: 1; color: var(--whitewash); border-bottom: 1px solid var(--ember); }

/* ───── Hero ───── */
.hero {
  padding-top: 72px;
  padding-bottom: 96px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: stretch;
  min-height: 80vh;
  border-top: 0;
}
.hero-photo {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45), 0 0 0 1px rgba(232,220,200,0.08) inset;
  min-height: 560px;
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.05) saturate(0.95);
}
.hero-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(11,16,20,0.55) 100%);
  pointer-events: none;
}
.hero-photo .badge {
  position: absolute; left: 18px; top: 18px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  color: var(--vellum); text-transform: uppercase;
  background: rgba(11,16,20,0.6); padding: 6px 10px; border-radius: 2px;
  backdrop-filter: blur(4px);
}
.hero-meta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
}
.hero-meta .top .mono {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  color: var(--vellum); opacity: 0.7; text-transform: uppercase;
}
.hero-meta h1 {
  font-size: 96px; line-height: 0.94;
  margin: 28px 0 22px;
  font-weight: 300;
  letter-spacing: -0.025em;
}
.hero-meta h1 em { font-style: italic; color: var(--vellum); font-weight: 300; }
.hero-meta .tagline {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: 26px; line-height: 1.35;
  color: var(--vellum);
  margin: 0 0 28px; max-width: 480px;
}
.hero-meta .thesis {
  font-size: 16px;
  line-height: 1.65;
  color: var(--whitewash);
  max-width: 520px;
  margin-bottom: 28px;
}
.hero-meta .thesis .accent { color: var(--ember); font-weight: 500; }
.hero-meta .roles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.hero-meta .role-chip {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.18em; padding: 7px 12px;
  border: 1px solid var(--rule); border-radius: 2px;
  color: var(--vellum);
}
.hero-meta .bottom {
  font-size: 14px; color: var(--muted);
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 32px;
}
.hero-meta .bottom .kv .k {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--vellum); opacity: 0.6; margin-bottom: 4px;
}
.hero-meta .bottom .kv .v { color: var(--whitewash); }

/* ───── Section-head with number ───── */
.section-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ember);
  text-transform: uppercase;
  margin-bottom: 18px;
  display: block;
}

/* ───── Headliner card grid (2x2 large) ───── */
.headliner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.headliner-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: linear-gradient(160deg, rgba(26,46,59,0.45) 0%, rgba(11,16,20,0.6) 100%);
  text-decoration: none;
  color: var(--whitewash);
  min-height: 280px;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.headliner-card:hover {
  border-color: var(--rule-strong);
  background: linear-gradient(160deg, rgba(35,64,82,0.6) 0%, rgba(11,16,20,0.7) 100%);
  border-bottom: 1px solid var(--rule-strong);
  transform: translateY(-2px);
}
.headliner-card .h-eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--vellum); opacity: 0.7; margin-bottom: 18px;
}
.headliner-card h3 {
  font-family: var(--serif); font-size: 38px; line-height: 1.05;
  font-weight: 300; letter-spacing: -0.015em; margin-bottom: 14px;
}
.headliner-card h3 em { font-style: italic; color: var(--vellum); }
.headliner-card .h-role {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--vellum); opacity: 0.65; margin-bottom: 18px;
}
.headliner-card p.h-blurb {
  font-size: 15px; line-height: 1.6; color: var(--whitewash); margin-bottom: 28px;
  flex: 1;
}
.headliner-card .h-served {
  font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--vellum);
  margin-bottom: 24px;
  border-left: 2px solid var(--ember);
  padding-left: 14px;
}
.headliner-card .h-cta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ember);
  margin-top: auto;
  border-bottom: 0;
}
.headliner-card .h-cta::after {
  content: " →";
  transition: margin-left 0.2s ease;
}
.headliner-card:hover .h-cta::after { margin-left: 4px; }

.headliner-card .h-demos {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.headliner-card .h-demos a {
  color: var(--ember);
  border-bottom: 1px solid rgba(180,90,60,0.3);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
  position: relative;
}
.headliner-card .h-demos a::after {
  content: " →";
  margin-left: 2px;
  opacity: 0.7;
}
.headliner-card .h-demos a:hover {
  color: var(--vellum);
  border-bottom-color: var(--vellum);
}

/* ───── Short card grid (3-col) ───── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: rgba(17,24,30,0.4);
  text-decoration: none;
  color: var(--whitewash);
  min-height: 180px;
  transition: border-color 0.2s ease, background 0.25s ease;
}
.card:hover {
  border-color: var(--rule-strong);
  background: rgba(35,64,82,0.45);
  border-bottom-color: var(--rule-strong);
}
.card .c-name {
  font-family: var(--serif); font-size: 24px; font-weight: 400;
  letter-spacing: -0.01em; line-height: 1.1; margin-bottom: 6px;
}
.card .c-name em { font-style: italic; color: var(--vellum); }
.card .c-role {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--vellum); opacity: 0.65; margin-bottom: 14px;
}
.card p.c-blurb {
  font-size: 14px; line-height: 1.55; color: var(--whitewash); flex: 1;
  margin-bottom: 18px;
}
.card .c-foot {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}
.card .c-foot .c-link { color: var(--ember); border-bottom: 0; }

/* ───── About + Contact ───── */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: start;
}
.about-text { font-size: 16px; line-height: 1.7; color: var(--whitewash); max-width: 580px; }
.about-text p + p { margin-top: 16px; }
.about-text em { font-style: italic; color: var(--vellum); }

.contact-card {
  border: 1px solid var(--rule);
  background: rgba(17,24,30,0.5);
  border-radius: 4px;
  padding: 32px;
}
.contact-card .c-eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--vellum); opacity: 0.7; margin-bottom: 14px;
}
.contact-card h3 { font-size: 28px; font-weight: 300; margin-bottom: 20px; }
.contact-card h3 em { font-style: italic; color: var(--vellum); }
.contact-card .mailto {
  display: inline-block;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 22px;
  background: var(--ember);
  color: var(--ink);
  border-radius: 2px;
  border-bottom: 0;
  margin-top: 8px;
  margin-bottom: 22px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.contact-card .mailto:hover {
  background: var(--vellum);
  color: var(--ink);
  border-bottom: 0;
  transform: translateY(-1px);
}
.contact-card .secondary-cta {
  display: block;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--vellum); opacity: 0.8;
}

/* ───── Footer ───── */
.site-footer {
  margin-top: 0;
  padding: 36px 0 56px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--vellum);
  opacity: 0.55;
}
.site-footer .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 72px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

/* ───── Responsive ───── */
@media (max-width: 980px) {
  .page, .site-header .inner, .site-footer .inner { padding-left: 32px; padding-right: 32px; }
  .hero { grid-template-columns: 1fr; gap: 32px; min-height: auto; padding-top: 48px; }
  .hero-photo { min-height: 380px; }
  .hero-meta h1 { font-size: 64px; }
  .headliner-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .section-head h2 { font-size: 32px; }
  .site-header nav { gap: 16px; font-size: 10px; }
}

@media (max-width: 600px) {
  .page, .site-header .inner, .site-footer .inner { padding-left: 22px; padding-right: 22px; }
  .hero-meta h1 { font-size: 48px; }
  .hero-meta .tagline { font-size: 20px; }
  .card-grid { grid-template-columns: 1fr; }
  .site-header nav { display: none; }
  .hero-meta .bottom { grid-template-columns: 1fr; }
}

/* =========================================================================
   Motion / interactivity layer
   ========================================================================= */

/* scroll-driven progress bar */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: var(--scroll, 0%);
  background: linear-gradient(90deg, var(--ember), var(--vellum));
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(180,90,60,0.6);
}

/* reveal-on-scroll base */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"].in { transition-delay: 0.08s; }
.reveal[data-delay="2"].in { transition-delay: 0.16s; }
.reveal[data-delay="3"].in { transition-delay: 0.24s; }
.reveal[data-delay="4"].in { transition-delay: 0.32s; }
.reveal[data-delay="5"].in { transition-delay: 0.40s; }
.reveal[data-delay="6"].in { transition-delay: 0.48s; }
.reveal[data-delay="7"].in { transition-delay: 0.56s; }

/* word-by-word reveal for thesis */
.word {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.word.in {
  opacity: 1;
  transform: translateY(0);
}

/* card 3D tilt */
.card, .headliner-card {
  transform-style: preserve-3d;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.35s ease;
  will-change: transform;
}
.card:hover, .headliner-card:hover {
  box-shadow:
    0 18px 40px rgba(0,0,0,0.45),
    0 0 0 1px rgba(180,90,60,0.45) inset,
    0 0 36px rgba(180,90,60,0.10);
}

/* hero photo cursor tilt + parallax */
.hero-photo {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.hero-photo img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Ember CTA pulse */
@keyframes ember-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180,90,60,0.5); }
  50% { box-shadow: 0 0 0 16px rgba(180,90,60,0); }
}
.contact-card .mailto {
  animation: ember-pulse 2.6s ease-in-out infinite;
}

/* animated counter */
.counter {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  color: var(--vellum);
  letter-spacing: -0.02em;
}

/* =========================================================================
   Demo / pseudo-terminal section
   ========================================================================= */

.demo-section {
  padding: 56px 0 88px;
  border-top: 1px solid var(--rule);
}
.demo-section .demo-eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ember);
  text-align: center; margin-bottom: 22px; opacity: 0.85;
}
.demo-section .demo-deck {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  color: var(--vellum);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.4;
}

.terminal {
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(35,64,82,0.4), transparent 60%),
    rgba(11,16,20,0.92);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0,0,0,0.5), 0 0 0 1px rgba(232,220,200,0.04);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--whitewash);
  overflow: hidden;
  max-width: 860px;
  margin: 0 auto;
}
.terminal-header {
  background: rgba(26,46,59,0.5);
  padding: 11px 16px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--vellum);
}
.terminal-dots {
  display: flex; gap: 6px;
}
.terminal-dots span {
  display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
}
.terminal-dots span:nth-child(1) { background: #ff5f57; opacity: 0.7; }
.terminal-dots span:nth-child(2) { background: #febc2e; opacity: 0.7; }
.terminal-dots span:nth-child(3) { background: #28c840; opacity: 0.7; }
.terminal-title { opacity: 0.7; }
.terminal-body {
  padding: 22px 26px;
  min-height: 360px;
  white-space: pre-wrap;
  word-break: break-word;
  font-feature-settings: "ss01" on, "ss02" on;
}
.terminal-body .prompt { color: var(--ember); font-weight: 500; }
.terminal-body .you    { color: var(--vellum); }
.terminal-body .claude { color: var(--whitewash); }
.terminal-body .dim    { color: var(--muted); }
.terminal-body .sys    { color: var(--tidewater); filter: brightness(1.6); }
.caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--ember);
  vertical-align: -2px;
  margin-left: 2px;
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink {
  50% { opacity: 0; }
}

/* respect users who don't want motion */
@media (prefers-reduced-motion: reduce) {
  .reveal, .word { opacity: 1; transform: none; transition: none; }
  .contact-card .mailto { animation: none; }
  .caret { animation: none; }
  html { scroll-behavior: auto; }
}

/* ───── Print (basic) ───── */
@media print {
  body { background: var(--ink) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body::after { display: none; }
  .site-header { position: static; }
  .hero { page-break-after: always; min-height: auto; }
  .section { page-break-inside: avoid; padding: 28px 0; }
}
