/* ---------- Tokens ---------- */
:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #5d6470;
  --line: #e7e2da;
  --accent: #d6455d;          /* rose — echoes the pink portrait */
  --accent-ink: #ffffff;
  --accent-soft: #fbe9ec;
  --code-bg: #16181d;
  --code-ink: #e9edf2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22,24,29,.04), 0 8px 24px rgba(22,24,29,.06);
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f13; --surface: #15181e; --ink: #eef0f3; --muted: #9aa1ad; --line: #242933;
    --accent: #ff8a4c; --accent-ink: #15181e; --accent-soft: #2a1d16;
    --code-bg: #0a0c0f; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f13; --surface: #15181e; --ink: #eef0f3; --muted: #9aa1ad; --line: #242933;
  --accent: #ff8a4c; --accent-ink: #15181e; --accent-soft: #2a1d16;
  --code-bg: #0a0c0f; --shadow: none; color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--body); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--accent); letter-spacing: .02em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1px solid transparent; transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.header-row { height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: 24px; margin-left: auto; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 64px; align-items: center;
  padding-block: 72px 88px;
}
.hero h1 { font-size: clamp(44px, 7vw, 76px); margin: 12px 0 20px; }
.lead { font-size: 19px; color: var(--muted); max-width: 32em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.stats { display: flex; gap: 40px; margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: 28px; }
.portrait { margin: 0; justify-self: end; width: 100%; max-width: 420px; }
.portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 24px; }
.p-dark { display: none !important; }
:root[data-theme="dark"] .p-light { display: none !important; }
:root[data-theme="dark"] .p-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .p-light { display: none !important; }
  :root:not([data-theme="light"]) .p-dark { display: block !important; }
}

/* ---------- Section heads ---------- */
.section-head { margin-bottom: 32px; }
.section-head h2 { font-size: clamp(32px, 4.5vw, 44px); }
.section-head p { color: var(--muted); margin-top: 8px; max-width: 36em; }

/* ---------- Vibe coded projects ---------- */
.projects { padding-block: 72px 88px; border-top: 1px solid var(--line); }
.projects[hidden] { display: none; }
.projects .section-head h2 { margin-top: 6px; }
.project-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project {
  display: flex; flex-direction: column; text-decoration: none; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  transition: border-color .15s, transform .15s;
}
.project:hover { border-color: var(--ink); transform: translateY(-2px); }
.project-shot { background: var(--bg); border-bottom: 1px solid var(--line); overflow: hidden; }
.project-shot img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: top left; transition: transform .4s; }
.project:hover .project-shot img { transform: scale(1.02); }
.project-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-meta { display: flex; gap: 12px; font-size: 13px; color: var(--muted); }
.project-meta .reel { font-family: var(--mono); color: var(--accent); }
.project h3 { font-size: 24px; }
.project p { color: var(--muted); }
.tags { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.project-cta { align-self: flex-start; margin-top: auto; }
.project.is-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.6fr 1fr; }
.project.is-featured .project-shot { border-bottom: 0; border-right: 1px solid var(--line); }
.project.is-featured .project-shot img { height: 100%; aspect-ratio: auto; min-height: 320px; }
.project.is-featured .project-body { padding: 36px; justify-content: center; gap: 14px; }
.project.is-featured h3 { font-size: clamp(28px, 3.4vw, 38px); }
.project.is-featured .project-cta { margin-top: 12px; }

