@font-face {
  font-family: Newsreader;
  src: url('./assets/newsreader.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: Geist;
  src: url('./assets/geist.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

.writing-path, .guide-section {
  font-family: Geist, system-ui, sans-serif;
}

.writing-path {
  color: #1b211c;
  background: #fff;
  padding-top: clamp(68px, 9vw, 132px);
}

.writing-intro {
  max-width: 700px;
  margin-inline: auto;
  padding-inline: 22px;
  text-align: center;
}

.writing-intro h2, .guide-intro h2 {
  margin: 0 auto;
  font: 400 clamp(43px, 6vw, 83px)/1.02 Newsreader, Georgia, serif;
  letter-spacing: -0.04em;
}

.writing-intro p {
  max-width: 590px;
  margin: 18px auto 0;
  text-wrap: pretty;
}

.writing-intro p, .writing-card p {
  color: #303b32;
  font: 400 1rem/1.62 Geist, system-ui, sans-serif;
}

.writing-method {
  position: relative;
  max-width: 1720px;
  margin: clamp(26px, 4.1vw, 60px) auto 0;
  padding: 0 24px clamp(60px, 8vw, 115px);
}

.writing-caption {
  max-width: 235px;
}

.writing-caption h3 {
  margin: 0 0 8px;
  font: 400 clamp(23px, 2.2vw, 40px)/1.04 Newsreader, Georgia, serif;
  letter-spacing: -0.03em;
}

.writing-caption p {
  margin: 0;
  color: #3f4840;
  font-size: clamp(0.86rem, 1.12vw, 1.05rem);
  line-height: 1.43;
}

.writing-method > .writing-caption {
  max-width: 34ch;
  margin: 0 auto 25px;
  text-align: center;
}

.writing-steps {
  display: grid;
  gap: 16px;
  max-width: 840px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.writing-stage { display: none; }

.writing-step {
  --photo: url('./assets/woodland.jpg');
  --photo-position: 50% 62%;
  display: grid;
  place-items: center;
  min-height: 245px;
  border-radius: clamp(22px, 3.6vw, 62px);
  padding: clamp(14px, 3vw, 35px);
  background: linear-gradient(#17251426, #16251830), var(--photo) var(--photo-position) / cover;
  background-color: #485941;
}

.writing-step:nth-child(even) {
  --photo: url('./assets/writing-cafe.jpg');
  --photo-position: 50% 68%;
  background-color: #665749;
}

.writing-step:nth-child(3) { --photo-position: 70% 48%; }
.writing-step:nth-child(5) { --photo-position: 45% 80%; }

.writing-card {
  width: min(100%, 55%, 530px);
  padding: clamp(12px, 1.5vw, 20px);
  border: 1px solid #fff;
  border-radius: 15px;
  background: #faf9f5;
  box-shadow: 0 6px 30px #0a160e36;
  color: #1b211c;
}

.writing-step-number {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  margin-bottom: 12px;
  border: 1px solid #a0a69c;
  border-radius: 50%;
  font-size: 0.73rem;
  font-variant-numeric: tabular-nums;
}

.writing-card h4 {
  margin: 0 0 8px;
  font: 400 clamp(25px, 2.5vw, 37px)/1.05 Newsreader, Georgia, serif;
}

.writing-card p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
}

.writing-method.deck-ready {
  --writing-stage-height: 84svh;
  min-height: calc(var(--writing-stage-height) + 4 * 72svh + 22svh);
  padding: 0;
}

.deck-ready > .writing-steps, .deck-ready > .writing-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.deck-ready .writing-stage {
  position: sticky;
  top: 0;
  height: var(--writing-stage-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(57.2%, 1050px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 2.25vw, 40px);
  padding-inline: clamp(18px, 3.7vw, 72px);
  overflow: clip;
}

.writing-deck {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1.58;
  max-height: 64svh;
  margin: 0;
  padding: 0;
  list-style: none;
}

.writing-deck .writing-step {
  position: absolute;
  inset: 0;
  min-height: auto;
  transform-origin: center bottom;
}
.writing-stage .writing-caption {
  grid-row: 1;
  position: relative;
  z-index: 1;
}
.writing-caption.deck-left { grid-column: 1; justify-self: end; }
.writing-caption.deck-right { grid-column: 3; justify-self: start; }

.guide-section {
  padding-top: clamp(34px, 5.4vw, 82px);
  background: #fff;
}

.guide-feature {
  min-height: clamp(480px, 49vw, 750px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  padding: clamp(50px, 7vw, 100px) 22px;
  border-radius: calc(var(--guide-rounding, 0) * clamp(25px, 4vw, 66px));
  background:
    radial-gradient(ellipse at center, #12120fbd 0%, #12120fac 45%, #12120f9c 100%),
    url('./assets/writing-cafe.jpg') center 64% / cover #282620;
  color: #fff;
  text-align: center;
}

.guide-label {
  margin: 0 auto 16px;
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .075em;
}

.guide-intro { width: min(100%, 760px); }
.guide-intro h2 {
  font-size: clamp(34px, 4.6vw, 67px);
  text-wrap: balance;
}
.guide-intro h2 span { white-space: nowrap; }
.guide-intro p:not(.guide-label) {
  max-width: 52ch;
  margin: 18px auto 0;
  font-size: clamp(0.98rem, 1.35vw, 1.17rem);
  line-height: 1.6;
  text-wrap: balance;
}
.guide-card { width: min(100%, 605px); }
.guide-fields { display: flex; justify-content: center; gap: 8px; }
.guide-fields input, .guide-fields button {
  min-height: 55px;
  border-radius: 28px;
  font: 500 1rem Geist, system-ui, sans-serif;
}
.guide-fields input {
  min-width: 0;
  flex: 1;
  padding: 10px 18px;
  border: 1px solid #b8b3a7;
  background: #fffdfa;
  color: #191b17;
}
.guide-fields input::placeholder { color: #5c5b55; }
.guide-fields button {
  padding: 10px 17px;
  border: 1px solid #b7d6c7;
  color: #fff;
  background: #254b41;
  white-space: nowrap;
}
.guide-fields button:hover { background: #18372e; }
.guide-fields button:disabled { opacity: 0.75; cursor: wait; }
.guide-feature :focus-visible { outline: 3px solid #fadb8e; outline-offset: 4px; }
.guide-form {
  padding: clamp(8px, 1.1vw, 14px);
  border: 1px solid #fff9;
  border-radius: 26px;
  background: #211e19db;
}
#guide-note { margin: 10px 0 2px; font-size: 0.81rem; }
.guide-status { margin: 0; line-height: 1.5; }
.guide-status:not(:empty) { padding: 13px 16px; border-radius: 16px; background: #121212; }
.guide-status a { display: inline-block; margin-top: 5px; }
.guide-workshops { font-size: 0.9rem; text-underline-offset: 4px; }

@media (max-width: 720px) {
  .writing-method.deck-ready { --writing-stage-height: max(355px, 71svh); }

  .deck-ready .writing-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(74px, auto) auto;
    align-content: center;
    gap: 13px;
  }

  .writing-deck {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    width: min(100%, 520px);
    aspect-ratio: 1.15;
    min-height: 245px;
  }

  .writing-stage .writing-caption.deck-left, .writing-stage .writing-caption.deck-right {
    grid-column: 1;
    justify-self: center;
    text-align: center;
    max-width: 34ch;
  }

  .writing-card { width: min(95%, 430px); }
  .guide-feature { background-position: center, 47% 64%; }
}

@media (max-width: 440px) {
  .guide-fields { flex-direction: column; }
  .guide-fields button { width: 100%; }
}

@media (prefers-reduced-motion: reduce), (max-height: 490px), print {
  .writing-method.deck-ready { min-height: 0; padding: 0 24px 65px; }
  .deck-ready .writing-stage { display: none; }
  .deck-ready > .writing-steps, .deck-ready > .writing-caption {
    position: static;
    width: auto;
    height: auto;
    margin-inline: auto;
    overflow: visible;
    clip-path: none;
  }
  .deck-ready > .writing-caption { margin-bottom: 25px; }
}
