/* ─── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Tokens ───────────────────────────────────────────────────── */
:root {
  --bg:         #0A0A0A;
  --bg-2:       #0F0F0F;
  --surface:    transparent;
  --border:     rgba(255,255,255,0.08);
  --border-2:   rgba(196,132,92,0.28);
  --ink:        #EDE8DF;
  --ink-2:      rgba(237,232,223,0.62);
  --ink-3:      rgba(237,232,223,0.52);   /* lifted for WCAG AA */
  --copper:     #C4845C;
  --copper-dim: rgba(196,132,92,0.75);
  --copper-glow:rgba(196,132,92,0.10);
  --max-w:      900px;
  --serif:      'Cormorant Garamond', 'Georgia', serif;
  --sans:       'Inter', system-ui, -apple-system, sans-serif;
  --radius:     6px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--copper); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* ─── Typography ───────────────────────────────────────────────── */
h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
h1 em { font-style: italic; color: var(--copper); }

h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
}
h2 em { font-style: italic; color: var(--copper); }

h3 {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

p { color: var(--ink-2); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper-dim);
  margin-bottom: 16px;
}

/* ─── Layout ───────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 32px; }
section { padding: 120px 0; position: relative; }

/* ─── Glow decoration ──────────────────────────────────────────── */
.glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  z-index: 0;
}
.glow-copper { background: radial-gradient(circle, rgba(196,132,92,0.18) 0%, transparent 70%); }
.glow-sm  { width: 300px; height: 300px; }
.glow-md  { width: 500px; height: 500px; }
.glow-lg  { width: 700px; height: 700px; }

/* ─── Nav ──────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(14,13,11,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transform: translateY(0);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
nav.hidden { transform: translateY(-100%); }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav-logo span { color: var(--copper); }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); text-decoration: none; }

/* ─── Dropdown nav ─────────────────────────────────────────────── */
/*
 * Hover-gap fix: .nav-dropdown sits flush to the bottom of .nav-item
 * (top: 100%) and carries padding-top as an invisible bridge so the
 * :hover chain is never broken while the cursor travels downward.
 * The caret arrow is part of the inner .nav-dropdown-inner container.
 */
.nav-item { position: relative; }
.nav-item:hover .nav-dropdown { opacity: 1; pointer-events: all; }
.nav-dropdown {
  position: absolute;
  top: 100%;                 /* flush — no gap */
  left: 50%;
  transform: translateX(-50%);
  padding-top: 10px;         /* invisible bridge — must match visual gap */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 300;
  /* No background/border here — that's on the inner container */
}
.nav-dropdown-inner {
  background: rgba(10,10,10,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 180px;
  position: relative;
}
.nav-dropdown-inner::before {
  content: '';
  position: absolute;
  top: -6px; left: 50%; transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--border);
}
.nav-dropdown a {
  display: block;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.nav-dropdown a:hover { background: rgba(196,132,92,0.1); color: var(--copper); }

/* ─── Hero ─────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('img/headshot.jpg');
  background-size: cover;
  background-position: center top;
  opacity: 0.12;
  transform: scale(1.08);
  transition: transform 0s linear;
  z-index: 0;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,10,10,0.25) 0%, rgba(10,10,10,0.55) 60%, rgba(10,10,10,1) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 175px;
  gap: 64px;
  align-items: center;
}
.hero h1 { margin-bottom: 24px; }
.hero-sub {
  font-size: 1rem;
  color: var(--ink-2);
  max-width: 480px;
  margin-bottom: 40px;
  line-height: 1.75;
}
.hero-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
/* Editorial portrait rectangle — double-frame technique */
.hero-photo {
  width: 165px;
  height: 220px;
  border-radius: 3px;
  object-fit: cover;
  object-position: center top;
  /* Inner border + 4px gap + outer copper frame = double-frame */
  box-shadow:
    0 0 0 1px rgba(10,10,10,1),
    0 0 0 2px rgba(196,132,92,0.45),
    0 24px 48px rgba(0,0,0,0.5);
}
.hero-photo-placeholder {
  width: 165px; height: 220px; border-radius: 3px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: var(--ink-3); text-align: center;
}

/* ─── Buttons ──────────────────────────────────────────────────── */
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 22px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: all 0.2s;
  cursor: pointer;
}
.btn-copper {
  background: rgba(196,132,92,0.12);
  border: 1px solid var(--border-2);
  color: var(--copper);
}
.btn-copper:hover { background: rgba(196,132,92,0.2); text-decoration: none; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-3);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.2); color: var(--ink); text-decoration: none; }

