/* Layout: sticky nav, gradient hero band, alternating full-width sections, card grids inside a centered container. */
:root {
  --coral: #ff6b6b;
  --purple: #7c5cff;
  --blue: #3b82f6;
  --teal: #14b8a6;
  --orange: #ff9f43;
  --yellow: #f5b700;

  --bg: #fbf9ff;
  --surface: #ffffff;
  --alt: #f3effd;
  --ink: #23213a;
  --muted: #5c5f77;
  --line: #e4def5;
  --tag-bg: #efeafc;
  --slot-bg: #faf7ff;
  --on-color: #ffffff;
  --shadow: 0 10px 30px -12px rgba(60, 40, 120, 0.25);

  --font-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 18px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14121d; --surface: #1e1b2c; --alt: #191726; --ink: #ece9f7; --muted: #aaa6c2;
    --line: #322d47; --tag-bg: #2a2540; --slot-bg: #1b1928;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14121d; --surface: #1e1b2c; --alt: #191726; --ink: #ece9f7; --muted: #aaa6c2;
  --line: #322d47; --tag-bg: #2a2540; --slot-bg: #1b1928;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--surface);
}
img, video { max-width: 100%; display: block; }
a { color: var(--purple); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--purple); outline-offset: 3px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}

/* ---------- Nav ---------- */
.navbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto;
  padding-block: 14px;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: relative;
}
.logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem;
  color: var(--ink); text-decoration: none; line-height: 1;
}
.logo .dot { color: var(--coral); }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover { background: var(--tag-bg); }
.nav-links a.active { background: var(--ink); color: var(--bg); }
.nav-toggle {
  display: none; background: none; border: 0; padding: 8px; cursor: pointer;
  flex-direction: column; gap: 5px;
}
.nav-toggle span { display: block; width: 24px; height: 3px; border-radius: 3px; background: var(--ink); transition: transform 0.2s, opacity 0.2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding-block: 10px; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--coral), var(--orange) 55%, var(--yellow));
  color: var(--on-color);
  text-align: center;
  padding: 72px 0 88px;
  position: relative;
  overflow: hidden;
}
.hero::after { /* soft scalloped edge into the page */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 36px;
  background: radial-gradient(circle at 18px 36px, var(--bg) 18px, transparent 19px) repeat-x;
  background-size: 36px 36px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.3rem, 6vw, 3.8rem); line-height: 1.05;
  margin: 0 0 14px; text-wrap: balance;
  text-shadow: 0 2px 14px rgba(40, 20, 60, 0.25);
}
.tagline {
  max-width: 620px; margin: 0 auto; font-size: 1.08rem;
  text-shadow: 0 1px 8px rgba(40, 20, 60, 0.25);
}
.hero-avatar {
  width: 168px; height: 168px; margin: 0 auto 22px;
  border-radius: 50%; padding: 6px; background: var(--on-color);
  box-shadow: 0 14px 30px -10px rgba(40, 20, 60, 0.45);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }

.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--on-color); color: var(--ink);
  font-family: var(--font-body); font-weight: 600; font-size: 0.98rem;
  padding: 12px 24px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 6px 16px -6px rgba(40, 20, 60, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -8px rgba(40, 20, 60, 0.45); }
.btn.secondary { background: transparent; color: var(--on-color); box-shadow: inset 0 0 0 2px var(--on-color); }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
section.alt-bg { background: var(--alt); }
.section-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.15;
  text-align: center; margin: 0 0 10px; text-wrap: balance;
}
.section-subtitle {
  max-width: 680px; margin: 0 auto 36px; text-align: center; color: var(--muted);
}
.section-title + .grid, .section-title + .tag-list { margin-top: 28px; }

.grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid > * { min-width: 0; }

/* ---------- Cards ---------- */
.card {
  --c: var(--purple);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  min-width: 0;
  transition: transform 0.2s;
}
.card:hover { transform: translateY(-3px); }
.card.coral { --c: var(--coral); }
.card.purple { --c: var(--purple); }
.card.teal { --c: var(--teal); }
.card.orange { --c: var(--orange); }
.card.blue { --c: var(--blue); }
.card.yellow { --c: var(--yellow); }
.card .icon {
  display: inline-grid; place-items: center;
  width: 52px; height: 52px; border-radius: 14px; font-size: 1.6rem;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  margin-bottom: 14px;
}
.card h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.35rem; line-height: 1.25; margin: 0 0 8px; text-wrap: balance;
}
.card p { margin: 0 0 12px; }
.card > a:not(:has(img)) {
  color: var(--c); font-weight: 600; text-decoration: none;
  filter: brightness(0.85);
}
.card > a:hover { text-decoration: underline; }
.card img { border-radius: 12px; }
.card video { border-radius: 12px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
  background: var(--tag-bg); color: var(--ink);
  font-size: 0.82rem; font-weight: 500;
  padding: 5px 12px; border-radius: 999px;
}

.photo-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.photo-row img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; box-shadow: var(--shadow); }

.placeholder-note { font-size: 0.85rem; color: var(--muted); font-style: italic; margin-top: 10px; }