/* ---------- Vault ---------- */
.vault { padding-block: 72px 96px; border-top: 1px solid var(--line); }
.controls { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.search {
  flex: 1 1 360px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 16px; height: 50px; box-shadow: var(--shadow);
}
.search:focus-within { border-color: var(--ink); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search kbd { font: 12px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 20px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 6px 14px; font-size: 13px; color: var(--muted); white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.count { font-size: 14px; color: var(--muted); margin: 16px 0; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 8px; text-align: left;
  padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--ink); transform: translateY(-2px); }
.card-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.card-top .reel { font-family: var(--mono); color: var(--accent); }
.card h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.card p { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 8px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.card-foot .go { color: var(--ink); font-weight: 500; }
.card.is-prompt { font: inherit; color: inherit; }
.card.is-prompt .card-top span:first-child { color: var(--accent); font-weight: 500; }
.empty { text-align: center; padding: 48px 0; color: var(--muted); display: grid; gap: 16px; justify-items: center; }
.empty[hidden] { display: none; }
.more { display: flex; justify-content: center; margin-top: 32px; }
.more[hidden] { display: none; }

/* ---------- Work ---------- */
.work { background: var(--surface); border-block: 1px solid var(--line); padding-block: 80px; }
.work-grid { display: grid; grid-template-columns: 1fr 1.2fr 0.9fr; gap: 48px; }
.work-col h3 { font-size: 14px; font-family: var(--body); font-weight: 600; letter-spacing: 0; color: var(--muted); margin-bottom: 12px; }
.brands { font-size: 17px; line-height: 1.8; }
.highlights { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.highlights li { padding-left: 18px; position: relative; }
.highlights li::before { content: ""; position: absolute; left: 0; top: .65em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.contact { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

/* ---------- Footer ---------- */
.footer { padding-block: 32px; font-size: 14px; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 20px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Dialog ---------- */
.dialog {
  width: min(680px, 100% - 32px); max-height: 88vh; padding: 0; border: 1px solid var(--line);
  border-radius: 20px; background: var(--surface); color: var(--ink);
}
.dialog::backdrop { background: rgba(10, 12, 15, .55); backdrop-filter: blur(3px); }
.dialog-inner { display: flex; flex-direction: column; max-height: 88vh; }
.dialog-head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.dialog-head h3 { font-size: 22px; margin-top: 4px; }
.dialog-body { padding: 20px 24px; overflow-y: auto; display: grid; gap: 16px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
.vars { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.vars[hidden] { display: none; }
.vars label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.vars input, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; width: 100%;
}
.label { font-size: 13px; color: var(--muted); margin-bottom: -8px; }
textarea { font: 13px/1.6 var(--mono); background: var(--code-bg); color: var(--code-ink); border-color: transparent; resize: vertical; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: opacity .2s, transform .2s; z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-block: 40px 64px; }
  .portrait { justify-self: start; max-width: 340px; order: -1; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: 1fr; gap: 36px; }
  .project-list { grid-template-columns: 1fr; }
  .project.is-featured { display: flex; }
  .project.is-featured .project-shot { border-right: 0; border-bottom: 1px solid var(--line); }
  .project.is-featured .project-shot img { aspect-ratio: 16 / 9; min-height: 0; }
  .project.is-featured .project-body { padding: 24px; }
}
@media (max-width: 600px) {
  .nav { display: none; }
  #themeBtn { margin-left: auto; }
  .portrait { max-width: 128px; }
  .portrait img { aspect-ratio: 1; border-radius: 50%; object-position: center 15%; }
  .hero { gap: 24px; padding-top: 32px; }
  .lead { font-size: 17px; }
  .stats { gap: 24px; }
  .stats dd { font-size: 22px; }
  .grid { grid-template-columns: 1fr; }
  .tabs { width: 100%; overflow-x: auto; }
  .tabs button { flex: 1; padding: 8px 10px; }
  .search kbd { display: none; }
  .vault { padding-block: 56px 72px; }
  .work { padding-block: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Vibe coded: 3-column tool grid ---------- */
.project-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project .project-shot img { aspect-ratio: 16 / 10; object-position: top left; }
.project-body { padding: 20px; gap: 8px; }
.project h3 { font-size: 20px; }
.project p { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.project .tags li { font-size: 11px; padding: 3px 9px; }
.project-cta { margin-top: auto; }
@media (max-width: 960px) { .project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .project-list { grid-template-columns: 1fr; } }

/* ---------- Mobile nav: keep links visible on phones ---------- */
@media (max-width: 600px) {
  html { scroll-padding-top: 108px; }
  .header-row { height: auto; flex-wrap: wrap; row-gap: 4px; padding-block: 10px 6px; }
  .nav { display: flex; order: 3; width: 100%; margin-left: 0; gap: 20px; font-size: 14px;
         overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding-bottom: 4px; }
  .nav::-webkit-scrollbar { display: none; }
  #themeBtn { margin-left: auto; }
}
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- About page ---------- */
.about-sec { padding-block: 64px; border-top: 1px solid var(--line); }
.about-sec .section-head { margin-bottom: 28px; }
.about-sec a:not(.btn) { color: var(--accent); }
.about-split { display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 24px; border-left: 2px solid var(--line); display: grid; gap: 28px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -32px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); }
.timeline h3 { font-size: 20px; margin-bottom: 6px; }
.timeline p { color: var(--muted); }
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.about-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: grid; gap: 8px; align-content: start; }
.about-card h3 { font-size: 20px; }
.about-card p { color: var(--muted); }
.hl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 820px; }
.hl-list li { padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.about-cta { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.about-cta > div:first-child { max-width: 640px; display: grid; gap: 10px; }
@media (max-width: 960px) {
  .about-split { grid-template-columns: 1fr; gap: 8px; }
  .cards3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .cards3 { grid-template-columns: 1fr; }
  .about-sec { padding-block: 48px; }
}
