/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #F3F4F8;
  --bg-alt: #FFFFFF;
  --ink: #0B0E14;
  --ink-soft: #4B5468;
  --accent: #2F5AFF;
  --accent-warm: #FF5A36;
  --line: #DADEE6;
  --font-display: "Fraunces", serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; color: var(--ink); line-height: 1.15; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 400; margin-bottom: 1.25rem; letter-spacing: -0.01em; }
h1 em { font-style: italic; color: var(--accent); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 2.5rem; text-align: center; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
p, li { font-size: 1rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}
.eyebrow.center { text-align: center; }

/* ---------- Layout ---------- */
.section { padding: 6.5rem 1.75rem; max-width: 1120px; margin: 0 auto; }
.section.alt { max-width: 100%; background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section.alt > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.section.alt .projects-grid { max-width: 1120px; margin: 0 auto; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; top: 0; width: 100%;
  background: rgba(243, 244, 248, 0.85);
  backdrop-filter: blur(10px);
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.75rem; z-index: 1000;
  border-bottom: 1px solid var(--line);
}
.navbar .logo { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.navbar .nav-links { display: flex; list-style: none; gap: 1.75rem; align-items: center; }
.navbar a { color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; position: relative; padding-bottom: 2px; }
.navbar a:hover, .navbar a.active { color: var(--ink); }
.navbar a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--accent);
}
.navbar a.nav-cta {
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink);
  border: 1px solid var(--ink); padding: 0.4rem 0.9rem; border-radius: 4px;
}
.navbar a.nav-cta:hover { background: var(--ink); color: var(--bg); }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding-top: 9.5rem; }
.hero-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 3rem; align-items: center; }
.hero-sub { max-width: 46ch; color: var(--ink-soft); margin-bottom: 1.75rem; font-size: 1.05rem; }
.hero-actions { display: flex; gap: 0.9rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.hero-tags { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.pill {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft);
  border: 1px solid var(--line); padding: 0.3rem 0.7rem; border-radius: 20px;
  text-decoration: none; transition: 0.2s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

.framed { position: relative; }
.framed::before {
  content: ""; position: absolute; top: -8px; left: -8px; width: 22px; height: 22px;
  border-top: 2px solid var(--accent); border-left: 2px solid var(--accent);
}
.framed::after {
  content: ""; position: absolute; bottom: -8px; right: -8px; width: 22px; height: 22px;
  border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent);
}
.hero-frame .framed img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  padding: 0.75rem 1.4rem; border-radius: 6px; text-decoration: none; transition: 0.2s;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); }
.btn-primary.btn-light { background: var(--ink); }
.btn-ghost { border: 1px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Toolbelt ---------- */
.toolbelt-intro { max-width: 52ch; margin: -1.25rem auto 2.5rem; text-align: center; color: var(--ink-soft); font-size: 0.98rem; }
.toolbelt { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 2rem; }
.tool-col { border-top: 2px solid var(--ink); padding-top: 1rem; }
.tool-index { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-warm); }
.tool-desc { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Projects ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 1.75rem; padding: 0 1.75rem; }
.projects-grid > *:last-child:nth-child(odd) { grid-column: 1 / -1; max-width: calc(50% - 0.875rem); margin: 0 auto; }
.project-card {
  display: block; text-decoration: none; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden; padding: 1.25rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(11,14,20,0.10); }
.project-card--concept { cursor: default; }

.project-pillar {
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); display: block; margin-bottom: 0.75rem;
}

.project-image { position: relative; overflow: hidden; height: 190px; background: #E8EBF3; margin-bottom: 1rem; }
.project-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.project-card:hover .project-image img { transform: scale(1.04); }
.project-overlay {
  position: absolute; inset: 0; background: rgba(11,14,20,0.78);
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease;
}
.project-card:hover .project-overlay { opacity: 1; }
.project-visit { color: #fff; font-family: var(--font-mono); font-size: 0.85rem; }

.concept-label {
  display: inline-block; background: #EAEFFF; color: var(--accent);
  font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 20px; margin-bottom: 0.5rem;
}

.project-info h3 { margin-bottom: 0.4rem; }
.project-info p { font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 0.9rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font-family: var(--font-mono); background: var(--bg-alt); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 0.72rem; padding: 0.22rem 0.55rem; border-radius: 20px;
}
.section.alt .tag { background: var(--bg); }

/* ---------- Experience ---------- */
.exp-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; align-items: start; }
.timeline { list-style: none; }
.timeline li {
  border-left: 2px solid var(--line); padding: 0 0 1.1rem 1.1rem; position: relative; font-size: 0.98rem;
}
.timeline li strong { display: block; color: var(--ink); }
.t-date { display: block; font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); margin-bottom: 0.15rem; }

