/* Musify — colour chapters.
   One flat field per chapter, one ink per field, the ochre from the app icon as
   the only accent. No gradients, no shadows at rest, no rules: the change of
   field does the separating. */

:root {
  --forest: #0B2E1F;
  --green: #2E6B4F;
  --paper: #FAF7F0;
  --sand: #EFE6D4;
  --ink: #1C1B17;
  --ochre: #E8B36A;
  --mint: #8FD0AB;

  --step-display: clamp(3.25rem, 15vw, 14.375rem);
  --step-head: clamp(2.5rem, 6vw, 5.375rem);
  --step-sub: clamp(1.75rem, 3vw, 2.75rem);
  --step-lead: clamp(1.25rem, 1.8vw, 1.625rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);

  --pad: clamp(16px, 2.8vw, 40px);
  --gap: clamp(16px, 1.6vw, 24px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--forest);
  color: var(--paper);
  font-family: "Epilogue", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p { margin: 0; }
ul, ol, figure { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.04em; line-height: 0.95; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--ochre);
  color: var(--forest);
  padding: 12px 20px;
  font-weight: 500;
}
.skip:focus { left: 12px; top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.chapter {
  min-height: 90svh;
  padding: clamp(56px, 7vw, 96px) var(--pad);
  display: flex;
  flex-direction: column;
}

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  background: var(--ochre);
  color: var(--forest);
  font-size: var(--step-body);
  font-weight: 500;
  text-decoration: none;
  border: 0;
  border-radius: 0;
  transition: background-color 160ms ease, transform 160ms ease;
}
.button:hover { background: #f2c584; }
.button:active { transform: translateY(1px); }

.quiet-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.quiet-link:hover { text-decoration-thickness: 2px; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  padding-top: clamp(20px, 2.5vw, 32px);
  padding-bottom: clamp(24px, 3vw, 40px);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: var(--step-body);
  text-decoration: none;
  color: var(--paper);
}

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 32px);
  font-size: var(--step-small);
}
.topnav a { text-decoration: none; }
.topnav a:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero-body { margin-top: auto; margin-bottom: auto; }

.hero-title {
  font-size: var(--step-display);
  line-height: 0.82;
  letter-spacing: -0.045em;
}
.hero-title .mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.04em;
}
.hero-title .line { display: block; }
.line-1 { color: var(--paper); }
.line-2 { color: var(--ochre); }

.js .hero-title .line {
  transform: translateY(112%);
  animation: line-rise 940ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.js .hero-title .line-2 { animation-delay: 110ms; }

@keyframes line-rise {
  to { transform: translateY(0); }
}

.hero-line {
  font-size: var(--step-lead);
  line-height: 1.4;
  max-width: 40ch;
  margin-top: clamp(24px, 4vh, 40px);
}

.js .hero-line,
.js .hero-actions {
  opacity: 0;
  transform: translateY(16px);
  animation: settle 700ms cubic-bezier(0.16, 1, 0.3, 1) 520ms forwards;
}
.js .hero-actions { animation-delay: 620ms; }

@keyframes settle {
  to { opacity: 1; transform: translateY(0); }
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  align-self: flex-end;
  font-size: var(--step-small);
}

/* ---------- chapter 2, features ---------- */

.features {
  background: var(--paper);
  color: var(--ink);
}

.features-title {
  font-size: var(--step-head);
  line-height: 0.92;
  max-width: 18ch;
  margin-bottom: clamp(56px, 9vh, 120px);
}

.feature-rows { display: grid; gap: clamp(64px, 9vh, 118px); }

.feature-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.feature-copy { grid-column: 5 / 10; }
.feature-copy h3 {
  font-size: var(--step-sub);
  line-height: 1.02;
  margin-bottom: 17px;
  max-width: 20ch;
}
.feature-copy p {
  max-width: 36ch;
  color: #3B382F;
}

.feature-photo,
.fragment {
  grid-column: 10 / 13;
  justify-self: end;
  align-self: start;
}

.feature-photo { width: min(100%, 300px); }
.feature-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 62%;
}

/* The app's own screens, drawn as interface fragments (dark scheme). */

.fragment[data-ui] {
  background: #0F3323;
  color: var(--paper);
  border-radius: 18px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.3;
}

.fragment-tabs { width: min(100%, 268px); }

