/* ─────────────────────────────────────────────
   Colours — tweak these to re-theme the whole site
   ───────────────────────────────────────────── */
:root {
  --bg: #f7f1e8;          /* warm paper */
  --bg-soft: #efe6d8;
  --surface: #fbf7f0;
  --ink: #2b2420;         /* espresso */
  --ink-soft: #6b5f56;
  --line: rgba(43, 36, 32, 0.1);
  --accent: #c8754a;      /* terracotta */
  --accent-ink: #fbf6ee;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.05), 0 8px 24px -12px rgba(60, 40, 20, 0.18);
  --shadow-lift: 0 2px 4px rgba(60, 40, 20, 0.06), 0 20px 40px -16px rgba(60, 40, 20, 0.28);

  --leaf: #8fb07a;
  --clay: #d88c63;
  --sky: #8eaacb;
  --honey: #ddb35f;
  --rose: #d69a9a;
  --plum: #8d7493;

  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1815;
    --bg-soft: #24201c;
    --surface: #26211d;
    --ink: #f1e8dc;
    --ink-soft: #b3a698;
    --line: rgba(241, 232, 220, 0.09);
    --accent: #e0946a;
    --accent-ink: #1c1815;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.3), 0 20px 40px -16px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] {
  --bg: #1c1815;
  --bg-soft: #24201c;
  --surface: #26211d;
  --ink: #f1e8dc;
  --ink-soft: #b3a698;
  --line: rgba(241, 232, 220, 0.09);
  --accent: #e0946a;
  --accent-ink: #1c1815;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.3), 0 20px 40px -16px rgba(0, 0, 0, 0.7);
}

/* ───────────── Base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* soft paper texture */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.4 0 0 0 0 0.3 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, .topbar, .footer { width: min(760px, 100% - 32px); margin-inline: auto; }

/* ───────────── Top bar ───────────── */
.topbar {
  position: sticky; top: 12px; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding: 8px 8px 8px 18px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.mark {
  font-family: var(--serif); font-size: 26px; line-height: 1; text-decoration: none; font-weight: 600;
  transition: transform 0.4s var(--ease);
}
.mark span { color: var(--accent); }
.mark:hover { transform: rotate(-8deg) scale(1.08); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  text-decoration: none; font-size: 14.5px; font-weight: 500; color: var(--ink-soft);
  padding: 7px 13px; border-radius: 999px;
  transition: color 0.25s, background-color 0.25s;
}
.nav a:hover, .nav a.active { color: var(--ink); background: var(--bg-soft); }

.theme-toggle {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  border: 0; background: var(--bg-soft); color: var(--ink); cursor: pointer;
  display: grid; place-items: center; position: relative; overflow: hidden;
  transition: transform 0.3s var(--ease), background-color 0.3s;
}
.theme-toggle:hover { transform: scale(1.06); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg {
  width: 18px; height: 18px; position: absolute;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
  transition: transform 0.6s var(--ease), opacity 0.4s;
}
.theme-toggle .moon { fill: currentColor; stroke: none; }
.theme-toggle .moon { transform: translateY(24px) rotate(40deg); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .sun { transform: translateY(-24px) rotate(-90deg); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .moon { transform: none; opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { transform: translateY(-24px) rotate(-90deg); opacity: 0; }
  :root:not([data-theme="light"]) .theme-toggle .moon { transform: none; opacity: 1; }
}

/* ───────────── Hero ───────────── */
.hero { padding: clamp(72px, 14vw, 140px) 0 56px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--ink-soft); margin: 0 0 28px;
  padding: 6px 14px 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--leaf);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--leaf) 60%, transparent);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(38px, 7.2vw, 64px); line-height: 1.08; letter-spacing: -0.02em;
  margin: 0 0 24px; text-wrap: balance;
}
h1 em { font-style: italic; color: var(--accent); }
.lede { font-size: clamp(17px, 2.2vw, 19px); color: var(--ink-soft); max-width: 56ch; margin: 0 0 36px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; text-decoration: none;
  font-weight: 500; font-size: 15.5px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.3s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); }
.btn-ghost:hover { transform: translateY(-2px); background: var(--bg-soft); }

/* ───────────── Now ───────────── */
.now {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; box-shadow: var(--shadow);
}
.now-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.now-list li { display: flex; gap: 14px; align-items: baseline; }
.now-icon { width: 22px; flex: none; text-align: center; }
.muted { color: var(--ink-soft); }

