/* Lazy Learn — "Moonlit". Warm, low-blue colors that are easy on sleepy eyes. */
:root {
  --night: #0f1424;
  --night-2: #151b30;
  --night-3: #1c2340;
  --line: #262d4a;
  --parchment: #f1e4c8;
  --muted: #a7a9bb;
  --faint: #7d8098;
  --amber: #e8b86b;
  --amber-soft: rgba(232, 184, 107, .14);
  --serif: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(700px 420px at 88% -8%, rgba(232, 184, 107, .07), transparent 70%),
    var(--night);
  color: var(--parchment);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

/* The amber crescent used in the logo and the dim screen. */
.crescent {
  display: inline-block;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  box-shadow: inset -.28em .08em 0 0 var(--amber);
  transform: rotate(-20deg);
}

/* Layout */
.site-header, main, .site-footer {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 26px;
  padding-bottom: 26px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 1.2rem/1 var(--serif);
  color: var(--parchment);
  text-decoration: none;
}
.brand .crescent { font-size: 1.35rem; }
nav { display: flex; gap: 22px; }
nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
nav a:hover { color: var(--parchment); }
main { flex: 1; }

.eyebrow {
  margin: 0 0 14px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
}
.lede { color: var(--muted); font-size: 1.1rem; max-width: 34em; }
h1 { font-size: clamp(2.4rem, 6vw, 3.9rem); line-height: 1.04; letter-spacing: -.015em; margin-bottom: 18px; font-weight: 300; }
h2 { font-size: 1.9rem; line-height: 1.15; margin-bottom: 26px; font-weight: 300; }
h3 { font-size: 1.2rem; line-height: 1.3; }

/* Home: hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  padding: 48px 0 88px;
}

/* Player */
.player {
  background: var(--night-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.player-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.moon {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #f6d59a, var(--amber) 62%, #c9944a);
  box-shadow: 0 0 40px rgba(232, 184, 107, .25);
}
.player-title { font: 400 1.35rem/1.25 var(--serif); }
.player-meta { color: var(--faint); font-size: .9rem; margin-top: 3px; }

.player-seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --pct: 0%;
}
.player-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--amber) var(--pct), var(--line) var(--pct));
}
.player-seek::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
.player-seek::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--amber); }
.player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; margin-top: -5px;
  border-radius: 50%; border: 0; background: var(--parchment);
}
.player-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; border: 0; background: var(--parchment); }
.player-times {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 18px;
}

.player-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.play {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--parchment);
  color: var(--night);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.play:hover { background: #fff3da; }
.play:active { transform: scale(.96); }
.play svg { width: 26px; height: 26px; fill: currentColor; }
.play .i-pause, .player.is-playing .play .i-play { display: none; }
.player.is-playing .play .i-pause { display: block; }

.timer { display: flex; flex-direction: column; gap: 2px; font-size: .75rem; color: var(--faint); }
.timer select, .ghost {
  font: inherit;
  font-size: .9rem;
  color: var(--parchment);
  background: var(--night-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.ghost { margin-left: auto; color: var(--muted); }
.ghost:hover, .timer select:hover { border-color: #3a4266; }
.player-status { color: var(--faint); font-size: .85rem; min-height: 1.4em; margin-top: 14px; }

.player-empty { display: flex; align-items: center; gap: 16px; color: var(--muted); }

/* Home: how it works */
.how { padding: 0 0 88px; scroll-margin-top: 24px; }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.steps li { border-top: 1px solid var(--line); padding-top: 20px; }
.steps h3 { margin: 12px 0 8px; }
.steps p { color: var(--muted); font-size: .95rem; }
.step-n {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber);
  font: 500 .9rem/1 var(--serif);
}

/* Lesson library */
.library { padding: 0 0 88px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head a { font-size: .95rem; }
.subject + .subject { margin-top: 36px; }
.subject h3 {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.lesson-list a {
  flex: 1;
  min-width: 0;
  padding: 16px 0;
  text-decoration: none;
  color: var(--parchment);
}
.lesson-name { display: block; font: 400 1.25rem/1.3 var(--serif); }
.lesson-summary { display: block; color: var(--muted); font-size: .92rem; margin-top: 2px; }
.lesson-list a:hover .lesson-name { color: var(--amber); }
.lesson-len { flex: none; color: var(--faint); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* Lessons page + lesson page */
.page-head { padding: 40px 0 48px; }
.lesson { max-width: 680px; padding: 24px 0 88px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: .95rem; margin-bottom: 36px; }
.back:hover { color: var(--parchment); }
.lesson .lede { margin-bottom: 32px; }
.transcript { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 18px; }
.transcript summary { cursor: pointer; color: var(--muted); font-size: .95rem; }
.transcript summary:hover { color: var(--parchment); }
.transcript p { font: 300 1.15rem/1.8 var(--serif); color: #d9ccb0; margin-top: 18px; }
.next { margin-top: 40px; color: var(--muted); }

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 30px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: .85rem;
}

/* Dim screen */
.dim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #05070d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  cursor: pointer;
  animation: dim-in 1.2s ease;
}
.dim[hidden] { display: none; }
.dim .crescent { font-size: 2.4rem; opacity: .35; }
.dim p { color: #3d4057; font-size: .85rem; }
@keyframes dim-in { from { opacity: 0; } to { opacity: 1; } }

/* Phones */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header { padding-top: 20px; padding-bottom: 20px; }
  nav { gap: 16px; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 20px 0 64px; }
  .steps { grid-template-columns: 1fr; }
  .player { padding: 20px; }
  .ghost { margin-left: 0; }
  .site-footer { flex-direction: column; gap: 4px; }
}

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