/* The Poetree — night canopy, scroll paper, yellow thread */
:root {
  --canopy: #1e2b21;
  --canopy-deep: #162019;
  --leaf: #2a3a2c;
  --paper: #ede8dc;
  --paper-dim: rgba(237, 232, 220, 0.74);
  --paper-faint: rgba(237, 232, 220, 0.18);
  --ink: #2a2620;
  --thread: #e2b93b;
  --bark: #7d6a55;

  --display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --text: "Hanken Grotesk", system-ui, sans-serif;

  --measure: 34rem;
  --gutter: clamp(1rem, 4vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--canopy);
  color: var(--paper);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--thread); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--thread); }
:focus-visible { outline: 2px solid var(--thread); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); color: var(--ink); padding: .5rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; top: 1rem; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; margin: 0; }
p { margin: 0 0 1em; max-width: var(--measure); }

/* ---------- Site header ---------- */
.site-head {
  position: absolute; inset: 0 0 auto 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1.25rem var(--gutter);
}
.site-head .mark { font-family: var(--display); font-size: 1.35rem; text-decoration: none; white-space: nowrap; }
.site-head nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; list-style: none; margin: 0; padding: 0; justify-content: flex-end; }
.site-head nav a { text-decoration: none; font-size: .95rem; color: var(--paper-dim); }
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: var(--paper); }
.site-head nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--thread); }
.page .site-head { position: relative; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; align-items: end;
  padding: 7rem var(--gutter) clamp(2.5rem, 7vh, 5rem);
  background: var(--canopy-deep) url("assets/hero-poster.jpg") center / cover no-repeat;
  isolation: isolate;
}
.hero-video {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(22,32,25,.6) 0%, rgba(22,32,25,.15) 25%, rgba(22,32,25,.2) 50%, rgba(30,43,33,.85) 85%, var(--canopy) 100%);
}
@media (prefers-reduced-motion: reduce) { .hero-video { display: none; } .sound-toggle { display: none; } }

.sound-toggle {
  position: absolute; right: var(--gutter); bottom: clamp(2.5rem, 7vh, 5rem); z-index: 2;
  display: inline-flex; align-items: center; gap: .6rem;
  font: inherit; font-size: .95rem; color: var(--paper); cursor: pointer;
  background: rgba(22,32,25,.45); border: 1px solid var(--paper-dim); border-radius: 2rem;
  padding: .6rem 1.1rem .6rem .9rem;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.sound-toggle:hover { border-color: var(--thread); color: var(--thread); }
.sound-toggle svg { width: 20px; height: 20px; }
.sound-toggle .i-on { display: none; }
.sound-toggle[aria-pressed="true"] .i-on { display: block; }
.sound-toggle[aria-pressed="true"] .i-off { display: none; }
@media (max-width: 640px) {
  .sound-toggle { top: 5.5rem; bottom: auto; padding: .55rem; }
  .sound-toggle .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------- Activation film ---------- */
.activation { display: grid; gap: 2.5rem 5rem; grid-template-columns: minmax(0, 1fr); align-items: center; padding-top: 0; }
.activation figure { margin: 0; max-width: 28rem; }
.activation video { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--canopy-deep); }
.activation p { color: var(--paper-dim); }
@media (min-width: 860px) { .activation { grid-template-columns: 5fr 6fr; } }
.hero h1 {
  font-size: clamp(4rem, 15vw, 13rem);
  letter-spacing: -0.02em;
  line-height: .85;
  margin-left: -0.04em;
}
.hero .lede {
  font-family: var(--display); font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem); line-height: 1.3;
  margin-top: 1.25rem; max-width: 26ch; color: var(--paper);
}

/* ---------- Layout bands ---------- */
.band { padding: clamp(4rem, 10vw, 8rem) var(--gutter); }
.band h2 { font-size: clamp(2.4rem, 5.5vw, 4.25rem); margin-bottom: 1.5rem; }

.intro { display: grid; gap: 2.5rem 4rem; grid-template-columns: minmax(0, 1fr); }
.intro .big { font-family: var(--display); font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1.3; max-width: 30ch; }
.intro .aside { color: var(--paper-dim); font-size: 1rem; }
.intro .aside p { max-width: 30rem; }
@media (min-width: 860px) {
  .intro { grid-template-columns: 1.3fr 1fr; align-items: end; }
}

