:root {
  --paper: #f3efe4;
  --paper-deep: #e9e2d2;
  --ink: #151a24;
  --ink-soft: #4f5360;
  --orange: #f06435;
  --orange-dark: #d94c20;
  --acid: #d9f75f;
  --blue: #1f4fff;
  --green: #1ed760;
  --line: rgba(21, 26, 36, 0.18);
  --shadow: 0 24px 80px rgba(47, 41, 27, 0.13);
  --radius: 24px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 3%, rgba(240, 100, 53, 0.18), transparent 25rem),
    radial-gradient(circle at 88% 32%, rgba(31, 79, 255, 0.1), transparent 24rem),
    var(--paper);
}

button, input, select { font: inherit; }
button { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  z-index: 10;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.brand-mark { width: 36px; height: 36px; }
.brand-mark circle { fill: var(--orange); }
.brand-mark path { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 3 4; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-meta[hidden] { display: none; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(240, 100, 53, 0.14);
}

.status-dot.ready { background: #27955a; box-shadow: 0 0 0 4px rgba(39, 149, 90, 0.13); }
.status-dot.demo { background: #d69a16; box-shadow: 0 0 0 4px rgba(214, 154, 22, 0.14); }

.hero {
  min-height: 520px;
  padding: 88px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 64px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 860px;
  margin-bottom: 28px;
  font-size: clamp(3.7rem, 8.2vw, 7.4rem);
  line-height: 0.86;
  letter-spacing: -0.075em;
  font-weight: 850;
}

h1 em {
  display: block;
  color: var(--orange);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.hero-description {
  max-width: 570px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.55;
}

.spinning-stamp {
  justify-self: end;
  width: 200px;
  aspect-ratio: 1;
  color: var(--blue);
  transform: rotate(10deg);
}

.spinning-stamp svg { overflow: visible; animation: drift 10s ease-in-out infinite; }
.spinning-stamp text { fill: currentColor; font-size: 9px; font-weight: 800; letter-spacing: 1.5px; }
.stamp-wave { fill: none; stroke: var(--orange); stroke-width: 5; stroke-linecap: round; }

@keyframes drift { 50% { transform: rotate(8deg) scale(1.02); } }

.trip-builder {
  position: relative;
  padding: 48px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.62);
  box-shadow: var(--shadow);
}

.trip-builder::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(21, 26, 36, 0.24);
  border-radius: 17px;
  pointer-events: none;
}

.builder-heading {
  position: relative;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 38px;
}

.builder-heading h2,
.loading-state h2,
.error-state h2,
.playlist-intro h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.step-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--acid);
  border: 1px solid var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
}

.trip-form {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.field { display: grid; gap: 9px; }
.field-wide { grid-column: 1 / -1; }

.field > span {
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

input, select {
  width: 100%;
  min-height: 62px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input { font-size: 1.18rem; font-weight: 700; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 28px, calc(100% - 15px) 28px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 79, 255, 0.1); background-color: #fff; }

.form-actions,
.playlist-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.button {
  min-height: 58px;
  padding: 0 23px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 rgba(21, 26, 36, 0.12); }
.button:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.button:disabled { opacity: 0.46; cursor: not-allowed; }
.button svg, .icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { min-width: 230px; color: #fff; background: var(--ink); }
.button-primary:hover { background: var(--blue); }
.button-secondary { background: transparent; }
.button-secondary:hover { background: var(--acid); }

.loading-state,
.error-state {
  min-height: 440px;
  margin: 70px 0;
  padding: 80px 24px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.loading-state[hidden], .error-state[hidden], .playlist-section[hidden] { display: none; }
.loading-state h2, .error-state h2 { margin-bottom: 14px; }
.loading-state > p:last-child, .error-state > p { color: var(--ink-soft); }

.loading-route { display: flex; align-items: center; width: min(280px, 70vw); margin-bottom: 36px; }
.loading-route span { width: 14px; height: 14px; flex: 0 0 auto; border: 3px solid var(--orange); border-radius: 50%; background: var(--paper); }
.loading-route i { position: relative; height: 2px; flex: 1; overflow: hidden; background: repeating-linear-gradient(90deg, var(--ink) 0 7px, transparent 7px 12px); }
.loading-route i::after { content: ""; position: absolute; width: 55px; height: 4px; top: -1px; left: -60px; background: var(--acid); animation: travel 1.4s linear infinite; }
@keyframes travel { to { left: 100%; } }

.text-button { padding: 8px 0; border: 0; border-bottom: 1px solid; background: transparent; font-weight: 800; cursor: pointer; }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; margin-top: 10px; }
.text-button-muted { color: var(--ink-soft); font-weight: 650; }

.playlist-section { padding: 100px 0 20px; }

.playlist-intro {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: start;
  margin-bottom: 40px;
}

.playlist-intro h2 { max-width: 850px; margin-bottom: 20px; }
.playlist-intro > div > p:last-child { max-width: 750px; margin-bottom: 0; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.65; }

.passport-code {
  min-width: 126px;
  padding: 15px;
  border: 2px solid var(--orange);
  color: var(--orange-dark);
  background: transparent;
  transform: rotate(3deg);
  text-align: center;
}
.passport-code span { display: block; font-size: 0.61rem; font-weight: 850; letter-spacing: 0.1em; }
.passport-code strong { display: block; margin-top: 5px; font-size: 1.65rem; letter-spacing: 0.08em; }

.playlist-card {
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.72);
  box-shadow: var(--shadow);
}

.playlist-toolbar {
  min-height: 76px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.playlist-toolbar p { margin: 0; }
.playlist-toolbar span { color: var(--ink-soft); }

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { background: var(--acid); border-color: var(--ink); }

.track-list { margin: 0; padding: 0; list-style: none; counter-reset: tracks; }
.track {
  counter-increment: tracks;
  min-height: 94px;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: 36px 56px minmax(0, 1fr) minmax(180px, 0.7fr) auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  transition: background 150ms ease;
}
.track:last-child { border-bottom: 0; }
.track:hover { background: rgba(217, 247, 95, 0.22); }
.track::before { content: counter(tracks, decimal-leading-zero); color: var(--ink-soft); font-size: 0.75rem; font-weight: 850; }
.track-cover { width: 56px; height: 56px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: var(--paper-deep); color: var(--orange); font-size: 1.4rem; font-weight: 800; }
.track-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-info { min-width: 0; }
.track-info strong, .track-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-info strong { font-size: 1rem; }
.track-info span { margin-top: 4px; color: var(--ink-soft); font-size: 0.86rem; }
.track-reason { margin: 0; color: var(--ink-soft); font-family: Georgia, "Times New Roman", serif; font-size: 0.94rem; line-height: 1.4; }
.track-links { display: flex; align-items: center; gap: 7px; }
.track-link {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #07150c;
  border-radius: 999px;
  color: #07150c;
  background: var(--green);
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.track-link:hover { transform: translateY(-1px); box-shadow: 0 5px 0 rgba(7, 21, 12, 0.2); }
.track-link:focus-visible { outline: 3px solid var(--acid); outline-offset: 2px; }
.track-link svg { width: 17px; height: 17px; flex: 0 0 17px; fill: currentColor; stroke: none; }
.track-link-youtube { color: #fff; background: #ff0033; }
.track-link-youtube svg { width: 20px; height: 20px; flex-basis: 20px; }

.playlist-actions { justify-content: center; padding: 34px 0 24px; }
.button-spotify { color: #07150c; background: var(--green); border-color: #07150c; }
.button-spotify svg { width: 21px; height: 21px; flex: 0 0 21px; display: block; fill: currentColor; stroke: none; }
.spotify-reminder { margin: 12px 0 0; color: var(--ink-soft); font-size: 0.82rem; }
.button-ghost { background: transparent; }

footer {
  min-height: 160px;
  margin-top: 100px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78rem;
}
footer p { margin: 0; }
.footer-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.footer-disclaimer {
  max-width: 760px;
  margin-top: 24px;
  line-height: 1.5;
  font-size: 0.7rem;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 28px;
  max-width: calc(100% - 32px);
  padding: 13px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 12px 35px rgba(21, 26, 36, 0.24);
  font-size: 0.88rem;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 72px; }
  .header-meta { max-width: 130px; text-align: right; font-size: 0.62rem; }
  .hero { min-height: auto; padding: 70px 0 52px; grid-template-columns: 1fr; gap: 30px; }
  h1 { font-size: clamp(3.2rem, 17vw, 5.3rem); }
  .spinning-stamp { display: none; }
  .trip-builder { padding: 30px 20px; }
  .trip-form { grid-template-columns: 1fr; }
  .field-wide { grid-column: 1; }
  .form-actions, .playlist-actions { flex-direction: column; }
  .button { width: 100%; }
  .playlist-section { padding-top: 72px; }
  .playlist-intro { grid-template-columns: 1fr; }
  .passport-code { justify-self: start; }
  .track {
    min-height: 0;
    padding: 14px;
    grid-template-columns: 28px 48px minmax(0, 1fr) auto;
    grid-template-areas:
      "number cover info links"
      ". reason reason reason";
    column-gap: 10px;
    row-gap: 9px;
  }
  .track::before { grid-area: number; }
  .track-cover { grid-area: cover; width: 48px; height: 48px; }
  .track-info { grid-area: info; }
  .track-reason { grid-area: reason; display: block; padding: 2px 0 4px; font-size: 0.9rem; }
  .track-links { grid-area: links; gap: 5px; }
  .track-link { width: 34px; height: 34px; }
  footer { min-height: 130px; margin-top: 70px; }
  .footer-main { align-items: flex-start; flex-direction: column; gap: 12px; }
  .footer-disclaimer { margin-top: 20px; }
}

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