/* ─── Stats ────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat {
  padding: 32px 0;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat:not(:first-child) { padding-left: 40px; }
.stat-num {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--copper);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.stat-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.5;
}

/* ─── Section label ────────────────────────────────────────────── */
.section-label {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 16px;
}
.section-num {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--ink-3);
  margin-bottom: 8px;
}

/* ─── Cards ────────────────────────────────────────────────────── */
/*
 * Dashboard glassmorphic aesthetic: border-only definition.
 * Mouse-position radial gradient tracked via --mx/--my custom props
 * set by JS on mousemove. The ::before pseudo-element renders it.
 */
.card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 50%),
    rgba(196,132,92,0.07) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
}
.card:hover { border-color: rgba(196,132,92,0.32); }
.card:hover::before { opacity: 1; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card + .card { margin-top: 14px; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: 0.9rem; line-height: 1.65; }

/* ─── Tags ─────────────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  background: rgba(255,255,255,0.04);
  color: var(--ink-3);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* ─── Feature grid ─────────────────────────────────────────────── */
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.feature-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.feature-item strong { display: block; font-size: 0.82rem; color: var(--ink); margin-bottom: 4px; font-weight: 500; }
.feature-item span { font-size: 0.8rem; color: var(--ink-3); line-height: 1.5; }

/* ─── Project card ─────────────────────────────────────────────── */
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.project-card:hover { border-color: var(--border-2); }
.project-card-header { padding: 28px 32px 24px; border-bottom: 1px solid var(--border); }
.project-card-body { padding: 28px 32px; }
.project-card-footer {
  padding: 18px 32px;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.project-label {
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--copper-dim); margin-bottom: 8px;
}

/* ─── Callout ──────────────────────────────────────────────────── */
.callout {
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 32px 36px;
  margin-top: 48px;
  background: rgba(196,132,92,0.05);
  position: relative;
}
.callout::before {
  content: '';
  position: absolute;
  top: -1px; left: 32px; right: 32px; height: 1px;
  background: linear-gradient(to right, transparent, var(--copper-dim), transparent);
}
.callout h3 { color: var(--ink); margin-bottom: 10px; }
.callout p { font-size: 0.9rem; }

/* ─── Timeline ─────────────────────────────────────────────────── */
/* Semantic: ol.timeline > li.tl-item > time.tl-meta + … */
.timeline {
  padding-left: 28px;
  position: relative;
  list-style: none;   /* reset for both ol and ul */
}
.timeline::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 1px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 64px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -32px; top: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--copper); border: 2px solid var(--bg);
}
/* <time> element — WCAG AA: --ink-3 is now 0.52 opacity */
.tl-meta {
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: block;   /* <time> is inline by default */
}
.tl-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 400; color: var(--ink); margin-bottom: 14px; }
.tl-co { color: var(--ink-2); }
.tl-body ul { padding-left: 18px; }
.tl-body li { font-size: 0.88rem; color: var(--ink-2); margin-bottom: 10px; line-height: 1.65; }

/* ─── Horizontal scroller ──────────────────────────────────────── */
.h-scroll-wrap { overflow-x: auto; padding-bottom: 16px; cursor: grab; }
.h-scroll-wrap:active { cursor: grabbing; }
.h-scroll-wrap::-webkit-scrollbar { height: 3px; }
.h-scroll-wrap::-webkit-scrollbar-track { background: var(--border); }
.h-scroll-wrap::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
.h-scroll-track { display: flex; gap: 16px; width: max-content; padding: 4px 2px; }
.h-scroll-track .card { width: 300px; flex-shrink: 0; }

/* ─── Divider ──────────────────────────────────────────────────── */
.line { height: 1px; background: var(--border); margin: 0; }
.line-copper {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-2), transparent);
  width: 40%;
  margin: 0 auto;
}

