/* =========================================================
   medwin.nz — warm editorial dark
   ========================================================= */

:root {
  --bg: #1a1714;
  --bg-deep: #14110f;
  --bg-soft: #221d18;
  --surface: #221e1a;
  --surface-2: #2a2520;
  --text: #f0ebe3;
  --text-soft: #cfc7b8;
  --muted: #948b7d;
  --line: rgba(240, 235, 227, 0.10);
  --line-strong: rgba(240, 235, 227, 0.22);

  --accent: #7a9e7e;
  --accent-soft: rgba(122, 158, 126, 0.16);
  --accent-line: rgba(122, 158, 126, 0.42);
  --accent-glow: rgba(122, 158, 126, 0.28);

  --serif: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --hand: "Caveat", "Dancing Script", cursive;
  --sans: "Outfit", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 18px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { height: auto; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
  background: rgba(240, 235, 227, 0.10);
  border-radius: 999px;
  border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-line); }

/* =========================================================
   Page load sequence
   ========================================================= */

.page-veil {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 700ms var(--ease-in-out), visibility 700ms;
}

.page-veil.is-gone {
  opacity: 0;
  visibility: hidden;
}

.page-veil-mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.7rem;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  opacity: 0;
  animation: veilMark 1100ms var(--ease-out) 80ms forwards;
}

.page-veil-mark::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent);
  vertical-align: middle;
  transform: translateY(-2px);
  animation: dotPulse 1.4s var(--ease-in-out) infinite;
}

@keyframes veilMark {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.5; transform: translateY(-2px) scale(0.9); }
  50%      { opacity: 1;   transform: translateY(-2px) scale(1.1); }
}

/* =========================================================
   Custom cursor
   ========================================================= */

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9000;
  border-radius: 999px;
  mix-blend-mode: difference;
  will-change: transform;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: #f0ebe3;
  transform: translate(-50%, -50%);
  transition: width 200ms var(--ease-out), height 200ms var(--ease-out), background 200ms;
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(240, 235, 227, 0.55);
  transform: translate(-50%, -50%);
  transition: width 240ms var(--ease-out), height 240ms var(--ease-out),
              border-color 240ms, background 240ms, opacity 200ms;
}

.cursor-dot.is-hover {
  width: 4px;
  height: 4px;
}

.cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  border-color: rgba(122, 158, 126, 0.85);
  background: rgba(122, 158, 126, 0.08);
}

.cursor-ring.is-hidden,
.cursor-dot.is-hidden { opacity: 0; }

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* =========================================================
   Background ambience (grain + topo)
   ========================================================= */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.92  0 0 0 0 0.88  0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.35;
  mix-blend-mode: overlay;
  animation: grainShift 7s steps(8) infinite;
}

@keyframes grainShift {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-1%, 1%); }
  80%  { transform: translate(3%, 2%); }
  100% { transform: translate(0,0); }
}

.ambient-topo {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(122, 158, 126, 0.10) 0%, transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(180, 130, 90, 0.08) 0%, transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(122, 158, 126, 0.05) 0%, transparent 60%);
  filter: blur(40px);
  opacity: 0.9;
}

.ambient-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 50%, rgba(0,0,0,0.45) 100%),
    radial-gradient(120% 100% at 50% 100%, transparent 60%, rgba(0,0,0,0.55) 100%);
}

/* =========================================================
   Layout primitives
   ========================================================= */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  position: relative;
  padding: clamp(5rem, 12vh, 9rem) 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section-num {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}

.section-num::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text);
}

.section-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.section-lede {
  margin-top: 1.4rem;
  max-width: 58ch;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.7;
}

/* =========================================================
   Navigation
   ========================================================= */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.4rem 0;
  transition: padding 280ms var(--ease-out),
              background 280ms var(--ease-out),
              border-color 280ms var(--ease-out),
              backdrop-filter 280ms var(--ease-out);
  border-bottom: 1px solid transparent;
}

.nav.is-stuck {
  padding: 0.85rem 0;
  background: rgba(20, 17, 15, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.nav-mark .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
  transform: translateY(-1px);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  border-radius: 999px;
  transition: color 200ms;
}

.nav-link::before {
  content: attr(data-num);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: color 200ms;
}

.nav-link:hover { color: var(--text); }
.nav-link:hover::before { color: var(--accent); }

.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active::before { color: var(--accent); }

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.15rem;
  height: 1px;
  background: var(--accent);
  transform-origin: left;
  animation: underline-in 360ms var(--ease-out);
}

