/* ==========================================================================
   TBC Post-Event Resource Hub
   Warm ink, ember accents, quiet archive density.
   ========================================================================== */

:root {
  color-scheme: dark;

  --ink-950: #0c0906;
  --ink-900: #100c08;
  --ink-850: #15100a;
  --ink-800: #1b150d;
  --ink-750: #221a11;
  --ink-700: #2c2317;

  --ember-700: #b5471f;
  --ember-600: #d35a22;
  --ember-500: #e8772e;
  --ember-400: #f2a24a;
  --ember-300: #fbc56a;
  --ember-200: #ffdb95;
  --ember-soft: rgba(232, 119, 46, 0.13);
  --ember-line: rgba(242, 162, 74, 0.38);

  --paper: #f7f1e8;
  --paper-dim: #cbc0b0;
  --paper-faint: #9b9384;

  --teal: #66bcae;
  --teal-soft: rgba(102, 188, 174, 0.14);
  --teal-line: rgba(102, 188, 174, 0.42);

  --line: rgba(247, 241, 232, 0.09);
  --line-strong: rgba(247, 241, 232, 0.16);

  --shadow-soft: 0 18px 50px -28px rgba(0, 0, 0, 0.85);
  --shadow-card: 0 16px 34px -24px rgba(0, 0, 0, 0.75);

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 36px;
  --s-7: 56px;
  --s-8: 84px;

  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SF Mono", monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-1: 160ms;
  --dur-2: 280ms;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--ink-900);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--paper);
  background: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

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

a {
  color: inherit;
}

svg {
  display: block;
}

:where(a, button, summary):focus-visible {
  outline: 2px solid var(--ember-300);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.dawn {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 50% -20%, rgba(232, 119, 46, 0.17), transparent 58%),
    radial-gradient(95% 70% at 90% 0%, rgba(102, 188, 174, 0.07), transparent 60%),
    linear-gradient(180deg, rgba(255, 219, 149, 0.035), transparent 36%);
}

.grain {
  position: absolute;
  inset: -50%;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-7);
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-1) var(--s-1) 0;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--paper);
}

.event-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper-faint);
  text-align: right;
}

.hero {
  display: grid;
  gap: var(--s-6);
  align-items: end;
  padding-top: var(--s-5);
}

.hero-copy {
  display: grid;
  gap: var(--s-4);
}

.hero h1 {
  margin: 0;
  max-width: 9ch;
  font-family: var(--font-display);
  font-weight: 760;
  font-size: 3.35rem;
  line-height: 0.94;
  letter-spacing: 0;
  color: var(--paper);
  text-wrap: balance;
}

.hero-intro {
  margin: 0;
  max-width: 42ch;
  color: var(--paper-dim);
  font-size: 1.08rem;
  line-height: 1.48;
}

.hero-note {
  margin: 0;
  max-width: 48ch;
  color: var(--paper-faint);
  font-size: 0.94rem;
  line-height: 1.55;
}

.event-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.event-chips span {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 36px;
  padding: 0 var(--s-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: rgba(247, 241, 232, 0.03);
  color: var(--paper-dim);
  font-size: 0.84rem;
  font-weight: 600;
}

.event-chips svg {
  width: 15px;
  height: 15px;
  color: var(--ember-400);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding-top: var(--s-1);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 var(--s-5);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.94rem;
  transition:
    border-color var(--dur-1) var(--ease-out),
    background var(--dur-1) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  background: var(--ember-400);
  color: #25160a;
  border-color: var(--ember-300);
}

.button--secondary {
  color: var(--ember-200);
  border-color: var(--ember-line);
  background: var(--ember-soft);
}

.button--teal {
  justify-self: start;
  margin-top: var(--s-2);
  color: var(--teal);
  border-color: var(--teal-line);
  background: rgba(102, 188, 174, 0.09);
}

.resource-stack {
  position: relative;
  min-height: 245px;
  display: none;
}

.stack-card {
  position: absolute;
  right: 0;
  width: min(320px, 100%);
  display: grid;
  gap: var(--s-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background:
    linear-gradient(135deg, rgba(247, 241, 232, 0.08), rgba(247, 241, 232, 0.02)),
    var(--ink-850);
  box-shadow: var(--shadow-card);
  padding: var(--s-5);
}

.stack-card strong {
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.05;
}

.stack-card small {
  color: var(--paper-faint);
  font-size: 0.9rem;
}

.stack-card--top {
  top: 0;
  z-index: 3;
}

.stack-card--middle {
  top: 74px;
  right: 34px;
  z-index: 2;
}

.stack-card--bottom {
  top: 148px;
  right: 68px;
  z-index: 1;
}

.file-type {
  justify-self: start;
  margin-bottom: var(--s-2);
  padding: 5px 9px;
  border-radius: var(--r-xs);
  border: 1px solid var(--ember-line);
  color: var(--ember-200);
  background: var(--ember-soft);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.section-nav {
  position: sticky;
  top: 12px;
  z-index: 4;
  display: flex;
  gap: var(--s-2);
  padding: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(21, 16, 10, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
  scrollbar-width: none;
}

.section-nav::-webkit-scrollbar {
  display: none;
}

.section-nav a {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--s-4);
  border-radius: var(--r-pill);
  color: var(--paper-dim);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.section-nav a:hover {
  background: rgba(247, 241, 232, 0.04);
  color: var(--paper);
}

.intro-band {
  display: grid;
  gap: var(--s-5);
  padding: var(--s-6) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.intro-band h2,
.section-head h2,
.next-steps h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 660;
  font-size: 2rem;
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
}

.intro-band p,
.section-head p,
.next-steps p {
  margin: 0;
  color: var(--paper-dim);
  font-size: 1rem;
  line-height: 1.58;
}

.section-label {
  margin: 0 0 var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ember-400);
}

.section-label--teal {
  color: var(--teal);
}

.content-section {
  display: grid;
  gap: var(--s-5);
  scroll-margin-top: 96px;
}

.section-head {
  display: grid;
  gap: var(--s-2);
  max-width: 700px;
}

.resource-list {
  display: grid;
  gap: var(--s-2);
}

.resource-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  min-height: 72px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(247, 241, 232, 0.025);
  color: var(--paper);
  text-decoration: none;
  transition:
    border-color var(--dur-1) var(--ease-out),
    background var(--dur-1) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
}

a.resource-row:hover {
  border-color: var(--ember-line);
  background: rgba(232, 119, 46, 0.07);
}

a.resource-row:active {
  transform: translateY(1px);
}

.resource-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ember-line);
  border-radius: var(--r-xs);
  background: var(--ember-soft);
  color: var(--ember-200);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
}