/* ─── Contact items ────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; }
.contact-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.contact-item .c-label {
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px;
}
.contact-item .c-value { font-size: 0.95rem; font-weight: 400; color: var(--ink); }
.contact-item .c-sub { font-size: 0.78rem; color: var(--ink-3); margin-top: 4px; }

/* ─── Footer ───────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}
footer p { font-size: 0.78rem; color: var(--ink-3); }

/* ─── Reveal animations ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ─── App preview (replaces iframes) ──────────────────────────── */
/*
 * Cinematic static preview replaces live iframes.
 * Eliminates mobile scroll-traps and preserves page performance.
 * "Launch Live App" button opens app in isolated new tab.
 */
.app-preview {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.app-chrome-bar {
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-chrome-dots {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.app-chrome-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.app-chrome-url {
  font-size: 0.68rem;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  flex: 1;
}
.app-preview-body {
  height: 400px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-preview-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.app-preview-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 32px;
}
.app-preview-overlay h3 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 8px;
}
.app-preview-overlay p {
  font-size: 0.88rem;
  color: var(--ink-3);
  max-width: 360px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.app-preview-caption {
  font-size: 0.72rem;
  color: var(--ink-3);
  text-align: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

/* ─── Intro splash ──────────────────────────────────────────────── */
#intro {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  pointer-events: none;
}
#intro-name {
  font-family: var(--sans);
  font-size: clamp(1.6rem, 4.5vw, 3.5rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  will-change: transform, opacity;
}
#intro-period { color: var(--copper); }
/* Thin copper rule that fades out with the overlay */
#intro-line {
  width: 40px;
  height: 1px;
  background: var(--copper);
  opacity: 0.5;
  position: absolute;
  bottom: calc(50% - 36px);
}

/* ─── Nav logo period → arrow ──────────────────────────────────── */
.nav-logo { position: relative; }
.nav-period {
  display: inline-block;
  color: var(--copper);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-arrow {
  display: inline-block;
  color: var(--copper);
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  margin-left: -7px; /* overlap the space left by period */
  pointer-events: none;
}
.nav-logo:hover .nav-period { opacity: 0; transform: translateX(3px); }
.nav-logo:hover .nav-arrow  { opacity: 1; transform: translateX(0); }

/* ─── Custom copper cursor ──────────────────────────────────────── */
/* Must suppress cursor on interactive elements explicitly —
   body: none alone doesn't override browser's default pointer on a/button */
body, a, button, input, label, select, textarea, [role="button"] { cursor: none; }
#custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--copper);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  /* Only animate the visual properties, NOT position — keeps cursor instant */
  transition:
    width 0.18s ease,
    height 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    opacity 0.3s ease;
  mix-blend-mode: screen;
}
#custom-cursor.is-heading {
  width: 36px;
  height: 36px;
  border-color: rgba(196,132,92,0.5);
}
#custom-cursor.is-cta {
  width: 12px;
  height: 12px;
  background: rgba(196,132,92,0.7);
  border-color: transparent;
}
#custom-cursor.is-link {
  width: 14px;
  height: 14px;
  background: rgba(196,132,92,0.3);
}

/* ─── Stat counter pulse ────────────────────────────────────────── */
@keyframes stat-pulse {
  0%   { text-shadow: 0 0 0px rgba(196,132,92,0); }
  35%  { text-shadow: 0 0 30px rgba(196,132,92,0.45); }
  100% { text-shadow: 0 0 0px rgba(196,132,92,0); }
}
.stat.visible .stat-num {
  animation: stat-pulse 1.1s ease-out 0.4s 1 both;
}

/* ─── Typewriter cursor blink ───────────────────────────────────── */
@keyframes tw-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.tw-cursor {
  display: inline-block;
  color: var(--copper);
  animation: tw-blink 0.7s step-end infinite;
  margin-left: 1px;
  font-weight: 300;
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 680px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero-photo-wrap { display: none; }
  .stats-row { grid-template-columns: 1fr; }
  .stat { border-right: none; border-bottom: 1px solid var(--border); padding-left: 0 !important; }
  .card-grid, .feature-grid, .contact-grid { grid-template-columns: 1fr; }
}