@keyframes underline-in {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.nav-cta {
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  transition: border-color 220ms, background 220ms, color 220ms;
}

.nav-cta:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: rgba(20, 17, 15, 0.6);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle-bars span {
  width: 18px;
  height: 1.5px;
  background: var(--text);
  display: block;
  transition: transform 220ms, opacity 220ms;
}
.nav.is-open .nav-toggle-bars span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav.is-open .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav.is-open .nav-toggle-bars span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }

  .nav-links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 6rem var(--gutter) 4rem;
    background: var(--bg-deep);
    gap: 0.8rem;
    transform: translateY(-100%);
    transition: transform 420ms var(--ease-in-out);
    z-index: -1;
  }

  .nav.is-open .nav-links {
    transform: translateY(0);
  }

  .nav-link {
    font-family: var(--serif);
    font-size: 1.9rem;
    font-weight: 400;
    padding: 0.4rem 0;
    color: var(--text-soft);
  }

  .nav-link::before {
    margin-right: 0.4rem;
  }

  .nav-link.is-active::after {
    left: 0;
    right: auto;
    width: 26px;
    bottom: 0.05rem;
  }

  .nav-cta { display: none; }
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 7rem 0 5rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: end;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 5rem;
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
}

.hero-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.2rem, 11vw, 8.4rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text);
}

.hero-title .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.06em;
}

.hero-title .char {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  will-change: transform, opacity;
}

.hero-title .accent {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.is-loaded .hero-title .char {
  animation: charRise 900ms var(--ease-out) forwards;
}

@keyframes charRise {
  to { transform: translateY(0); opacity: 1; }
}

.hero-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.1vw, 1.5rem);
  color: var(--text-soft);
  margin: 1.8rem 0 0;
  max-width: 32ch;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 800ms var(--ease-out) 900ms,
              transform 800ms var(--ease-out) 900ms;
}

.is-loaded .hero-tagline {
  opacity: 1;
  transform: translateY(0);
}

.hero-meta {
  margin: 2.2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.6rem;
  list-style: none;
  padding: 0;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 800ms var(--ease-out) 1100ms,
              transform 800ms var(--ease-out) 1100ms;
}

.is-loaded .hero-meta { opacity: 1; transform: translateY(0); }

.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0;
}

.hero-meta li + li::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 999px;
  margin-right: 1rem;
  display: inline-block;
  transform: translateX(-1.6rem);
}

.hero-aside {
  position: relative;
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 800ms var(--ease-out) 1300ms,
              transform 800ms var(--ease-out) 1300ms;
}

.is-loaded .hero-aside { opacity: 1; transform: translateY(0); }

.hero-aside-label {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.hero-contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.hero-contact {
  display: inline-flex;
  align-items: baseline;
  gap: 0.7rem;
  font-family: var(--serif);
  font-size: 1.18rem;
  color: var(--text);
  position: relative;
  width: max-content;
  max-width: 100%;
}

.hero-contact .label {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}

.hero-contact .value {
  position: relative;
  background-image: linear-gradient(to right, var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 380ms var(--ease-out), color 280ms;
  padding-bottom: 2px;
  word-break: break-word;
}

.hero-contact:hover .value {
  background-size: 100% 1px;
  color: var(--accent);
}

.hero-cta {
  margin-top: 2.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.6rem 1rem 1.8rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 320ms var(--ease-out), border-color 320ms;
  opacity: 0;
  transform: translateY(14px);
  animation: heroCtaIn 800ms var(--ease-out) 1500ms forwards;
}

@keyframes heroCtaIn {
  to { opacity: 1; transform: translateY(0); }
}

.hero-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  z-index: -1;
  transform: translateY(101%);
  transition: transform 440ms var(--ease-in-out);
}

.hero-cta:hover {
  color: var(--bg-deep);
  border-color: var(--accent);
}

.hero-cta:hover::before { transform: translateY(0); }

.hero-cta .arrow {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: width 320ms var(--ease-out);
}

.hero-cta .arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
  transform-origin: right center;
}