.stat {
  font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1.1;
  color: var(--c); font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Media slots (where a photo or video still needs to be added) ---------- */
.media-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-align: center;
  margin-top: 14px; padding: 22px 16px; min-height: 160px;
  border: 2px dashed color-mix(in srgb, var(--c, var(--purple)) 60%, var(--line));
  border-radius: 12px; background: var(--slot-bg); color: var(--muted);
}
.media-slot strong { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.media-slot span { font-size: 0.82rem; }
.media-slot::before { content: attr(data-kind); font-size: 1.6rem; line-height: 1; }
.slot-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot-row .media-slot { min-height: 110px; padding: 14px 8px; }
@media (max-width: 420px) { .slot-row { grid-template-columns: 1fr; } }

/* ---------- Contact form ---------- */
.contact-form {
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow);
}
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group label { font-weight: 600; font-size: 0.92rem; }
.form-group input, .form-group textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--purple); outline: none; }
.form-group textarea { resize: vertical; }
#form-status { color: var(--muted) !important; }

/* ---------- Footer ---------- */
footer { padding: 36px 0; text-align: center; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); background: var(--surface); }
footer p { margin: 0; }

/* ---------- Entrance motion (starts visible; just a gentle lift) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .tagline, .hero-avatar, .hero-actions { animation: rise 0.6s ease-out both; }
  .hero .tagline { animation-delay: 0.08s; }
  .hero-actions { animation-delay: 0.16s; }
  @keyframes rise { from { transform: translateY(10px); } to { transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 560px) {
  section { padding: 52px 0; }
  .hero { padding: 52px 0 72px; }
  .card { padding: 20px; }
  .contact-form { padding: 22px; }
  .hero-avatar { width: 136px; height: 136px; }
}

/* ---------- Photo gallery and video clips ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.photo-grid a { display: block; border-radius: 12px; overflow: hidden; }
.photo-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 0; transition: transform 0.25s; }
.photo-grid a:hover img { transform: scale(1.05); }
.card video.clip { width: auto; max-width: 100%; max-height: 480px; margin: 16px auto 0; background: #000; box-shadow: var(--shadow); }

/* Wide cards span two columns on large screens so the hobby grid fills evenly */
@media (min-width: 900px) { .card.wide { grid-column: span 2; } }
.photo-grid.art { grid-template-columns: repeat(2, 1fr); }
.photo-grid.art img { aspect-ratio: 4 / 3; }
.card img.work-photo { width: 100%; max-width: 260px; margin-top: 16px; box-shadow: var(--shadow); }

/* ---------- Full-size photo viewer ---------- */
a.zoom { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 56px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 24px) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(12, 10, 20, 0.88);
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); cursor: default;
}
.lightbox-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: max(12px, env(safe-area-inset-right, 0px));
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: #ffffff; color: #23213a; font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.lightbox[hidden] { display: none; }

/* ---------- Garden photo + video pair ---------- */
.media-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; max-width: 760px; }
.media-pair > * { min-width: 0; margin: 0; }
.media-pair img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; box-shadow: var(--shadow); }
.media-pair video { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #000; border-radius: 12px; box-shadow: var(--shadow); }
.media-pair figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }

/* ---------- Work photo ---------- */
.card a.work-photo { display: block; max-width: 340px; margin-top: 16px; }
.card a.work-photo img { width: 100%; box-shadow: var(--shadow); }

/* ---------- Abstract link and pop-up ---------- */
.abstract-link {
  display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 6px;
  background: color-mix(in srgb, var(--coral) 14%, transparent); color: var(--ink);
  border: 1.5px solid color-mix(in srgb, var(--coral) 55%, transparent);
  border-radius: 999px; padding: 7px 16px; font: 600 0.9rem var(--font-body); cursor: pointer;
}
.abstract-link::after { content: "→"; }
.abstract-link:hover { background: color-mix(in srgb, var(--coral) 24%, transparent); }
.modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 24px) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(12, 10, 20, 0.7);
}
.modal[hidden] { display: none; }
.modal-panel {
  position: relative; width: 100%; max-width: 680px; max-height: 100%; overflow-y: auto;
  background: var(--surface); color: var(--ink); border-radius: var(--radius);
  padding: 30px 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.modal-panel h3 { font-family: var(--font-display); font-size: 1.4rem; line-height: 1.25; margin: 0 40px 14px 0; text-wrap: balance; }
.modal-eyebrow { margin: 0 0 4px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.abstract-text { margin: 0; max-width: 65ch; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: var(--tag-bg); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer;
}

/* Paper figure: white plate so the graph reads in dark mode too */
.card a.figure-link { display: block; margin-top: 6px; }
.card a.figure-link img { width: 100%; background: #ffffff; padding: 10px; border-radius: 12px; box-shadow: var(--shadow); }
.lightbox img[src$=".png"] { background: #ffffff; }
.abstract-meta { margin: -6px 0 14px; color: var(--muted); font-size: 0.9rem; }

/* Adaptive device photos */
.card a.device-photo { display: block; margin-top: 16px; }
.card a.device-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; box-shadow: var(--shadow); }
