@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --cream: #f3ede3;
  --paper: #ebe3d6;
  --ink: #26231e;
  --muted: #5f594f;
  --olive: #565b3a;
  --rule: rgba(38, 35, 30, 0.14);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pad: clamp(20px, 4.5vw, 72px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-snap-type: y proximity;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ol,
figure {
  margin: 0;
}

/* One screen per section. */

.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  scroll-snap-align: start;
}

.copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: var(--pad);
  padding-top: max(var(--pad), env(safe-area-inset-top));
  padding-bottom: max(var(--pad), env(safe-area-inset-bottom));
}

.photo {
  position: relative;
  overflow: hidden;
  background: var(--paper);
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero .photo img {
  object-position: 42% 30%;
}

.how .photo img {
  object-position: 50% 45%;
}

/* Type */

.wordmark {
  font-family: var(--serif);
  font-size: 1.875rem;
  line-height: 1;
  letter-spacing: -0.01em;
}

.wordmark.small {
  font-size: 1.375rem;
  margin-right: 10px;
}

.lead {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.6svh, 28px);
  max-width: 34rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--olive);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, min(6vw, 10svh), 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 em,
h2 em {
  font-style: italic;
  color: var(--olive);
}

.sub {
  max-width: 30rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.1875rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.scroll-hint {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.scroll-hint:hover {
  border-bottom-color: var(--ink);
}

.scroll-hint span {
  display: inline-block;
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-hint span {
    animation: nudge 2.4s ease-in-out infinite;
  }

  .hero .photo img {
    animation: settle 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero .lead {
    animation: rise 0.9s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@keyframes settle {
  from { transform: scale(1.04); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 4px;
  border-radius: 2px;
}

/* How it works */

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, min(4.6vw, 8svh), 4.25rem);
  line-height: 1;
  letter-spacing: -0.015em;
}

.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  max-width: 32rem;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  column-gap: 12px;
  padding: clamp(12px, 2.2svh, 22px) 0;
  border-top: 1px solid var(--rule);
}

.steps li:last-child {
  border-bottom: 1px solid var(--rule);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  grid-row: span 2;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.05;
  color: var(--olive);
}

.steps h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.steps p {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  color: var(--muted);
  font-size: 0.875rem;
}

.foot .contact {
  color: var(--ink);
  flex-basis: 100%;
}

.foot .note {
  flex-basis: 100%;
}

.foot .note span {
  white-space: nowrap;
}

.foot .note + .note {
  margin-top: -2px;
}

.contact a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  padding: 6px 0;
}

.contact a:hover {
  text-decoration-color: var(--ink);
}

.note {
  font-size: 0.8125rem;
}

/* Wide screens and landscape phones: copy beside a full-height photo. */

@media (min-width: 900px), (orientation: landscape) and (min-width: 600px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, min(50vw, 92svh));
  }

  .how {
    grid-template-columns: minmax(0, min(50vw, 92svh)) minmax(0, 1fr);
  }

  .how .copy {
    justify-content: center;
    gap: clamp(20px, 4svh, 44px);
  }

  .how .copy > * {
    width: 100%;
    max-width: 32rem;
  }

  .how .foot {
    margin-top: auto;
  }

  .how h2 {
    margin-top: auto;
  }
}

/* Portrait phones and narrow windows: stacked, still one screen each. */

@media (max-width: 899.98px) and (orientation: portrait), (max-width: 599.98px) {
  .copy {
    display: contents;
  }

  .hero {
    grid-template-rows: auto minmax(200px, 1fr) auto auto;
  }

  .hero .wordmark { grid-row: 1; }
  .hero .photo { grid-row: 2; }
  .hero .lead { grid-row: 3; }
  .hero .scroll-hint { grid-row: 4; }

  .hero .wordmark {
    padding: max(16px, env(safe-area-inset-top)) var(--pad) 14px;
    font-size: 1.625rem;
  }

  .hero .lead {
    padding: 22px var(--pad) 0;
    gap: 12px;
  }

  .hero .scroll-hint {
    margin: 10px var(--pad) max(16px, env(safe-area-inset-bottom));
  }

  h1 {
    font-size: clamp(2.375rem, 11vw, 3.25rem);
  }

  .how {
    grid-template-rows: minmax(160px, 1fr) auto auto auto;
  }

  .how h2 {
    padding: 22px var(--pad) 12px;
    font-size: clamp(2rem, 9vw, 2.5rem);
  }

  .how .steps {
    padding: 0 var(--pad);
  }

  .steps li {
    padding: 10px 0;
    grid-template-columns: 2.25rem 1fr;
  }

  .steps li::before {
    font-size: 1.3125rem;
  }

  .steps h3 {
    font-size: 1rem;
  }

  .how .foot {
    padding: 14px var(--pad) max(16px, env(safe-area-inset-bottom));
  }
}

