:root {
  --ink: #1F1B16;
  --ink-2: #2A251F;
  --paper: #F3EDE3;
  --paper-deep: #E9E0D2;
  --ember: #C8553D;
  --ember-soft: #E07A5F;
  --stone: #8A8175;
  --line-dark: rgba(243, 237, 227, 0.16);
  --line-light: rgba(31, 27, 22, 0.14);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
/* Class styles like .btn must never override the hidden attribute */
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 350; letter-spacing: -0.01em; margin: 0; }
h1 em, h2 em { font-style: italic; color: var(--ember-soft); }
p { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: 760px; }
.wrap.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }

section { padding: clamp(80px, 12vw, 160px) 0; }
.paper { background: var(--paper); }
.paper-deep { background: var(--paper-deep); }
.ink { background: var(--ink); color: var(--paper); }

.eyebrow {
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 24px;
}
.ink .eyebrow { color: var(--ember-soft); }
h2 { font-size: clamp(34px, 5vw, 56px); line-height: 1.08; margin-bottom: 24px; }
.intro { font-size: 19px; max-width: 620px; color: inherit; opacity: 0.82; margin-bottom: 56px; }
.big { font-family: var(--serif); font-size: clamp(24px, 3vw, 32px); line-height: 1.35; font-weight: 350; }
.small { font-size: 14px; color: var(--stone); }
.signature { font-family: var(--serif); font-size: 24px; margin: 32px 0 0; }
.signature + .sign { margin-top: 4px; }
.sign { font-family: var(--serif); font-style: italic; font-size: 28px; color: var(--ember); margin-top: 32px; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--ember);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 16px 34px;
  font: 600 15px/1 var(--sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.btn:hover { background: #B4472F; transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.link {
  background: none; border: 0; padding: 8px 0; cursor: pointer;
  font: 500 15px/1 var(--sans); color: inherit; text-decoration: underline; text-underline-offset: 5px;
  text-decoration-color: var(--ember-soft);
}

/* Header */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px var(--gutter);
  color: var(--paper);
  transition: background .3s, padding .3s;
}
.top.scrolled { background: rgba(31, 27, 22, .92); backdrop-filter: blur(8px); padding-top: 14px; padding-bottom: 14px; }
.wordmark { font-family: var(--serif); font-size: 19px; letter-spacing: 0.01em; text-decoration: none; }
.wordmark { display: block; line-height: 0; }
/* Full stacked logo in the header; designer minimum is 180px wide */
.logo-head { display: block; width: 150px; height: auto; margin-left: -4px; transition: width .3s; }
.top.scrolled .logo-head { width: 128px; }
.logo-stacked { display: block; width: 240px; height: auto; margin: 0 auto 18px; }
.top-apply { font: 600 13px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }

