/* Briefly: brieflyaudio.com
   Tokens mirror the app theme (briefly/src/theme/colors.ts, typography.ts).
   Type: Newsreader (the app's wordmark and display serif) for headings and
   the wordmark, Inter for everything else.
   Radius rule: interactive controls are full pills; panels and tiles 24px;
   device frame 44px; app screens inside tiles 28px. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #efeee9;
  --ink: #17171a;
  --muted: #5f5e63;
  --line: #dedcd5;
  --accent: #6c55f5;
  --accent-pressed: #5842da;
  --accent-soft: #ece8ff;
  --accent-text: #5842da;
  --on-accent: #ffffff;
  --shadow: 0 30px 60px -28px rgb(23 23 26 / 0.3), 0 12px 24px -16px rgb(23 23 26 / 0.18);

  /* Tile grounds, from the app's own screens (colors.ts nowPlaying,
     lavender, surfaceSecondary, sun). */
  --player: #12131f;
  --tile-topics: #eeeafd;
  --tile-queue: #efeee9;
  --tile-menu: #fbeee1;

  --font-display: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;

  --radius-panel: 24px;
  --radius-device: 44px;
  --radius-screen: 28px;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4.5rem, 10vw, 8rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --surface: #1c1c21;
    --surface-2: #222228;
    --ink: #f2f1ec;
    --muted: #a8a7ad;
    --line: #2f2f36;
    --accent: #6c55f5;
    --accent-pressed: #5842da;
    --accent-soft: #231f3d;
    --accent-text: #b3a8ff;
    --on-accent: #ffffff;
    --shadow: 0 30px 60px -28px rgb(0 0 0 / 0.7), 0 12px 24px -16px rgb(0 0 0 / 0.5);

    --player: #1a1b2a;
    --tile-topics: #221f38;
    --tile-queue: #1c1c21;
    --tile-menu: #241f24;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-text);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 600;
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Brand mark (the app icon, as a home screen shows it) ---------- */

.mark {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 22.5%;
  background: url("/assets/img/mark.png?v=2") center / contain no-repeat;
  box-shadow: 0 0 0 1px rgb(23 23 26 / 0.06), 0 4px 10px -4px rgb(23 23 26 / 0.25);
}

/* ---------- Header ---------- */

.site-header {
  height: 68px;
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav-link {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.975rem;
  text-decoration: none;
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.25s var(--ease-out), background-color 0.25s var(--ease-out);
}

.nav-link:hover {
  border-color: var(--ink);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  white-space: nowrap;
  min-height: 3.25rem;
  padding: 0 1.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: background-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.button:hover {
  background: var(--accent-pressed);
  text-decoration: none;
}

.button:active {
  transform: scale(0.98);
}

.button-quiet {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.button-quiet:hover {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(2rem, 6vw, 5rem) var(--section);
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.6rem, 5.8vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.hero h1 span {
  display: block;
  white-space: nowrap;
}

.nobr {
  white-space: nowrap;
}

.hero h1 .quiet {
  color: var(--accent-text);
}

.hero .lede {
  margin-top: 1.5rem;
  max-width: 34ch;
  color: var(--muted);
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.5;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

/* Device frame around a real app screenshot (its status bar is cropped). */
.device {
  justify-self: center;
  width: min(100%, 320px);
  aspect-ratio: 1179 / 2414;
  padding: 12px;
  border-radius: var(--radius-device);
  background: #1b1b1f;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08), var(--shadow);
  rotate: 2deg;
}

.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--radius-device) - 12px);
  background: #fef9f2;
}

.device-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Video ---------- */

.film {
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}

.film h2,
.how h2,
.inside h2,
.ready h2,
.sources h2 {
  font-size: clamp(2.1rem, 4.2vw, 3.25rem);
  max-width: 18ch;
}

.film-frame {
  margin-top: 2.5rem;
  overflow: hidden;
  border-radius: var(--radius-panel);
  background: #1b1b1f;
  box-shadow: var(--shadow);
}

.film-frame video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.film-note {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- How it works ---------- */

.how {
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}

.wave {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  height: 56px;
  margin-block: 3rem 3.5rem;
  overflow: hidden;
}

.wave i {
  flex: 0 1 8px;
  min-width: 3px;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.85;
  transform-origin: center;
  transform: scaleY(var(--h, 0.4));
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding-inline: clamp(1rem, 3vw, 2.5rem);
  border-left: 1px solid var(--line);
}

.steps li:first-child {
  padding-left: 0;
  border-left: 0;
}

.steps h3 {
  font-size: 1.65rem;
  margin-bottom: 0.75rem;
}

.steps p {
  color: var(--muted);
  max-width: 34ch;
}

/* ---------- Inside the app: a bento of real screens ---------- */

.inside {
  padding-block: 0 var(--section);
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 31rem 31rem auto;
  gap: 1.25rem;
  margin-top: 3rem;
}

.tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-panel);
  padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1.75rem, 3vw, 2.5rem) 0;
}