/* ---------- Listen ---------- */
.listen { background: var(--canopy-deep); }
.listen .head { display: grid; gap: 1rem 4rem; }
@media (min-width: 860px) { .listen .head { grid-template-columns: 1fr 1fr; align-items: end; } }
.listen .head p { color: var(--paper-dim); }
.full-piece { margin-top: 2.5rem; max-width: 60rem; }
.full-piece iframe { display: block; width: 100%; height: 152px; border: 0; }
.full-piece .note { font-size: .9rem; color: var(--paper-dim); margin-top: .75rem; }

/* The branch and its hanging scrolls */
.canopy {
  position: relative; margin-top: clamp(4rem, 9vw, 6rem);
  padding-top: 0;
}
.canopy .branch { display: block; width: 100%; height: 48px; color: var(--bark); }
.canopy h3 { font-size: 1.6rem; margin-bottom: .25rem; }
.canopy-label { color: var(--paper-dim); margin: 0 0 1.5rem; font-size: 1rem; }
.scrolls {
  list-style: none; margin: -14px 0 0; padding: 0;
  display: grid; gap: 0 clamp(1rem, 4vw, 3rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.scroll { display: flex; flex-direction: column; align-items: center; }
.scroll .thread { width: 1px; background: var(--thread); }
.scroll:nth-child(1) .thread { height: 70px; }
.scroll:nth-child(2) .thread { height: 150px; }
.scroll:nth-child(3) .thread { height: 40px; }

.paper {
  --tilt: -2deg;
  position: relative; width: min(100%, 15rem);
  background: var(--paper); color: var(--ink);
  padding: 1.5rem 1.25rem 1.25rem;
  transform: rotate(var(--tilt)); transform-origin: 50% -40px;
  box-shadow: 0 18px 30px -18px rgba(0,0,0,.6);
}
.scroll:nth-child(2) .paper { --tilt: 1.5deg; }
.scroll:nth-child(3) .paper { --tilt: -0.8deg; }
/* rolled ends of the scroll */
.paper::before, .paper::after {
  content: ""; position: absolute; left: -6px; right: -6px; height: 10px;
  background: linear-gradient(180deg, #f7f3ea 0%, #d8d1c1 60%, #c9c1af 100%);
  border-radius: 6px;
}
.paper::before { top: -5px; }
.paper::after { bottom: -5px; }
.paper .title { font-family: var(--display); font-size: 1.45rem; line-height: 1.1; margin: 0; }
.paper .poet { font-family: var(--display); font-style: italic; font-size: 1.05rem; margin: .2rem 0 1rem; color: #5b5246; }
.paper .controls { display: flex; align-items: center; gap: .75rem; }
.play {
  flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.play:hover { background: var(--ink); color: var(--paper); }
.play svg { width: 14px; height: 14px; }
.play .i-pause { display: none; }
.is-playing .play .i-play { display: none; }
.is-playing .play .i-pause { display: block; }
.progress { flex: 1; height: 2px; background: rgba(42,38,32,.18); position: relative; cursor: pointer; }
.progress span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--thread); }
.time { font-size: .8rem; font-variant-numeric: tabular-nums; color: #5b5246; min-width: 2.6rem; text-align: right; }

@media (prefers-reduced-motion: no-preference) {
  .is-playing .paper { animation: sway 5s ease-in-out infinite; }
}
@keyframes sway {
  0%, 100% { transform: rotate(var(--tilt)); }
  50% { transform: rotate(calc(var(--tilt) * -1.6)); }
}

@media (max-width: 720px) {
  .canopy .branch { display: none; }
  .scrolls { grid-template-columns: minmax(0, 1fr); margin-top: 0; gap: 0; }
  .scroll { border-left: 1px solid var(--thread); align-items: flex-start; padding: 0 0 2.25rem 1.25rem; }
  .scroll .thread { display: none; }
  .scroll:first-child { padding-top: 1.25rem; }
  .paper { width: 100%; max-width: 22rem; }
}

/* ---------- Contribute ---------- */
.contribute { display: grid; gap: 3rem 5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .contribute { grid-template-columns: 5fr 7fr; } }
.contribute figure { margin: 0; }
.contribute figure img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
@media (min-width: 900px) { .contribute figure { position: sticky; top: 2rem; align-self: start; } }
.contribute .include { padding-left: 1.25rem; margin: 0 0 1.5rem; }
.contribute .include li { margin-bottom: .25rem; }
.small { font-size: .95rem; color: var(--paper-dim); }

/* ---------- Forms ---------- */
form { margin-top: 2rem; max-width: 36rem; }
.row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.25rem; }
label { font-size: .95rem; }
label .opt { color: var(--paper-dim); font-size: .85rem; }
input[type="text"], input[type="email"], textarea {
  font: inherit; color: var(--paper);
  background: transparent; border: 0; border-bottom: 1px solid var(--paper-faint);
  padding: .55rem 0; border-radius: 0;
}
input:hover, textarea:hover { border-bottom-color: var(--paper-dim); }
input:focus-visible, textarea:focus-visible { outline: none; border-bottom: 2px solid var(--thread); }
textarea { min-height: 7.5rem; resize: vertical; border: 1px solid var(--paper-faint); padding: .75rem; }
textarea:focus-visible { border: 2px solid var(--thread); }
input[type="file"] { font: inherit; font-size: .95rem; color: var(--paper-dim); }
input[type="file"]::file-selector-button {
  font: inherit; margin-right: 1rem; padding: .55rem 1rem; cursor: pointer;
  background: transparent; color: var(--paper); border: 1px solid var(--paper-dim); border-radius: 2rem;
}
.hint { font-size: .85rem; color: var(--paper-dim); }
.hidden-field { position: absolute; left: -9999px; }
.btn {
  font: inherit; font-size: 1rem; cursor: pointer;
  background: var(--thread); color: var(--ink); border: 0; border-radius: 2rem;
  padding: .8rem 1.75rem; margin-top: .5rem;
}
.btn:hover { background: var(--paper); }

/* ---------- Inner pages ---------- */
.page-hero { padding: clamp(3rem, 8vw, 6rem) var(--gutter) 0; }
.page-hero h1 { font-size: clamp(3rem, 9vw, 7.5rem); letter-spacing: -0.015em; }
.split { display: grid; gap: 3rem 5rem; grid-template-columns: minmax(0, 1fr); padding: clamp(3rem, 7vw, 5rem) var(--gutter) clamp(4rem, 10vw, 8rem); }
@media (min-width: 900px) { .split { grid-template-columns: 6fr 5fr; align-items: start; } }
.split figure { margin: 0; }
.split .big { font-family: var(--display); font-size: clamp(1.4rem, 2.5vw, 1.9rem); line-height: 1.32; max-width: 28ch; }
.wide-photo { padding: 0 var(--gutter); }
.wide-photo img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; object-position: center 55%; }

/* ---------- Footer ---------- */
.site-foot {
  padding: 3rem var(--gutter) 2.5rem; border-top: 1px solid var(--paper-faint);
  display: flex; flex-wrap: wrap; gap: 1rem 3rem; justify-content: space-between; align-items: baseline;
  color: var(--paper-dim); font-size: .95rem;
}
.site-foot .mark { font-family: var(--display); font-size: 1.5rem; color: var(--paper); }
.site-foot address { font-style: normal; display: flex; flex-wrap: wrap; gap: .25rem 2rem; }
.listen-btn { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; font-size: 1.05rem; padding: 1rem 1.75rem; }
.listen-btn svg { width: 14px; height: 14px; }
.listen-btn:hover { color: var(--ink); }

/* Full-recording card, links to Spotify */
.track {
  position: relative; display: block; max-width: 46rem; aspect-ratio: 16 / 10;
  overflow: hidden; color: var(--paper); text-decoration: none; border-radius: 4px;
  background: var(--canopy-deep);
}
.track-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; transition: transform .8s ease; }
.track:hover .track-art { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .track-art { transition: none; } .track:hover .track-art { transform: none; } }
.track-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,14,11,.65) 0%, rgba(10,14,11,0) 35%, rgba(10,14,11,0) 55%, rgba(10,14,11,.75) 100%); }
.track-head { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 1rem; padding: clamp(1rem, 3vw, 1.5rem); }
.track-play {
  flex: none; width: 3.5rem; height: 3.5rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--thread); color: var(--ink);
}
.track-play svg { width: 18px; height: 18px; margin-left: 3px; }
.track:hover .track-play { background: var(--paper); }
.track-meta { display: flex; flex-direction: column; line-height: 1.25; }
.track-by { font-size: .9rem; color: var(--paper-dim); }
.track-title { font-family: var(--display); font-size: 1.6rem; }
.track-where { margin-left: auto; font-size: .9rem; color: var(--paper-dim); align-self: flex-start; padding-top: .3rem; }
.track-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 1rem; padding: clamp(1rem, 3vw, 1.5rem); }
.wave { flex: 1; height: clamp(36px, 7vw, 56px); fill: rgba(237,232,220,.82); }
.track:hover .wave { fill: var(--thread); }
.track-time { font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--paper); background: rgba(10,14,11,.55); padding: .15rem .45rem; border-radius: 3px; }
@media (max-width: 520px) {
  .track { aspect-ratio: 4 / 5; }
  .track-play { width: 3rem; height: 3rem; }
  .track-title { font-size: 1.35rem; }
}