.ui-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.ui-tab {
  padding: 7px 12px;
  border-radius: 100px;
  background: #17402D;
  color: #C9D9CE;
  white-space: nowrap;
}
.ui-tab-on { background: var(--mint); color: #0B2E1F; font-weight: 500; }

.ui-chips { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.ui-chip {
  padding: 6px 11px;
  border-radius: 100px;
  border: 1px solid #3A6450;
  color: #D6E4DA;
}
.ui-chip-on { background: #CDE9D8; color: #0B2E1F; border-color: transparent; font-weight: 500; }

.ui-rows { display: grid; gap: 2px; }
.ui-rows li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 12px;
}
.ui-art {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #2E6B4F;
  color: #EAF5EE;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 14px;
}
.ui-text { display: flex; flex-direction: column; min-width: 0; }
.ui-text b {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ui-text small { color: #A9C3B3; font-size: 12px; }

.fragment-player { width: min(100%, 320px); padding: 12px 14px 14px; }
.fragment-manifest { width: min(100%, 268px); }

.ui-sheet-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 10px;
}
.ui-sheet-title span { font-weight: 400; font-size: 12px; color: #A9C3B3; }

.ui-progress {
  height: 3px;
  border-radius: 100px;
  background: #2A5440;
  overflow: hidden;
  margin-bottom: 10px;
}
.ui-progress span { display: block; height: 100%; background: var(--ochre); }

.ui-player-row { display: flex; align-items: center; gap: 10px; }
.ui-transport {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #DCEBE1;
}
.ui-transport svg { width: 22px; height: 22px; }
.ui-play { color: var(--mint); }

.fragment-manifest {
  background: var(--forest);
  padding: 16px 18px;
}
.fragment-manifest pre {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--mint);
  white-space: pre-wrap;
}

/* ---------- chapter 3, split ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  min-height: 92svh;
}

.split-pane {
  padding: clamp(40px, 5vw, 88px) clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-rows: 1fr auto;
  row-gap: clamp(32px, 5vh, 56px);
  align-content: stretch;
}

.split-in {
  background: var(--forest);
  color: var(--paper);
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  column-gap: clamp(20px, 3vw, 48px);
}
.split-in .split-title { grid-column: 1 / -1; }
.split-out { background: var(--sand); color: var(--ink); }

.split-title {
  font-size: var(--step-head);
  line-height: 0.95;
  letter-spacing: -0.04em;
  grid-row: 2;
}
.split-title-out { color: var(--forest); }

.classifier {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 34ch;
  align-self: start;
}
.classifier label {
  font-size: var(--step-small);
  color: #BFD3C6;
}
.classifier input {
  width: 100%;
  min-height: 60px;
  padding: 0 16px;
  background: #12372A;
  color: var(--paper);
  border: 0;
  border-radius: 0;
  font-family: inherit;
  font-size: var(--step-lead);
}
.classifier input:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }

.classifier-note {
  font-size: var(--step-small);
  line-height: 1.55;
  color: #A9C3B3;
  max-width: 42ch;
}

.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.examples button {
  font: inherit;
  font-size: var(--step-small);
  color: #DCEBE1;
  background: #12372A;
  border: 0;
  padding: 10px 14px;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}
.examples button:hover { background: #1E4D36; color: var(--paper); }

.split-photo {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  min-height: 200px;
}
.split-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 45%;
}

.split-stack {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vh, 40px);
  align-self: start;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 26ch;
}
.result-kind {
  font-size: var(--step-head);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.9;
  color: var(--green);
}
.result-why {
  font-size: var(--step-body);
  color: #3B382F;
  max-width: 34ch;
}
.result[data-tone="tone"] .result-kind { color: #8A6A3B; }

.fragment-library { width: min(100%, 340px); font-size: 13px; }

.split-out .fragment[data-ui] {
  background: #FFFDF7;
  color: var(--ink);
}
.split-out .ui-art { background: var(--green); color: #EAF5EE; }
.split-out .ui-text small { color: #6B6455; }
.split-out .ui-sheet-title span { color: #6B6455; }

/* ---------- chapter 4, contact ---------- */

.contact {
  background: var(--sand);
  color: var(--forest);
  min-height: 84svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.8fr);
  gap: clamp(32px, 5vw, 88px);
  align-content: center;
  align-items: center;
}

.contact-copy {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vh, 44px);
  max-width: 46rem;
}

.contact-mark {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: -8px;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-8px) rotate(2deg); }
}

.contact-title {
  font-size: var(--step-head);
  line-height: 0.9;
  color: var(--forest);
}

.contact-list { display: grid; gap: clamp(24px, 3.4vh, 38px); }
.contact-list li { display: flex; flex-direction: column; gap: 10px; }