.hero-cta:hover .arrow { width: 36px; }

.hero-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  animation: cueIn 900ms var(--ease-out) 1800ms forwards;
}

@keyframes cueIn { to { opacity: 1; } }

.hero-scroll-cue::after {
  content: "";
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: cueLine 2.4s var(--ease-in-out) infinite;
  transform-origin: top;
}

@keyframes cueLine {
  0%, 100% { transform: scaleY(0.15); opacity: 0.35; }
  50%      { transform: scaleY(1);    opacity: 1; }
}

@media (max-width: 720px) {
  .hero-scroll-cue { display: none; }
}

/* =========================================================
   Reveal animations (scroll-triggered)
   ========================================================= */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}

.reveal.is-visible { opacity: 1; transform: translateY(0); }

.reveal-children > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
}

.reveal-children.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-children.is-visible > *:nth-child(1) { transition-delay: 60ms; }
.reveal-children.is-visible > *:nth-child(2) { transition-delay: 160ms; }
.reveal-children.is-visible > *:nth-child(3) { transition-delay: 260ms; }
.reveal-children.is-visible > *:nth-child(4) { transition-delay: 360ms; }
.reveal-children.is-visible > *:nth-child(5) { transition-delay: 460ms; }
.reveal-children.is-visible > *:nth-child(6) { transition-delay: 560ms; }

/* =========================================================
   About section
   ========================================================= */

.about {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1.1fr 1fr;
    gap: 4rem;
  }
}

.about-intro p {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.005em;
}

.about-intro p + p {
  margin-top: 1.4rem;
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  font-family: var(--sans);
  font-weight: 400;
  color: var(--text-soft);
  letter-spacing: 0;
  line-height: 1.7;
}

.about-cards {
  display: grid;
  gap: 1.2rem;
}

.about-card {
  position: relative;
  padding: 1.4rem 1.5rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(240, 235, 227, 0.02), transparent);
  transition: border-color 320ms, transform 320ms var(--ease-out);
}

.about-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.about-card-label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
  font-weight: 500;
}

.about-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.005em;
  color: var(--text);
}

.about-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 0.97rem;
}

.about-card p + p { margin-top: 0.55rem; }

/* =========================================================
   Projects
   ========================================================= */

.projects {
  background: var(--bg);
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 760px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: var(--sans);
  overflow: hidden;
  transition: transform 480ms var(--ease-out),
              border-color 320ms,
              box-shadow 480ms var(--ease-out);
  isolation: isolate;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 0% 0%, rgba(122, 158, 126, 0.10), transparent 60%),
    linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.18) 100%);
  opacity: 0;
  transition: opacity 480ms var(--ease-out);
  z-index: 0;
  pointer-events: none;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-line);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6),
              0 0 0 1px var(--accent-line);
}

.project-card:hover::before { opacity: 1; }

.project-card-inner {
  position: relative;
  z-index: 1;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1rem;
}

.project-card-num {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: color 280ms;
}

.project-card-num::before {
  content: "";
  width: 16px;
  height: 1px;
  background: var(--muted);
  display: inline-block;
  transition: background 280ms, width 320ms var(--ease-out);
}

.project-card:hover .project-card-num { color: var(--accent); }
.project-card:hover .project-card-num::before { background: var(--accent); width: 28px; }

.project-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.2vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}

.project-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.65;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.tag {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
  background: rgba(240, 235, 227, 0.03);
  transition: border-color 280ms, color 280ms, background 280ms;
}

.project-card:hover .tag {
  border-color: var(--accent-line);
  color: var(--text);
  background: var(--accent-soft);
}

.project-card-cta {
  position: absolute;
  top: 1.8rem;
  right: 1.8rem;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: border-color 320ms, color 320ms, background 320ms, transform 320ms var(--ease-out);
}

.project-card:hover .project-card-cta {
  border-color: var(--accent);
  color: var(--bg-deep);
  background: var(--accent);
  transform: rotate(-45deg);
}

.project-card-cta::after {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  display: inline-block;
  margin-right: 1px;
}

.project-card .project-details { display: none; }

.projects-footer {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.4rem;
}

.projects-link {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  transition: color 280ms, gap 320ms var(--ease-out);
}

