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

@font-face {
  font-family: "Ronzino";
  src: url("fonts/Ronzino-Oblique.woff2") format("woff2");
  font-display: swap;
  font-style: oblique;
  font-weight: 400;
}

@font-face {
  font-family: "Ronzino";
  src: url("fonts/Ronzino-Medium.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 500;
}

@font-face {
  font-family: "Ronzino";
  src: url("fonts/Ronzino-MediumOblique.woff2") format("woff2");
  font-display: swap;
  font-style: oblique;
  font-weight: 500;
}

@font-face {
  font-family: "Ronzino";
  src: url("fonts/Ronzino-Bold.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

@font-face {
  font-family: "Ronzino";
  src: url("fonts/Ronzino-BoldOblique.woff2") format("woff2");
  font-display: swap;
  font-style: oblique;
  font-weight: 700;
}

:root {
  --paper: #ffffff;
  --ink: #151515;
  --quiet: #767676;
  --line: #d8d8d8;
  --title-font: "redaction-20", "Times New Roman", Times, serif;
  --body-font: "Ronzino", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --star-cursor: url("/assets/cursor.svg") 20 24, auto;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
  color: var(--ink);
  cursor: var(--star-cursor);
  font-family: var(--body-font);
  font-synthesis: none;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

a,
button,
label,
input[type="file"] {
  cursor: pointer;
}

.site-shell {
  min-height: 100svh;
  padding: clamp(28px, 4vw, 58px);
}

.gate {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(300px, 2fr);
  column-gap: clamp(40px, 9vw, 150px);
  min-height: calc(100svh - clamp(56px, 8vw, 116px));
  grid-template-rows: auto 1fr;
  align-content: stretch;
  padding-top: clamp(48px, 12vh, 120px);
}

.letter {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(300px, 2fr);
  column-gap: clamp(40px, 9vw, 150px);
  min-height: calc(100svh - clamp(56px, 8vw, 116px));
  padding: clamp(72px, 12vh, 136px) 0 12vh;
  align-content: start;
}

.outline {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  margin: 7px 0 0;
}

.outline-item {
  display: block;
  margin: 0 0 12px;
  color: var(--quiet);
  font-family: var(--title-font);
  font-style: italic;
  font-size: clamp(0.72rem, 0.68rem + 0.16vw, 0.84rem);
  letter-spacing: 0.07em;
  line-height: 1.25;
  text-decoration: none;
}

.outline-item:last-child {
  margin-bottom: 0;
}

.outline-item.is-active {
  color: var(--ink);
}

.statement {
  grid-column: 2;
  grid-row: 1;
  max-width: 780px;
}

.statement > p:first-child {
  margin: 0;
  font-family: var(--title-font);
  font-size: clamp(2.35rem, 5.5vw, 6.7rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.aside {
  margin: clamp(24px, 4vw, 48px) 0 0;
  font-size: clamp(0.92rem, 1.2vw, 1.08rem);
  line-height: 1.4;
}

.upload-area {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  width: min(100%, 780px);
  margin-top: 48px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.upload-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 15px 10px 14px;
  cursor: pointer;
}

.upload-label:hover {
  background: #f1f1ef;
}

.file-input:focus-visible + .upload-label {
  background: #f1f1ef;
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.upload-action {
  font-size: clamp(1rem, 1.5vw, 1.28rem);
}

.upload-meta,
.file-progress {
  color: var(--quiet);
  font-size: 0.76rem;
  letter-spacing: 0.015em;
}

.file-state {
  padding-top: 18px;
}

.file-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.file-name {
  max-width: 78%;
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track {
  height: 1px;
  margin-top: 18px;
  background: var(--line);
}

.progress-bar {
  display: block;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width 180ms linear;
}

.error-message {
  margin: 16px 0 0;
  color: #8b1e1e;
  font-size: 0.84rem;
}

.letter {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 700ms ease, transform 700ms ease;
}

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

.letter-outline {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: clamp(28px, 4vw, 58px);
}

.chapters {
  grid-column: 2;
  grid-row: 1;
  width: min(100%, 780px);
}

.chapter {
  scroll-margin-top: clamp(28px, 4vw, 58px);
}

.chapter + .chapter {
  margin-top: clamp(180px, 30vh, 340px);
}

.letter-header {
  width: min(100%, 780px);
}

.letter-title {
  margin: 0;
  font-family: var(--title-font);
  font-size: clamp(2.35rem, 5.5vw, 6.7rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.letter-copy {
  width: min(100%, 780px);
  max-width: 680px;
  margin-top: clamp(84px, 13vh, 150px);
  font-size: clamp(1.05rem, 1.32vw, 1.2rem);
  font-weight: 400;
  letter-spacing: -0.006em;
  line-height: 1.58;
}

.letter-copy p {
  margin: 0 0 1.45em;
}

.letter-copy p:last-child {
  margin-bottom: 0;
}

.poem-figure {
  width: min(100%, 680px);
  margin: clamp(72px, 11vh, 124px) 0 0;
}

.poem-text {
  margin: 0;
  font-family: var(--body-font);
  font-size: clamp(1.08rem, 1.45vw, 1.3rem);
  font-style: normal;
  font-weight: 400;
  letter-spacing: -0.006em;
  line-height: 1.52;
}

.poem-text p {
  margin: 0;
}

.poem-text p + p {
  margin-top: 2.4em;
}

.poem-credit {
  margin-top: 18px;
  color: var(--quiet);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
}

.poem-credit cite {
  font-style: italic;
}

.notes-list {
  width: min(100%, 780px);
  margin-top: clamp(84px, 13vh, 150px);
}

.notes-intro {
  max-width: 620px;
  margin: clamp(28px, 4vw, 46px) 0 0;
  font-size: clamp(1.05rem, 1.32vw, 1.2rem);
  font-weight: 400;
  letter-spacing: -0.006em;
  line-height: 1.58;
}

.note-entry {
  display: grid;
  grid-template-columns: minmax(92px, 120px) minmax(0, 1fr);
  column-gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.note-entry + .note-entry {
  margin-top: clamp(58px, 8vh, 92px);
}

.note-time {
  color: var(--quiet);
  font-family: var(--title-font);
  font-size: clamp(0.78rem, 0.74rem + 0.14vw, 0.9rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1.35;
}

.note-body {
  max-width: 620px;
  font-size: clamp(1.05rem, 1.32vw, 1.2rem);
  font-weight: 400;
  letter-spacing: -0.006em;
  line-height: 1.58;
}

.note-body p {
  margin: 0;
}

.note-body p + p {
  margin-top: 1.15em;
}

.note-edit {
  color: var(--quiet);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.note-list {
  margin: 1.15em 0 0;
  padding: 0;
  list-style: none;
}

.note-list li {
  position: relative;
  margin: 0 0 0.28em;
  padding-left: 1.1em;
}

.note-list li::before {
  position: absolute;
  left: 0;
  content: "-";
}

.gate.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 500ms ease, transform 500ms ease;
}

@media (max-width: 720px) {
  .site-shell {
    padding: 24px;
  }

  .gate {
    grid-template-columns: 1fr;
    min-height: calc(100svh - 48px);
  }

  .gate {
    grid-template-rows: auto auto 1fr;
    align-content: stretch;
    padding-top: clamp(52px, 11vh, 92px);
  }

  .letter {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: calc(100svh - 48px);
    align-content: start;
    padding: clamp(58px, 11vh, 94px) 0 10vh;
  }

  .outline {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 46px;
  }

  .statement {
    grid-column: 1;
    grid-row: 2;
  }

  .statement > p:first-child {
    font-size: clamp(2.7rem, 13.5vw, 5rem);
  }

  .upload-area {
    grid-column: 1;
  }

  .upload-area {
    grid-row: 3;
    align-self: end;
    margin-top: 44px;
  }

  .upload-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .letter-outline {
    grid-column: 1;
    grid-row: 1;
    position: static;
    margin-bottom: 46px;
  }

  .chapters {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }

  .chapter + .chapter {
    margin-top: 144px;
  }

  .letter-header {
    width: 100%;
  }

  .letter-title {
    font-size: clamp(2.7rem, 13.5vw, 5rem);
  }

  .letter-copy {
    width: 100%;
    margin-top: 88px;
    font-size: 1.07rem;
    line-height: 1.56;
  }

  .poem-figure {
    margin-top: 72px;
  }

  .poem-text {
    font-size: 1.03rem;
    line-height: 1.5;
  }

  .notes-list {
    margin-top: 88px;
  }

  .notes-intro {
    margin-top: 30px;
    font-size: 1.07rem;
    line-height: 1.56;
  }

  .note-entry {
    grid-template-columns: 1fr;
    row-gap: 18px;
  }

  .note-entry + .note-entry {
    margin-top: 68px;
  }

  .note-time {
    font-size: 0.8rem;
  }

  .note-body {
    font-size: 1.07rem;
    line-height: 1.56;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