.tile h3 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  max-width: 16ch;
}

.tile p {
  margin-top: 0.75rem;
  max-width: 38ch;
  color: var(--muted);
}

/* The screen rises from the tile's lower edge and runs off it. */
.shot {
  flex: 1 1 auto;
  min-height: 0;
  width: min(100%, 300px);
  margin-top: 2rem;
  align-self: center;
  overflow: hidden;
  border-radius: var(--radius-screen) var(--radius-screen) 0 0;
  box-shadow: 0 0 0 1px rgb(23 23 26 / 0.06), 0 24px 48px -24px rgb(23 23 26 / 0.35);
}

.shot img {
  width: 100%;
  height: auto;
}

.tile-player {
  grid-column: 1 / span 7;
  grid-row: 1 / span 2;
  background: var(--player);
}

.tile-player h3 {
  color: #ffffff;
}

.tile-player p {
  color: #b9b7c4;
}

.tile-player .shot {
  width: min(100%, 380px);
  margin-top: 2.75rem;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1), 0 30px 60px -20px rgb(0 0 0 / 0.6);
}

.tile-topics {
  grid-column: 8 / span 5;
  background: var(--tile-topics);
}

.tile-queue {
  grid-column: 8 / span 5;
  background: var(--tile-queue);
}

/* The wide tile: copy on the left, the menu sheet (the screen's lower part)
   on the right. */
.tile-menu {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
  padding-block: 0;
  background: var(--tile-menu);
}

.tile-menu .tile-copy {
  padding-block: 2.5rem;
}

.tile-menu .shot {
  align-self: end;
  justify-self: center;
  width: min(100%, 360px);
  height: 22rem;
  margin-top: 2.5rem;
}

/* Show the screen's lower part, where the menu sheet is. */
.tile-menu .shot img {
  height: 100%;
  object-fit: cover;
  object-position: bottom;
}

/* ---------- Deep Dive ready: two parts of real screens ----------
   The Home card in front, Updates overlapping its lower corner; the figure
   sits left of the copy on wide screens (the hero has it the other way). */

.ready {
  padding-block: 0 var(--section);
}