.projects-link::after {
  content: "→";
  font-style: normal;
  color: var(--accent);
  transition: transform 320ms var(--ease-out);
}

.projects-link:hover { color: var(--accent); gap: 1rem; }
.projects-link:hover::after { transform: translateX(4px); }

/* =========================================================
   Cocktail / hospitality — editorial aside
   ========================================================= */

.cocktail {
  background:
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 60%, var(--bg) 100%);
  position: relative;
}

.cocktail::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(94%, 900px);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line-strong), transparent);
}

.cocktail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

@media (min-width: 880px) {
  .cocktail-grid {
    grid-template-columns: 0.85fr 1fr;
    gap: 5rem;
  }
}

.cocktail-intro h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}

.cocktail-intro p {
  margin: 1.4rem 0 0;
  color: var(--text-soft);
  font-size: 1.04rem;
  line-height: 1.7;
  max-width: 38ch;
}

.recipe {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 2rem 2.2rem;
  background:
    linear-gradient(180deg, rgba(122, 158, 126, 0.05), transparent 40%),
    var(--surface);
  position: relative;
}

.recipe-name {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(2.4rem, 4.6vw, 3.2rem);
  color: var(--accent);
  line-height: 1;
  margin: 0;
  transform: rotate(-2deg);
  transform-origin: left center;
  display: inline-block;
}

.recipe-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-soft);
  margin: 1.4rem 0 1.6rem;
  max-width: 36ch;
}

.recipe-divider {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1.8rem 0 0.9rem;
}

.recipe-divider span {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.recipe-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.recipe ul, .recipe ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  counter-reset: step;
}

.recipe li {
  position: relative;
  padding-left: 1.7rem;
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.6;
}

.recipe ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62rem;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.recipe ol li {
  counter-increment: step;
}

.recipe ol li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 1rem;
}

/* =========================================================
   Contact
   ========================================================= */

.contact {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  padding-bottom: clamp(4rem, 8vh, 6rem);
}

.contact-inner {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
}

.contact-lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  color: var(--text-soft);
  margin: 0 0 2rem;
  max-width: 42ch;
}

.contact-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text);
}

.contact-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.contact-channels {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  border-top: 1px solid var(--line);
}

.contact-channel {
  border-bottom: 1px solid var(--line);
}

.contact-channel a {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.4rem 0.5rem;
  position: relative;
  transition: padding 360ms var(--ease-out);
}

.contact-channel a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  opacity: 0;
  transition: opacity 360ms;
  pointer-events: none;
}

.contact-channel a:hover { padding-left: 1.5rem; }
.contact-channel a:hover::before { opacity: 1; }

.contact-channel-label {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.contact-channel-value {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  color: var(--text);
  line-height: 1.1;
  word-break: break-word;
}

.contact-channel a:hover .contact-channel-value {
  color: var(--accent);
}

.contact-channel-arrow {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: border-color 320ms, color 320ms, background 320ms, transform 320ms var(--ease-out);
}

.contact-channel-arrow::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-right: 1px;
}

.contact-channel a:hover .contact-channel-arrow {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-deep);
  transform: translateX(4px) rotate(-45deg);
}

@media (max-width: 600px) {
  .contact-channel a {
    grid-template-columns: 1fr auto;
    gap: 0.4rem 1rem;
    padding: 1.1rem 0.3rem;
  }
  .contact-channel-label {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .contact-channel-value {
    grid-column: 1;
    grid-row: 2;
  }
  .contact-channel-arrow {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  padding: 3rem 0 2.4rem;
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--muted);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-soft);
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
}

.footer-mark .dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 999px;
  display: inline-block;
  transform: translateY(-1px);
}

.footer-note {
  font-size: 0.86rem;
  margin: 0;
  letter-spacing: 0.01em;
}

.footer-note .accent { color: var(--accent); }