.edu-card { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 4px; padding: 1.5rem; }
.edu-card ul { list-style: none; }
.edu-card li { margin-bottom: 1.1rem; }
.edu-card li:last-child { margin-bottom: 0; }
.edu-card li strong { display: block; font-size: 0.98rem; }
.edu-card li span { display: block; font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */
footer#contact { background: var(--ink); color: var(--bg); padding: 4.5rem 1.75rem; }
.footer-inner { max-width: 1120px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2rem; }
.footer-cta .eyebrow { color: var(--accent-warm); }
.footer-cta h2 { text-align: left; color: var(--bg); margin-bottom: 0; }
.footer-links { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-phone { font-family: var(--font-mono); font-size: 0.9rem; color: rgba(243,244,248,0.75); }
.btn-primary.btn-light { color: #fff; border: 1px solid rgba(243,244,248,0.3); }
.btn-primary.btn-light:hover { background: var(--accent); border-color: var(--accent); }

.btn-linkedin {
  display: inline-flex; align-items: center; gap: 0.5rem; background: var(--accent);
  color: #fff; padding: 0.65rem 1.2rem; border-radius: 6px; font-size: 0.9rem; font-weight: 600;
  text-decoration: none; transition: background 0.3s ease;
}
.btn-linkedin:hover { background: var(--accent-warm); }
.btn-linkedin .icon { width: 15px; height: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-frame { max-width: 220px; }
  .exp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 60px; right: 0; height: calc(100vh - 60px); width: 240px;
    background: var(--bg-alt); flex-direction: column; align-items: flex-start; padding: 2rem 1.5rem;
    transform: translateX(100%); transition: transform 0.3s ease; border-left: 1px solid var(--line);
  }
  .nav-links.open { transform: translateX(0); }
}

/* Visible keyboard focus */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- Case Study ---------- */
.cs-hero { padding-top: 9.5rem; max-width: 820px; }
.cs-back {
  display: inline-block; font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--ink-soft); text-decoration: none; margin-bottom: 1.5rem; transition: color 0.2s;
}
.cs-back:hover { color: var(--accent); }

.cs-meta { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.cs-meta div { display: flex; flex-direction: column; gap: 0.2rem; }
.cs-meta-label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; color: var(--accent); }
.cs-meta span:last-child { font-size: 0.95rem; }

.cs-h2 { text-align: left; }
.cs-h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.cs-text { max-width: 68ch; color: var(--ink-soft); font-size: 1.02rem; }
.cs-center { margin: 0 auto 2rem; text-align: center; }
.cs-block { max-width: 900px; margin: 0 auto 3.5rem; }
.cs-block:last-child { margin-bottom: 0; }

.cs-grid-2, .cs-grid-3 { display: grid; gap: 1.5rem; padding: 0 1.75rem; max-width: 1120px; margin: 0 auto; }
.cs-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.cs-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.cs-block .cs-grid-2 { padding: 0; }

.cs-figure { margin: 0; }
.cs-figure img, .cs-video { width: 100%; display: block; border: 1px solid var(--line); border-radius: 4px; background: var(--bg-alt); }
.cs-video-figure { max-width: 640px; margin: 0 auto; padding: 0 1.75rem; }
.cs-figure figcaption {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft);
  margin-top: 0.6rem; text-align: center;
}
.cs-embed { display: flex; flex-direction: column; align-items: center; }
.cs-embed .instagram-media { width: 100% !important; }
.cs-footer-link { color: inherit; text-decoration: none; }
.cs-footer-link:hover { color: var(--accent-warm); }

.cs-video-slot {
  max-width: 640px; margin: 0 auto; padding: 0 1.75rem;
}
.cs-video-slot .slot-inner {
  border: 1.5px dashed var(--line); border-radius: 6px; background: var(--bg-alt);
  aspect-ratio: 16/9; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.75rem; text-align: center; padding: 1.5rem;
}
.slot-play {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink-soft);
  display: flex; align-items: center; justify-content: center; color: var(--ink-soft);
}
.cs-video-slot .slot-note { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); max-width: 30ch; }
.cs-video-slot .slot-path { color: var(--accent); }

.cs-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.cs-table th, .cs-table td { text-align: left; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); }
.cs-table th { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; color: var(--accent); font-weight: 500; }
.cs-table td.cs-week { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); white-space: nowrap; }
.cs-table-wrap { max-width: 900px; margin: 0 auto; overflow-x: auto; padding: 0 1.75rem; }

.cs-quote { max-width: 640px; margin: 1.5rem auto; padding: 1.1rem 1.4rem; background: var(--bg-alt); border-left: 3px solid var(--accent); border-radius: 4px; font-size: 0.95rem; }
.cs-quote strong { display: block; font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent-warm); margin-bottom: 0.4rem; text-transform: uppercase; }

.cs-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 1.25rem; max-width: 900px; margin: 0 auto; padding: 0 1.75rem; }
.cs-kpi { border-top: 2px solid var(--ink); padding-top: 0.75rem; }
.cs-kpi-value { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); }
.cs-kpi-label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); }

.cs-swatch-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; max-width: 900px; margin: 1rem auto 0; padding: 0 1.75rem; }
.cs-swatch { width: 56px; height: 56px; border-radius: 6px; border: 1px solid var(--line); flex-shrink: 0; }
.cs-swatch-label { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); }