/* Small phones (iPhone SE class): tighten so each section still fits one screen. */

@media (max-width: 899.98px) and (orientation: portrait) and (max-height: 700px) {
  .hero .wordmark {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: 10px;
    font-size: 1.5rem;
  }

  .hero .lead {
    padding-top: 16px;
    gap: 10px;
  }

  h1 {
    font-size: clamp(2.125rem, 10.5vw, 2.75rem);
  }

  .sub {
    font-size: 0.9375rem;
  }

  .hero .scroll-hint {
    margin-top: 4px;
  }

  .how {
    grid-template-rows: minmax(110px, 1fr) auto auto auto;
  }

  .how h2 {
    padding-top: 16px;
    padding-bottom: 8px;
    font-size: 2rem;
  }

  .steps li {
    padding: 8px 0;
  }

  .steps h3 {
    font-size: 0.9375rem;
  }

  .steps p {
    font-size: 0.875rem;
  }

  .steps li {
    grid-template-columns: 1.875rem 1fr;
  }

  .how .foot {
    padding-top: 10px;
    font-size: 0.8125rem;
  }

  .foot .note {
    font-size: 0.75rem;
  }
}

/* Landscape phones: short screens, so scale everything to the height. */

@media (orientation: landscape) and (max-height: 520px) and (min-width: 600px) {
  :root {
    --pad: 20px;
  }

  .copy {
    gap: 12px;
  }

  .wordmark {
    font-size: 1.375rem;
  }

  .lead {
    gap: 10px;
  }

  .tag {
    font-size: 0.6875rem;
  }

  h1 {
    font-size: clamp(1.875rem, 10svh, 2.75rem);
  }

  .sub {
    font-size: 0.875rem;
    line-height: 1.45;
  }

  .scroll-hint {
    min-height: 32px;
    font-size: 0.875rem;
  }

  h2 {
    font-size: clamp(1.625rem, 9svh, 2.25rem);
  }

  .how .copy {
    gap: 10px;
  }

  .steps li {
    padding: 5px 0;
    grid-template-columns: 2rem 1fr;
  }

  .steps li::before {
    font-size: 1.125rem;
  }

  .steps h3 {
    font-size: 0.875rem;
  }

  .steps p {
    font-size: 0.8125rem;
    line-height: 1.35;
  }

  .foot {
    font-size: 0.8125rem;
  }

  .wordmark.small {
    font-size: 1.125rem;
  }
}

/* Stacked layout: same left edge and short underline as on desktop. */

@media (max-width: 899.98px) and (orientation: portrait), (max-width: 599.98px) {
  .hero .scroll-hint {
    justify-self: start;
  }

  .how .steps,
  .how .foot {
    max-width: 40rem;
  }
}

/* Very wide screens: pull the copy in from the outer edge. */

@media (min-width: 1800px) {
  .hero .copy {
    padding-left: max(var(--pad), calc(50vw - 900px));
  }

  .how .copy {
    padding-left: max(var(--pad), calc(50vw - 1000px));
  }
}

@media (orientation: landscape) and (max-height: 520px) and (min-width: 600px) {
  .foot {
    gap: 0 16px;
  }

  .contact a {
    padding: 2px 0;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (min-width: 600px) {
  .how .copy {
    gap: 8px;
  }

  .steps li {
    padding: 3px 0;
  }

  .foot .note {
    font-size: 0.75rem;
  }
}