/* Hero */
.hero {
  position: relative; min-height: 100svh; padding: 0;
  display: flex; align-items: flex-end;
  background: var(--ink); color: var(--paper); overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: var(--photo) center / cover no-repeat;
  opacity: .55;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(31,27,22,.2) 0%, rgba(31,27,22,.0) 35%, rgba(31,27,22,.85) 100%);
}
.hero-sky { position: absolute; inset: 0; z-index: 1; }
.sun {
  position: absolute; left: 62%; top: 38%;
  width: min(46vw, 520px); aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 50%, #F0A07F 0%, var(--ember) 45%, rgba(200,85,61,0) 70%);
  filter: blur(2px);
  opacity: .85;
  animation: breathe 9s ease-in-out infinite;
}
.horizon {
  position: absolute; left: 0; right: 0; top: 52%;
  height: 1px; background: rgba(243,237,227,.25);
}
@keyframes breathe {
  0%, 100% { transform: translate(-50%, -48%) scale(1); opacity: .78; }
  50% { transform: translate(-50%, -52%) scale(1.06); opacity: .95; }
}
/* With a real photo: show it fully and let its own sun replace the drawn one */
/* Mirrored so the person stands on the right, clear of the headline */
.hero.has-photo::before { opacity: 1; background-position: 50% 45%; transform: scaleX(-1); }
.hero.has-photo::after {
  background:
    linear-gradient(180deg, rgba(31,27,22,.35) 0%, rgba(31,27,22,0) 22%, rgba(31,27,22,0) 45%, rgba(31,27,22,.88) 100%),
    linear-gradient(90deg, rgba(31,27,22,.45) 0%, rgba(31,27,22,0) 60%);
}
.hero.has-photo .hero-sky { display: none; }
.hero.has-photo .eyebrow { color: var(--paper); opacity: .85; }
.hero-inner { position: relative; z-index: 2; padding: 130px var(--gutter) clamp(56px, 10vh, 120px); max-width: 980px; }
.hero h1 { font-size: clamp(48px, 9vw, 116px); line-height: .98; margin-bottom: 28px; font-weight: 300; }
.lede { font-size: clamp(17px, 1.6vw, 20px); max-width: 560px; opacity: .88; margin-bottom: 36px; }
.hero-cta { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

/* Manifesto */
.manifesto p { font-size: 19px; }
.manifesto .big { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 1.2em; }
blockquote {
  margin: 56px 0; padding: 0 0 0 28px;
  border-left: 2px solid var(--ember);
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(30px, 4.4vw, 48px); line-height: 1.15;
}

/* Glimpses */
.glimpses { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; padding: 0; background: var(--ink); }
.glimpses:empty { display: none; }
.glimpses figure { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; }
.glimpses img { width: 100%; height: 100%; object-fit: cover; }
/* A single photo shows as a wide band instead of one huge tall frame */
.glimpses figure:only-child { aspect-ratio: 2 / 1; }
@media (max-width: 600px) { .glimpses figure:only-child { aspect-ratio: 4 / 5; } }

/* Method */
.alive { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line-light); }
.alive li { padding: 32px 24px 8px 0; border-right: 1px solid var(--line-light); padding-left: 24px; }
.alive li:first-child { padding-left: 0; }
.alive li:last-child { border-right: 0; }
.letter { display: block; font-family: var(--serif); font-size: 88px; line-height: 1; color: var(--ember); font-weight: 300; margin-bottom: 16px; }
.alive h3 { font-size: 24px; margin-bottom: 12px; }
.alive p { font-size: 15px; color: #4A433A; }

/* Path */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.steps li { padding: 32px 28px 0 0; border-top: 1px solid var(--line-dark); margin-right: 28px; }
.steps li:last-child { margin-right: 0; }
.num { display: block; font: 500 13px/1 var(--sans); letter-spacing: .14em; color: var(--ember-soft); margin-bottom: 24px; }
.steps h3 { font-size: 28px; margin-bottom: 14px; }
.steps p { font-size: 15px; opacity: .78; }

/* Edge */
.steps.three { grid-template-columns: repeat(3, 1fr); }
.for-whom { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--line-dark); }
.for-whom h3 { font-size: 24px; margin: 0 0 16px; }
.for-whom ul { padding-left: 20px; margin: 0 0 16px; }
.for-whom li { margin-bottom: 6px; opacity: .88; }
.for-whom li::marker { color: var(--ember-soft); }
.for-whom p { opacity: .88; }
.for-whom .small { color: var(--stone); opacity: 1; }
.for { border-top: 1px solid var(--line-light); padding-top: 28px; }
.for h3 { font-size: 24px; margin: 0 0 16px; }
.for h3 + p, .for ul { margin-bottom: 20px; }
.for ul { padding-left: 20px; }
.for li { margin-bottom: 6px; }
.for li::marker { color: var(--ember); }
.for .small { margin-bottom: 36px; }

/* About */
.portrait { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 2px; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.about .wrap.two:not(:has(.portrait)) { grid-template-columns: 1fr; max-width: 760px; }

/* Apply */
.apply .intro { margin-bottom: 40px; }

/* Invitation page */
.apply-page { background: var(--ink); }
/* Invitation banner: darkened photo with the title between the curtains */
.invite-hero {
  position: relative; overflow: hidden; background: var(--ink);
  min-height: min(78svh, 760px); display: flex; align-items: flex-end;
  padding: 150px 0 48px; text-align: center;
}
.invite-hero::before { content: ""; position: absolute; inset: 0; background: url('photos/invite.jpg') 50% 38% / cover no-repeat; }
.invite-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(31,27,22,.6) 0%, rgba(31,27,22,.35) 35%, rgba(31,27,22,.85) 75%, var(--ink) 100%);
}
.invite-hero .wrap { position: relative; z-index: 1; }
.invite-hero .intro { margin: 0 auto; max-width: 560px; opacity: .9; }
.apply-page .apply { padding-top: 32px; scroll-margin-top: 90px; }
.apply-page h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; margin-bottom: 24px; }