.ready .container {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.ready-copy {
  order: 2;
}

.ready-copy p {
  margin-top: 1.25rem;
  max-width: 36ch;
  color: var(--muted);
  font-size: 1.125rem;
}

.ready-figure {
  order: 1;
  position: relative;
  padding-bottom: 5.5rem;
}

.crop {
  overflow: hidden;
  border-radius: var(--radius-screen);
  background: #fef9f2;
  box-shadow: 0 0 0 1px rgb(23 23 26 / 0.07), var(--shadow);
}

.crop img {
  width: 100%;
  height: auto;
}

.crop-home {
  width: min(88%, 460px);
}

.crop-updates {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(68%, 380px);
}

/* ---------- Sources ---------- */

.sources {
  padding-block: var(--section);
  background: var(--surface-2);
}

.sources .container {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 2.25rem clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.sources .intro p {
  margin-top: 1.25rem;
  color: var(--muted);
  max-width: 38ch;
}

.publishers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.disclaimer {
  grid-column: 2;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Beta / contact ---------- */

.beta {
  padding-block: var(--section);
}

.beta-panel {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 5vw, 4rem);
  border-radius: var(--radius-panel);
  background: var(--accent-soft);
}

.beta-panel .mark {
  width: 4rem;
  height: 4rem;
  margin-bottom: 1.75rem;
}

.beta-panel h2 {
  font-size: clamp(2.1rem, 4.2vw, 3.25rem);
}

.beta-panel p {
  margin-top: 1.25rem;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.125rem;
}

.beta-panel .button {
  margin-top: 2.25rem;
}

.beta-panel .address {
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer .brand {
  font-size: 1.2rem;
}

.site-footer .mark {
  width: 1.6rem;
  height: 1.6rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---------- Legal pages ---------- */

.legal {
  padding-block: clamp(2.5rem, 7vw, 5rem) var(--section);
}

.legal article {
  max-width: 68ch;
}

.legal h1 {
  font-size: clamp(2.4rem, 5vw, 3.5rem);
}

.legal .updated {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.legal h2 {
  margin-top: 3rem;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}

.legal p,
.legal ul {
  margin-top: 1rem;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal li + li {
  margin-top: 0.5rem;
}

.legal .summary {
  margin-top: 2rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-panel);
  background: var(--surface);
  border: 1px solid var(--line);
}

.legal .summary ul {
  margin-top: 0.75rem;
}

/* ---------- 404 ---------- */

.notfound {
  min-height: calc(100dvh - 68px - 8rem);
  display: grid;
  align-content: center;
  gap: 1.25rem;
  padding-block: 4rem;
}

.notfound h1 {
  font-size: clamp(2.4rem, 5vw, 3.75rem);
}

.notfound p {
  color: var(--muted);
}

/* ---------- Motion (only when the visitor allows it) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: rise 0.9s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 90ms);
  }

  .device.reveal {
    animation-name: rise-device;
    animation-duration: 1.1s;
  }

  /* The waveform is the page's one looping element: it says "audio". */
  .wave i {
    animation: level 1.6s ease-in-out infinite alternate;
    animation-delay: calc(var(--d, 0) * -1s);
  }

  /* Each screen rises into its tile as the tile scrolls into view, where
     the browser supports scroll-driven animation; elsewhere it just sits. */
  @supports (animation-timeline: view()) {
    .tile .shot {
      animation: rise-shot linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }

    /* The Updates entry arrives just after the Home card: the notice
       follows the card it belongs to. */
    .crop-updates {
      animation: rise-notice linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 90%;
    }
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes rise-shot {
  from {
    transform: translateY(48px);
  }
}

@keyframes rise-notice {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
}

@keyframes rise-device {
  from {
    opacity: 0;
    transform: translateY(32px);
    rotate: 5deg;
  }
}

@keyframes level {
  from {
    transform: scaleY(0.18);
  }
  to {
    transform: scaleY(var(--h, 0.4));
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero .container,
  .ready .container,
  .sources .container {
    grid-template-columns: minmax(0, 1fr);
  }

  .ready-copy,
  .ready-figure {
    order: 0;
  }

  .ready-figure {
    padding-bottom: 4rem;
  }

  .crop-updates {
    width: min(72%, 380px);
  }

  .disclaimer {
    grid-column: 1;
  }

  .device {
    width: min(78%, 300px);
    margin-top: 1rem;
  }
}

@media (max-width: 767px) {
  .bento {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    margin-top: 2.25rem;
  }

  .tile-player,
  .tile-topics,
  .tile-queue,
  .tile-menu {
    grid-column: 1;
    grid-row: auto;
  }

  .tile .shot,
  .tile-player .shot {
    flex: none;
    width: min(100%, 280px);
    height: 22rem;
  }

  .tile-menu {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: clamp(1.75rem, 3vw, 2.5rem);
  }

  .tile-menu .tile-copy {
    padding-block: 0;
  }

  .tile-menu .shot {
    margin-top: 2rem;
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
  }

  .steps li {
    padding-inline: 0;
    border-left: 0;
  }

  .wave {
    height: 40px;
    margin-block: 2.25rem 2.5rem;
  }
}

@media (max-width: 420px) {
  .publishers {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero .actions .button {
    flex: 1 1 100%;
  }
}
