/* Fonts are stored with the site (assets/fonts), both under the SIL Open Font License */
@font-face { font-family: "Caesar Dressing"; src: url("fonts/caesar-dressing-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
:root {
  /* Palette "Piedra y brasa": stone grey with a single ember-red accent */
  --ink: #262321;      /* page background */
  --stone: #2b2826;    /* alternate section background */
  --stone-2: #322e2b;  /* cards */
  --line: #4a443f;     /* borders */
  --bronze: #f0704f;   /* accent lines and borders */
  --gold: #efe9df;     /* titles */
  --ember: #f0704f;    /* accent */
  --text: #efe9df;
  --muted: #b3a99c;
  --rune: "Caesar Dressing", "Trebuchet MS", sans-serif;   /* rune-style titles */
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font-family: "EB Garamond", Georgia, serif; font-size: 1.2rem; line-height: 1.65;
}
body.intro-active { overflow: hidden; }
.skip-intro body.intro-active { overflow: auto; }   /* intro already seen in this visit */
.skip-intro #intro { display: none; }

/* ---------- INTRO ---------- */
#intro {
  position: fixed; inset: 0; z-index: 50; background: #000;
  overflow: hidden;
}
/* The stage has the exact proportions of the animation (1936x1040).
   At scale 1 it covers the screen; while idle it is scaled down so the
   whole logo is visible in the centre. */
#stage {
  position: absolute; left: 50%; top: 50%;
  width: min(max(100vw, 186.154vh), 166vw);
  aspect-ratio: 1936 / 1040;
  transform: translate(-50%, -50%) scale(var(--idle-scale, .8));
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
  will-change: transform;
}
#intro.playing #stage { transform: translate(-50%, -50%) scale(1); }
#stage video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; background: #000;
}
@media (max-aspect-ratio: 9/10) { /* phones held upright: soften the top and bottom edges of the video */
  #stage video { -webkit-mask-image: linear-gradient(#0000, #000 14%, #000 86%, #0000); mask-image: linear-gradient(#0000, #000 14%, #000 86%, #0000); }
}
/* Logo image, placed exactly over the logo in the first frame of the video */
#logo {
  position: absolute; left: -0.723%; top: -1.308%; width: 99.967%;
  aspect-ratio: 1792 / 1008;
  background: #000 url("tas-logo.jpg") center / 100% 100% no-repeat;
  transition: opacity .55s ease;
}
#intro.playing #logo { opacity: 0; pointer-events: none; }
/* Invisible hot spot over the gem */
#gem {
  position: absolute; left: 51.7%; top: 43.9%; width: 11.6%; aspect-ratio: 1;
  border-radius: 50%; border: 0; padding: 0; background: transparent; cursor: default;
  -webkit-tap-highlight-color: transparent;
}
#gem::after { /* soft breathing glow on the gem */
  content: ""; position: absolute; inset: -18%; border-radius: 50%;
  background: radial-gradient(circle, rgba(190,220,255,.55), rgba(150,190,255,0) 68%);
  mix-blend-mode: screen; animation: breathe 3.2s ease-in-out infinite;
}
#gem:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
@keyframes breathe { 0%,100% { opacity: .15; transform: scale(.9); } 50% { opacity: .9; transform: scale(1.08); } }
/* Fire flash that bridges the end of the animation and the page */
#flash {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 55%, #fffbe0 0%, #ffe45a 35%, #ff9a1f 75%, #f25a0c 100%);
  transition: opacity .7s ease-in;
}
#intro.ending #flash { opacity: 1; }
/* Sound on/off button, shown while the animation plays */
#sound {
  position: absolute; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
  width: 3rem; height: 3rem; border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer; padding: 0;
  display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .4s ease, background .2s;
}
#intro.playing #sound { opacity: 1; pointer-events: auto; }
#intro.leaving #sound { opacity: 0; pointer-events: none; }
#sound:hover, #sound:focus-visible { background: rgba(0,0,0,.8); border-color: #fff; }
#sound svg { width: 1.4rem; height: 1.4rem; }
#sound .off { display: none; }
#sound[aria-pressed="true"] .on { display: none; }
#sound[aria-pressed="true"] .off { display: block; }
#intro.leaving { background: transparent; transition: opacity 1.4s ease-out; opacity: 0; pointer-events: none; }
#intro.leaving #stage { visibility: hidden; }
#intro.gone { display: none; }