.contact-link {
  font-size: var(--step-sub);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-decoration: none;
  color: var(--green);
  border-bottom: 2px solid transparent;
  align-self: flex-start;
  transition: border-color 160ms ease, color 160ms ease;
}
.contact-link:hover { color: var(--forest); border-bottom-color: var(--forest); }

.contact-list p { font-size: var(--step-body); color: #3B382F; max-width: 40ch; }
.contact-foot { font-size: var(--step-small); color: #5A5344; max-width: 44ch; }

.contact-photo { align-self: stretch; }
.contact-photo img {
  width: 100%;
  height: 100%;
  max-height: 78svh;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 42% 50%;
}

/* ---------- footer ---------- */

.footer {
  background: var(--forest);
  color: var(--paper);
  min-height: 68svh;
  justify-content: space-between;
  gap: clamp(32px, 6vh, 64px);
}

.footer-mark { display: flex; align-items: center; gap: 18px; }
.footer-mark img { width: 56px; height: 56px; border-radius: 14px; }
.footer-mark p {
  font-size: var(--step-display);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.78;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.footer-write {
  grid-column: 1 / 8;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-write a {
  font-size: var(--step-lead);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--mint);
}
.footer-write a:hover { text-decoration: underline; text-underline-offset: 6px; }

.footer-links {
  grid-column: 9 / 13;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--step-small);
}
.footer-links a { text-decoration: none; color: #C4D6CA; }
.footer-links a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }

.footer-legal {
  font-size: var(--step-small);
  color: #9DB4A4;
  max-width: 88ch;
  line-height: 1.6;
}
.footer-legal a { color: #C4D6CA; }

/* ---------- entrance, only when JS is on ---------- */

.js .rise {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 620ms cubic-bezier(0.16, 1, 0.3, 1), transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
}
.js .rise.is-in { opacity: 1; transform: none; }

/* ---------- phone ---------- */

@media (max-width: 860px) {
  .chapter { min-height: 0; padding-top: 56px; padding-bottom: 64px; }

  .hero { min-height: 100svh; padding-top: 18px; padding-bottom: 22px; justify-content: space-between; }
  .hero-body { margin-top: 8vh; margin-bottom: 0; }
  .hero-line { font-size: var(--step-body); max-width: 34ch; }
  .hero-actions { align-self: flex-start; gap: 18px; margin-top: 0; }

  .topnav { font-size: 13px; gap: 14px; }
  .topnav a:nth-child(2) { display: none; }

  .features-title { font-size: 2.5rem; margin-bottom: 40px; }
  .feature-row { grid-template-columns: 1fr; gap: 20px; }
  .feature-copy { grid-column: auto; }
  .feature-copy h3 { font-size: 1.75rem; }
  .fragment, .feature-photo { grid-column: auto; justify-self: start; }
  .fragment-tabs { width: 100%; max-width: none; }
  .feature-photo { width: 82%; justify-self: end; }
  .fragment-player { width: 92%; }
  .fragment-manifest { width: 68%; justify-self: end; }

  .split { grid-template-columns: 1fr; min-height: 0; }
  .split-pane {
    display: flex;
    flex-direction: column;
    padding: 44px 20px 52px;
    gap: 26px;
  }
  .split-title { order: -1; font-size: 2.25rem; }
  .classifier { max-width: none; }
  .split-photo { order: 1; min-height: 0; }
  .split-photo img { height: 180px; }
  .contact-copy { max-width: none; }
  .result { padding-top: 0; }
  .result-kind { font-size: 2.5rem; }
  .fragment-library { width: 100%; max-width: none; }

  .contact {
    grid-template-columns: 1fr;
    gap: 36px;
    align-content: start;
    min-height: 0;
  }
  .contact-title { font-size: 2.5rem; }
  .contact-link { font-size: 1.5rem; }
  .contact-photo img { aspect-ratio: 4 / 3; max-height: none; }

  .footer { gap: 32px; }
  .footer-mark { flex-wrap: wrap; gap: 12px; }
  .footer-mark p { font-size: 15vw; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-write, .footer-links { grid-column: auto; }
  .footer-links { flex-direction: row; flex-wrap: wrap; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .hero-title .line,
  .js .hero-line,
  .js .hero-actions {
    transform: none;
    opacity: 1;
    animation: none;
  }
  .js .rise { opacity: 1; transform: none; transition: none; }
  .contact-mark { animation: none; }
  .button, .contact-link, .examples button { transition: none; }
}