/* Closing invitation on the home page */
.closing { border-top: 1px solid var(--line-dark); }
.closing .intro { margin-bottom: 40px; }
form { margin-top: 8px; }
.progress { height: 2px; background: var(--line-dark); margin-bottom: 14px; }
.progress span { display: block; height: 100%; width: 20%; background: var(--ember-soft); transition: width .4s; }
.step-count { font: 500 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; opacity: .6; margin-bottom: 36px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-family: var(--serif); font-size: clamp(28px, 3.6vw, 38px); font-weight: 350; margin-bottom: 28px; padding: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
label { display: block; font-size: 15px; font-weight: 500; margin-bottom: 26px; }
.opt { font-weight: 400; opacity: .5; font-size: 13px; margin-left: 6px; }
.hint { display: block; font-weight: 400; opacity: .6; font-size: 14px; margin: 4px 0 0; }
input, textarea {
  display: block; width: 100%; margin-top: 10px;
  background: transparent; color: var(--paper);
  border: 0; border-bottom: 1px solid rgba(243,237,227,.3);
  padding: 10px 0; font: 400 17px/1.5 var(--sans);
  border-radius: 0; transition: border-color .2s;
}
textarea { resize: vertical; border: 1px solid rgba(243,237,227,.3); padding: 12px 14px; border-radius: 4px; }
input::placeholder, textarea::placeholder { color: rgba(243,237,227,.35); }
input:focus, textarea:focus { outline: none; border-color: var(--ember-soft); }
.invalid input, .invalid textarea, input.invalid, textarea.invalid { border-color: #F08A6E; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.q { margin-bottom: 30px; }
.qt { font-size: 15px; font-weight: 500; margin-bottom: 12px; }
.qt.sub { font-weight: 400; opacity: .75; margin-bottom: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pills.multi { margin: 8px 0 30px; }
.pills button {
  background: transparent; color: var(--paper);
  border: 1px solid rgba(243,237,227,.3); border-radius: 999px;
  padding: 10px 18px; font: 400 15px/1.3 var(--sans); cursor: pointer;
  text-align: left; transition: background .15s, border-color .15s, color .15s;
}
.pills button:hover { border-color: var(--paper); }
.pills button[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.pills.invalid button { border-color: #F08A6E; }
.pills button:disabled { opacity: .35; cursor: not-allowed; }
.pills button:focus-visible, .btn:focus-visible, .link:focus-visible { outline: 2px solid var(--ember-soft); outline-offset: 3px; }

.promise { border: 1px solid var(--line-dark); border-radius: 4px; padding: 24px 26px; margin-bottom: 36px; background: var(--ink-2); }
.promise p { margin: 0 0 12px; }
.promise .yours { margin: 0; font-size: 15px; opacity: .8; }
#yourWants { color: var(--ember-soft); }

.error { color: #F08A6E; font-size: 15px; margin: 8px 0 0; }
.nav { display: flex; justify-content: space-between; align-items: center; margin-top: 36px; gap: 16px; }
.nav .next, .nav .send { margin-left: auto; }

.done { padding: 40px 0; outline: none; }
.done p { font-size: 19px; opacity: .88; }

/* Footer */
.foot { background: var(--ink); color: var(--stone); text-align: center; padding: 48px var(--gutter) 56px; border-top: 1px solid var(--line-dark); font-size: 13px; }
.foot .wordmark { color: var(--paper); font-size: 18px; margin-bottom: 6px; }
.foot p { margin: 0; }

/* Responsive */
@media (max-width: 980px) {
  .alive { grid-template-columns: 1fr; border-top: 0; }
  .alive li { display: grid; grid-template-columns: 64px 1fr; column-gap: 20px; padding: 24px 0; border-right: 0; border-top: 1px solid var(--line-light); }
  .alive li .letter { grid-row: span 2; font-size: 60px; margin: 0; }
  .alive li h3 { align-self: end; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .steps.three { grid-template-columns: 1fr; }
  .steps.three li { margin-right: 0; }
  .for-whom { grid-template-columns: 1fr; }
  .steps li:nth-child(2n) { margin-right: 0; }
  .wrap.two { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .steps { grid-template-columns: 1fr; }
  .steps li { margin-right: 0; }
  .grid { grid-template-columns: 1fr; }
  .sun { left: 72%; top: 26%; width: 90vw; opacity: .7; }
  .horizon { display: none; }
  /* Photo in the top part of the screen, fading into the dark behind the text */
  .hero.has-photo::before {
    background-size: auto 62%; background-position: 37% 0;
    -webkit-mask-image: linear-gradient(180deg, #000 46%, transparent 62%);
            mask-image: linear-gradient(180deg, #000 46%, transparent 62%);
  }
  .hero h1 { font-size: clamp(44px, 13vw, 64px); }
  .top { padding-top: 16px; padding-bottom: 16px; }
  .logo-head, .top.scrolled .logo-head { width: 124px; }
  .hide-sm { display: none; }
  .manifesto p { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sun { animation: none; }
  * { transition: none !important; }
}