/* ---------- PAGE ---------- */
.wrap { width: min(100% - 2rem, 68rem); margin-inline: auto; }
header.site {
  position: sticky; top: 0; z-index: 10;
  background: rgba(38,35,33,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--gold); text-decoration: none;
  font-family: var(--rune); font-weight: 400; letter-spacing: .08em; font-size: 1.15rem; text-transform: uppercase; }
.brand img { width: 46px; height: 46px; }
nav { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; justify-content: flex-end; }
nav a { color: var(--muted); text-decoration: none; font-family: var(--rune); font-size: .95rem; letter-spacing: .1em; text-transform: uppercase; padding: .3rem 0; }
nav a:hover, nav a:focus-visible { color: var(--gold); }

.right { display: flex; align-items: center; gap: 1.4rem; }
.lang { display: flex; gap: .2rem; flex: none; }
.lang button { font-family: var(--rune); font-size: .9rem; letter-spacing: .08em; color: var(--muted); background: none;
  border: 1px solid transparent; border-radius: 4px; padding: .15rem .5rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4rem; }
.lang .flag { width: 1.8rem; height: 1.2rem; flex: none; border-radius: 2px; }
.lang button[aria-pressed="false"] .flag { opacity: .6; }
.lang button:hover, .lang button:focus-visible { color: var(--gold); }
.lang button[aria-pressed="true"] { color: var(--gold); border-color: var(--bronze); }
@media (max-width: 760px) { header.site .wrap { align-items: flex-start; } .right { flex-direction: column-reverse; align-items: flex-end; gap: .3rem; } }

/* Cover: big emblem on the left, name and tagline centred in the other half */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(240,112,79,.07), transparent 62%); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: clamp(1.5rem, 5vw, 4rem); }
.hero img { width: 100%; max-width: 26rem; height: auto; justify-self: center; filter: drop-shadow(0 14px 30px rgba(0,0,0,.45)); }
.hero-text { text-align: center; }
.hero h1 { font-family: var(--rune); font-weight: 400; letter-spacing: .12em; text-transform: uppercase;
  font-size: clamp(1.7rem, 4.2vw, 3.2rem); line-height: 1.15; margin: 0 0 .8rem; color: var(--gold); text-wrap: balance; }
.hero p { color: var(--muted); font-style: italic; margin: 0 auto; max-width: 30rem; text-wrap: balance; }
@media (max-width: 700px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero img { max-width: min(64vw, 300px); }
}

/* Social network buttons */
.social { display: flex; flex-wrap: wrap; gap: .7rem; padding: 0; margin: 0; list-style: none; }
.social a { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%;
  border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: color .2s, border-color .2s, background .2s; }
.social svg { width: 1.3rem; height: 1.3rem; fill: currentColor; }
.social a[href]:hover, .social a[href]:focus-visible { color: var(--ember); border-color: var(--ember); }
.social a:not([href]) { color: var(--muted); opacity: .55; cursor: default; }   /* network not created yet */
.follow { margin-top: 2.2rem; }
.follow p { font-family: var(--rune); font-size: .9rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 .7rem; }
footer .social { justify-content: center; margin-bottom: 1.2rem; }

section { padding: clamp(2.8rem, 7vw, 5rem) 0; border-top: 1px solid var(--line); scroll-margin-top: 4.5rem; }
section:nth-of-type(even) { background: var(--stone); }
.kicker { font-family: var(--rune); font-size: .9rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ember); margin: 0 0 .5rem; }
h2 { font-family: var(--rune); font-weight: 400; letter-spacing: .06em; text-transform: uppercase;
  font-size: clamp(1.5rem, 3.6vw, 2.2rem); line-height: 1.2; margin: 0 0 1.2rem; color: var(--gold); }
h2::after { content: ""; display: block; width: 4.5rem; height: 2px; margin-top: .8rem;
  background: linear-gradient(90deg, var(--bronze), transparent); }
.prose { max-width: 42rem; }
.prose p { margin: 0 0 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.2rem; margin-top: 1.8rem; }
.card { background: var(--stone-2); border: 1px solid var(--line); border-radius: 6px; padding: 1.4rem 1.4rem 1.2rem; }
.card h3 { font-family: var(--rune); font-weight: 400; font-size: 1.2rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text); margin: 0 0 .5rem; }
.card h3.codename { text-transform: none; }   /* keep the code name exactly as written */
.card p { margin: 0; color: var(--muted); font-size: 1.08rem; }
.tag { display: inline-block; font-family: var(--rune); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--bronze); border-radius: 99px; padding: .1rem .7rem; margin-bottom: .8rem; }
.cta { display: inline-block; margin-top: 1rem; font-family: inherit; font-size: 1.15rem; letter-spacing: .02em; /* email stays in the plain font so the address reads exactly */
  color: #1c1a18; background: var(--ember); padding: .8rem 1.5rem; border-radius: 4px; text-decoration: none; overflow-wrap: anywhere; }
.cta:hover, .cta:focus-visible { filter: brightness(1.1); }
footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); font-size: .95rem; text-align: center; }

