:root {
  --bg: #fff;
  --fg: #111;
  --muted: #555;
  --ph: #eee;
  --pad: clamp(20px, 4vw, 56px);
  /* spacing scale: s = small, m = medium, l = between sections */
  --s: clamp(16px, 2.5vw, 28px);
  --m: clamp(32px, 5vw, 64px);
  --l: clamp(56px, 9vw, 112px);
  --gap: var(--s);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tile: 3 / 2;
  --wrap: 1600px;
  --edge: max(var(--pad), calc((100% - var(--wrap)) / 2)); /* page margin: grows past --wrap so content stays centred */
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (min-width: 641px) { :root { --gap: 0px; } } /* desktop: tiles touch */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.menu-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
[hidden] { display: none !important; }

/* Header (scrolls with the page, never fixed) */
header {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--pad) + var(--safe-top)) var(--edge) var(--pad);
  background-color: var(--bg);
  transition: background-color .5s ease;
}
.title, .burger { position: relative; z-index: 11; } /* stay above the mobile menu overlay */
.title { font-size: clamp(1.375rem, 1rem + 1.2vw, 2.25rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; }

nav { display: flex; align-items: center; gap: 30px; }
.links { display: flex; gap: 32px; }
.links a { padding: 6px 2px; font-size: 1.125rem; letter-spacing: -0.005em; border-bottom: 1px solid transparent; }
.links a[aria-current="page"] { border-bottom-color: var(--fg); }

.icons { display: flex; align-items: center; }
.icons a { display: block; padding: 8px; }
.icons svg { display: block; width: 18px; height: 18px; }

.burger { display: none; padding: 12px; margin: -12px; background: none; border: 0; color: inherit; cursor: pointer; }
.burger span { display: block; width: 24px; height: 1.2px; background: currentColor; transition: transform .25s ease; }
.burger span + span { margin-top: 6px; }
header.open .burger span:first-child { transform: translateY(3.75px) rotate(45deg); }
header.open .burger span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

/* Content */
main { flex: 1; padding: 0 var(--edge) var(--l); }

.grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
@media (min-width: 641px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.ph { aspect-ratio: var(--tile); background: var(--ph); }

.tabs { display: flex; flex-direction: column; align-items: center; gap: var(--s); padding: var(--l) 0; }
.tabs a { padding: 4px 2px; font-weight: 500; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); letter-spacing: -0.01em; }

.video { aspect-ratio: 16 / 9; margin: 0 auto var(--l); background: #000; }
@media (min-width: 641px) { .video { width: 50%; } } /* one tile wide */
.video iframe { display: block; width: 100%; height: 100%; border: 0; }

.page-head { max-width: 56ch; margin: 0 auto; padding: var(--m) 0 var(--l); text-align: center; }
.page-head h1 { margin: 0 0 16px; font-size: clamp(1.75rem, 1.1rem + 2vw, 2.75rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.page-head p { margin: 0; color: var(--muted); line-height: 1.65; }

/* Mobile */
@media (max-width: 640px) {
  .burger { display: block; }

  /* frosted overlay: fades in while the blur ramps up */
   nav {
    position: fixed;
    inset: 0;
    z-index: 10;
    flex-direction: column;
    justify-content: space-between;
    gap: 0;
    padding: calc(88px + var(--safe-top)) var(--pad) calc(var(--pad) + var(--safe-bottom));
    background: rgb(255 255 255 / .55);
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
    opacity: 0;
    visibility: hidden;
    transition: opacity .55s ease, -webkit-backdrop-filter .7s ease, backdrop-filter .7s ease, visibility 0s .7s;
  }
  header.open { background-color: transparent; } /* lets the blur see the page */
  header.open nav {
    opacity: 1;
    visibility: visible;
    -webkit-backdrop-filter: blur(32px) saturate(1.3);
    backdrop-filter: blur(32px) saturate(1.3);
    transition-delay: 0s;
  }

  .links { flex: 1; flex-direction: column; justify-content: center; align-items: center; gap: 32px; }
  .links a { font-size: 1.875rem; }
  .icons { gap: 24px; }
  .icons svg { width: 28px; height: 28px; }

  /* items rise out of the blur, one after another */
  .links a, .icons {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(10px);
    transition: opacity .4s ease, transform .6s cubic-bezier(.2, .7, .2, 1), filter .5s ease;
  }
  header.open .links a, header.open .icons { opacity: 1; transform: none; filter: none; transition-delay: .12s; }
  header.open .links a:nth-child(2) { transition-delay: .2s; }
  header.open .icons { transition-delay: .28s; }
}

@media (prefers-reduced-motion: reduce) {
  header, nav, .burger span, .links a, .icons { transition: none !important; }
}

img { display: block; width: 100%; height: auto; }
.ph { aspect-ratio: var(--tile); object-fit: cover; }

/* Contact */
.contact-grid { display: grid; gap: var(--m); }
.contact-text h1 { margin: 0 0 16px; font-size: clamp(1.75rem, 1.1rem + 2vw, 2.75rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.contact-text p { margin: 0; max-width: 40ch; color: var(--muted); line-height: 1.65; }
@media (min-width: 641px) {
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 0; align-items: center; }
  .contact-text { padding-left: var(--m); }
}

#start { display: flex; align-items: center; max-width: 420px; margin-top: var(--m); border-bottom: 1px solid var(--fg); }
#start:focus-within { box-shadow: 0 1px 0 var(--fg); }
#start input { flex: 1; min-width: 0; padding: 14px 0; border: 0; background: none; font: inherit; color: inherit; outline: 0; }
::placeholder { color: var(--muted); opacity: 1; }
#start button, #compose button { border: 0; background: none; font: inherit; font-weight: 500; color: inherit; cursor: pointer; transition: opacity .2s ease; }
#start button { padding: 14px 0 14px 16px; }
button:disabled { opacity: .3; cursor: default; }
#note { min-height: 1.5em; margin-top: var(--s); font-size: .9375rem; }
#turnstile { margin-top: var(--s); }

#compose { width: min(92vw, 560px); padding: var(--m); border: 1px solid var(--fg); background: var(--bg); color: var(--fg); }
#compose::backdrop { background: rgb(255 255 255 / .6); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
#compose h2 { margin: 0 0 4px; font-size: 1.375rem; font-weight: 500; letter-spacing: -0.02em; }
#compose #from { margin: 0 0 var(--s); color: var(--muted); }
#compose textarea { display: block; width: 100%; min-height: 10rem; padding: 14px; border: 1px solid var(--fg); border-radius: 0; background: none; font: inherit; color: inherit; resize: vertical; outline: 0; }
#compose textarea:focus { box-shadow: 0 0 0 1px var(--fg); }
#compose .actions { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s); }
#compose button { padding: 12px 0; }
#compose .quiet { color: var(--muted); }
#compose #error { margin: var(--s) 0 0; }
#compose #error:empty { display: none; }