.resource-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.resource-main strong {
  overflow-wrap: anywhere;
  font-weight: 700;
  line-height: 1.25;
}

.resource-main small,
.resource-action {
  color: var(--paper-faint);
  font-size: 0.86rem;
}

.resource-action {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.resource-row--pending {
  border-style: dashed;
  color: var(--paper-dim);
}

.resource-row--pending .resource-icon {
  border-color: var(--line-strong);
  background: rgba(247, 241, 232, 0.03);
  color: var(--paper-faint);
}

.archive-days {
  display: grid;
  gap: var(--s-3);
}

.archive-day {
  border-top: 1px solid var(--line);
}

.archive-day:last-child {
  border-bottom: 1px solid var(--line);
}

.archive-day > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: 66px;
  cursor: pointer;
  list-style: none;
  padding: var(--s-4) 0;
}

.archive-day > summary::-webkit-details-marker {
  display: none;
}

.archive-day > summary span {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 660;
}

.archive-day > summary small {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

.session-list {
  display: grid;
  gap: var(--s-4);
  padding-bottom: var(--s-5);
}

.session-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: var(--s-4);
  position: relative;
}

.session-row time {
  color: var(--ember-400);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding-top: 4px;
}

.session-row h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.18;
  font-weight: 640;
}

.session-row p {
  margin: var(--s-1) 0 0;
  color: var(--paper-dim);
  font-size: 0.93rem;
  line-height: 1.45;
}

.session-row a,
.pending-label {
  display: inline-flex;
  margin-top: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ember-300);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.session-row a:hover {
  color: var(--ember-200);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pending-label {
  color: var(--paper-faint);
}

.next-steps {
  scroll-margin-top: 96px;
  display: grid;
  gap: var(--s-4);
  align-items: start;
  border-top: 1px solid var(--teal-line);
  border-bottom: 1px solid var(--teal-line);
  background:
    radial-gradient(70% 120% at 100% 0%, rgba(102, 188, 174, 0.12), transparent 62%),
    linear-gradient(90deg, rgba(102, 188, 174, 0.08), rgba(102, 188, 174, 0.025) 62%, transparent);
  padding: var(--s-5);
}

.next-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--teal-line);
  background: rgba(102, 188, 174, 0.08);
  color: var(--teal);
}

.next-mark svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.next-copy {
  display: grid;
  gap: var(--s-3);
}

.next-copy .section-label {
  margin: 0;
}

.next-copy .button {
  margin-top: var(--s-1);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-6) 0 0;
  border-top: 1px solid var(--line);
  color: var(--paper-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (min-width: 760px) {
  body {
    padding-left: 28px;
    padding-right: 28px;
  }

  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.7fr);
    gap: var(--s-7);
    min-height: 440px;
    padding-top: var(--s-6);
  }

  .hero h1 {
    font-size: 5.2rem;
  }

  .hero-intro {
    font-size: 1.22rem;
  }

  .resource-stack {
    display: block;
  }

  .intro-band {
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
    align-items: center;
  }

  .next-steps {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: var(--s-6);
    padding: var(--s-6);
  }

  .next-copy {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--s-6);
    align-items: center;
  }

  .next-copy .section-label {
    grid-column: 1 / -1;
  }

  .next-copy h2,
  .next-copy p {
    grid-column: 1;
  }

  .next-copy p {
    max-width: 58ch;
  }

  .next-copy .button {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: center;
    justify-self: end;
    min-width: 230px;
    margin-top: 0;
    white-space: nowrap;
  }

  .intro-band h2,
  .section-head h2,
  .next-steps h2 {
    font-size: 2.5rem;
  }

  .next-mark {
    width: 64px;
    height: 64px;
  }
}

@media (max-width: 520px) {
  body {
    padding-left: 14px;
    padding-right: 14px;
  }

  #app {
    gap: var(--s-6);
  }

  .topbar {
    align-items: flex-start;
  }

  .event-tag {
    max-width: 18ch;
    line-height: 1.35;
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .hero-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .section-nav {
    margin-left: -4px;
    margin-right: -4px;
    border-radius: var(--r-md);
  }

  .intro-band h2,
  .section-head h2,
  .next-steps h2 {
    font-size: 1.75rem;
  }

  .resource-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .resource-action {
    grid-column: 2;
    justify-self: start;
  }

  .session-row {
    grid-template-columns: 1fr;
    gap: var(--s-1);
  }

  .session-row time {
    padding-top: 0;
  }

  .footer {
    flex-direction: column;
  }
}