@media (max-width: 640px) { .brand span { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #gem::after { animation: none; opacity: .5; }
  #stage, #logo, #flash, #intro.leaving { transition-duration: .01s; }
}

/* ---------- Links and buttons shared by all pages ---------- */
nav a[aria-current="page"] { color: var(--gold); }
.more { display: inline-block; margin-top: 1rem; font-family: var(--rune); font-size: .9rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ember); text-decoration: none; }
.more:hover, .more:focus-visible { text-decoration: underline; }
.btn { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--rune); font-size: 1rem; letter-spacing: .08em; text-transform: uppercase;
  color: #1c1a18; background: var(--ember); padding: .8rem 1.4rem; border-radius: 4px; border: 0; text-decoration: none; cursor: pointer; }
.btn svg { width: 1.3rem; height: 1.3rem; fill: currentColor; }
.btn[href]:hover, .btn[href]:focus-visible { filter: brightness(1.1); }
.btn:not([href]) { background: transparent; color: var(--muted); border: 1px solid var(--line); cursor: default; }

/* ---------- Project page (TRS_Bedtime) ---------- */
.page-hero { text-align: center; padding: clamp(2.8rem, 8vw, 5.5rem) 0 clamp(2.4rem, 6vw, 4rem);
  background: radial-gradient(ellipse at 50% 0%, rgba(240,112,79,.07), transparent 62%); }
.page-hero h1 { font-family: var(--rune); font-weight: 400; letter-spacing: .1em; font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.1; margin: 0 0 .8rem; color: var(--gold); }
.page-hero p.lead { color: var(--muted); font-style: italic; margin: 0 auto; max-width: 34rem; text-wrap: balance; }

/* Player: appears when an episode is chosen */
.player { margin: 0 0 1.6rem; }
.player[hidden] { display: none; }
.player .frame { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player h3 { font-family: var(--rune); font-weight: 400; font-size: 1.2rem; letter-spacing: .08em; margin: .9rem 0 0; }

/* Episode carousel */
.carousel { position: relative; }
.track { display: flex; gap: 1.1rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: .3rem .1rem 1rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.ep { flex: 0 0 min(78vw, 19rem); scroll-snap-align: start; background: var(--stone-2); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  color: inherit; text-align: left; padding: 0; font: inherit; display: block; }
button.ep { cursor: pointer; }
button.ep:hover, button.ep:focus-visible, .ep[aria-current="true"] { border-color: var(--ember); }
.ep .thumb { position: relative; aspect-ratio: 16 / 9; background: #1c1a18 center / cover no-repeat; display: grid; place-items: center; }
.ep .thumb img.ph { width: 34%; opacity: .25; }
.ep .thumb .play { width: 3.2rem; height: 3.2rem; border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; }
.ep .thumb .play svg { width: 1.3rem; height: 1.3rem; fill: #fff; margin-left: .15rem; }
.ep .info { padding: .8rem 1rem 1rem; }
.ep .num { font-family: var(--rune); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ember); display: block; }
.ep .name { font-family: var(--rune); font-size: 1.05rem; letter-spacing: .06em; display: block; margin-top: .2rem; }
.ep.soon .name { color: var(--muted); }
.car-btn { position: absolute; top: 34%; transform: translateY(-50%); width: 2.8rem; height: 2.8rem; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(38,35,33,.92); color: var(--text); cursor: pointer; display: grid; place-items: center; z-index: 2; }
.car-btn:hover, .car-btn:focus-visible { border-color: var(--ember); color: var(--ember); }
.car-btn svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.car-btn.prev { left: -1.1rem; } .car-btn.next { right: -1.1rem; }
.car-btn[disabled] { opacity: 0; pointer-events: none; }
@media (max-width: 760px) { .car-btn { display: none; } }   /* on phones you swipe */

/* Subscribe band */
.subscribe { text-align: center; }
.subscribe h2 { margin-inline: auto; max-width: 30rem; text-wrap: balance; }
.subscribe h2::after { margin-inline: auto; background: linear-gradient(90deg, transparent, var(--bronze), transparent); }
.subscribe p { color: var(--muted); max-width: 34rem; margin: 0 auto 1.4rem; }