/* ───────────── Sections ───────────── */
.section { padding-top: 104px; scroll-margin-top: 72px; }
.section-head { margin-bottom: 28px; }
.section-label {
  font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin: 0;
}
.section-title {
  font-family: var(--serif); font-size: clamp(28px, 4.4vw, 38px); line-height: 1.15; letter-spacing: -0.015em;
  margin: 6px 0 0;
}

/* Interest cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 700px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card-icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 21px;
  background: color-mix(in srgb, var(--tint) 24%, transparent);
  margin-bottom: 14px;
  transition: transform 0.5s var(--ease);
}
.card:hover .card-icon { transform: rotate(-6deg) scale(1.08); }
.card h3 { font-family: var(--serif); font-weight: 600; font-size: 19px; margin: 0 0 4px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; }

/* Projects */
.projects { display: grid; gap: 14px; }
.project {
  display: grid; grid-template-columns: 140px 1fr; gap: 22px; align-items: center;
  text-decoration: none; padding: 14px; border-radius: calc(var(--radius) + 4px);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.project-art {
  aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; position: relative;
  background: radial-gradient(120% 120% at 20% 10%, var(--a), var(--b));
  display: flex; align-items: flex-end; padding: 12px 14px;
}
.project-art::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 80% 90%, rgba(255,255,255,0.35), transparent 70%);
  transition: transform 0.8s var(--ease);
}
.project:hover .project-art::after { transform: translate(-20%, -25%) scale(1.3); }
.project-art span { font-family: var(--serif); font-size: 30px; color: rgba(255,255,255,0.92); position: relative; z-index: 1; }
.project-body h3 { font-family: var(--serif); font-weight: 600; font-size: 21px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.project-body p { margin: 0 0 12px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; }
.arrow { color: var(--accent); font-size: 17px; transition: transform 0.4s var(--ease); }
.project:hover .arrow { transform: translate(3px, -3px); }
/* Featured project: big image on top */
.project.featured { grid-template-columns: 1fr; gap: 20px; padding: 14px 14px 24px; }
.project.featured .project-body { padding: 0 10px; }
.project-shot {
  border-radius: var(--radius); overflow: hidden; background: #262626;
  box-shadow: inset 0 0 0 1px var(--line);
}
.project-shot img { width: 100%; height: auto; transition: transform 0.9s var(--ease); }
.project.featured:hover .project-shot img { transform: scale(1.025); }
.project.featured h3 { font-size: 26px; }
.project-status {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px !important;
  font-size: 13px !important; font-weight: 500; color: var(--ink-soft);
}
.facts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; font-size: 15px; color: var(--ink-soft); }
.facts li { display: grid; grid-template-columns: 1.6em 1fr; gap: 10px; align-items: baseline; }
.facts strong { font-family: var(--serif); font-weight: 600; color: var(--accent); white-space: nowrap; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-soft); }

/* Contact */
.contact { text-align: center; padding-bottom: 40px; }
.contact-big { margin: 14px 0 8px; }
.email {
  font-family: var(--serif); font-size: clamp(28px, 6vw, 46px); letter-spacing: -0.015em;
  text-decoration: none; word-break: break-word;
  background: linear-gradient(var(--accent), var(--accent)) left 92% / 0% 2px no-repeat;
  transition: background-size 0.6s var(--ease), color 0.3s;
}
.email:hover { background-size: 100% 2px; color: var(--accent); }
.socials { list-style: none; padding: 0; margin: 28px 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.socials a {
  display: inline-block; text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  transition: transform 0.35s var(--ease), background-color 0.3s, color 0.3s;
}
.socials a:hover { transform: translateY(-2px); background: var(--ink); color: var(--bg); }

.footer { text-align: center; color: var(--ink-soft); font-size: 14px; padding: 48px 0 40px; border-top: 1px solid var(--line); margin-top: 40px; }

/* ───────────── Scroll reveal ───────────── */
.js .reveal { opacity: 0; transform: translateY(18px); filter: blur(4px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; filter: none; }

/* ───────────── Small screens ───────────── */
@media (max-width: 600px) {
  .nav a { padding: 7px 9px; font-size: 14px; }
  .topbar { padding-left: 14px; }
  .project { grid-template-columns: 1fr; }
  .project-art { aspect-ratio: 16 / 7; }
  .now { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; filter: none; }
}