/* =========================================================
   Project modal
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.78);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms var(--ease-out);
}

.modal-overlay.is-open { opacity: 1; pointer-events: auto; }

.project-modal {
  width: min(820px, 100%);
  max-height: calc(100vh - 4rem);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition: transform 420ms var(--ease-out), opacity 320ms;
  box-shadow: 0 50px 100px -20px rgba(0,0,0,0.6);
}

.modal-overlay.is-open .project-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.project-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 1.8rem 1rem;
  border-bottom: 1px solid var(--line);
}

.project-modal-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 220ms, background 220ms, color 220ms, transform 320ms var(--ease-out);
  font-family: var(--sans);
}

.modal-close:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  transform: rotate(90deg);
}

.project-modal-body {
  padding: 1.4rem 1.8rem 1.8rem;
  color: var(--text-soft);
  overflow-y: auto;
}

.project-modal-body p {
  margin: 0 0 1rem;
  line-height: 1.65;
}

.project-modal-body h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  color: var(--text);
  margin: 1.4rem 0 0.6rem;
  font-size: 1.1rem;
}

.project-modal-body ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.project-modal-body li {
  position: relative;
  padding-left: 1.4rem;
  line-height: 1.55;
}

.project-modal-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

.project-modal-body a { color: var(--accent); border-bottom: 1px solid var(--accent-line); }

/* =========================================================
   Detail pages (projects.html, cocktails.html, contact.html, cv.html)
   ========================================================= */

.detail-page {
  background: var(--bg);
}

.detail-main {
  padding: 7rem var(--gutter) 4rem;
}

.detail-shell {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
}

.detail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  padding: 0.55rem 1rem 0.55rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(240, 235, 227, 0.02);
  transition: border-color 280ms, color 280ms, background 280ms, transform 280ms var(--ease-out);
}

.back-link::before {
  content: "←";
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: transform 320ms var(--ease-out);
}

.back-link:hover {
  border-color: var(--accent-line);
  color: var(--text);
  background: rgba(122, 158, 126, 0.06);
}

.back-link:hover::before { transform: translateX(-3px); }

.back-link-subtle {
  border: none;
  background: none;
  padding: 0.55rem 0;
  color: var(--muted);
}

.back-link-subtle::before { display: none; }
.back-link-subtle:hover { color: var(--accent); background: none; }

.detail-kicker {
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.detail-kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
}

.detail-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}

.detail-lead {
  margin: 1.4rem 0 0;
  color: var(--text-soft);
  max-width: 60ch;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.7;
}

.detail-section {
  margin-top: 3.5rem;
}

.detail-page .project-grid { margin-top: 0; }

.detail-note {
  margin-top: 2.5rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--text-soft);
  font-style: italic;
  font-family: var(--serif);
  background: rgba(240, 235, 227, 0.02);
  max-width: 60ch;
}

.detail-contact-grid {
  margin-top: 2rem;
  display: grid;
  gap: 0.6rem;
  max-width: 540px;
}

.detail-page .recipe-grid {
  margin-top: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .detail-page .recipe-grid { grid-template-columns: repeat(2, 1fr); }
}

.page-actions {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(240, 235, 227, 0.03);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 280ms, background 280ms, color 280ms, transform 280ms var(--ease-out);
}

.btn:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
}

.btn-accent:hover {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
}

.detail-page .site-footer {
  margin-top: 3rem;
}

/* =========================================================
   CV layout
   ========================================================= */

.cv-paper {
  margin-top: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 3rem);
}

.cv-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.cv-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cv-subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.cv-section {
  margin-top: 2rem;
}

.cv-section h2,
.cv-section h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 0 0 1rem;
  color: var(--text);
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.cv-section h2::before,
.cv-section h3::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.cv-row {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.cv-item-title {
  font-weight: 500;
  color: var(--text);
  font-size: 1rem;
}

.cv-item-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.cv-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-soft);
  display: grid;
  gap: 0.4rem;
}

.cv-list li::marker {
  color: var(--accent);
}

/* =========================================================
   Print
   ========================================================= */

@media print {
  .nav, .site-footer, .ambient, .cursor-dot, .cursor-ring, .page-veil { display: none !important; }
  body { background: white; color: #111; }
  .detail-main, .section { padding: 0; }
  .cv-paper { background: transparent; border: none; padding: 0; }
  .cv-title, .cv-section h2, .cv-section h3 { color: #111; }
  a { color: #111; }
}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-children > *, .hero-tagline, .hero-meta, .hero-aside, .hero-cta {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-title .char { opacity: 1 !important; transform: none !important; }
  .ambient-grain { animation: none !important; }
}
