:root {
  --bg: #141714;
  --bg-2: #1c221c;
  --card: #232a23;
  --line: #343c34;
  --ink: #f3efe4;
  --muted: #b7b1a3;
  --amber: #e0a15a;
  --clay: #e7a09a;
  --sage: #8faf86;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --sans: "Outfit", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --radius: 18px;
  --nav: 292px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--sans);
  font-weight: 380;
  line-height: 1.5;
  min-height: 100dvh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: var(--amber); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  align-items: center;
  padding: 10px 16px 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.langbar {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.lang-switch { display: flex; gap: 6px; flex: none; }
button.lang-btn {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 999px;
  border: 2px solid #c4a36a;
  background-color: #243028;
  color: #f6f1e6;
  padding: 8px 14px;
  min-height: 44px;
  min-width: 96px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
button.lang-btn[aria-pressed="true"] {
  background-color: #e0a15a;
  color: #1a140c;
  border-color: #e0a15a;
}
.lesson { position: relative; flex: 1 1 200px; min-width: 0; }
.lesson summary {
  -webkit-appearance: none;
  appearance: none;
  list-style: none;
  cursor: pointer;
  border-radius: 999px;
  border: 2px solid #8faf86;
  background-color: #243028;
  padding: 8px 16px 8px 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #d7e7d2;
  font-weight: 650;
}
.lesson summary::-webkit-details-marker { display: none; }
.lesson summary::after { content: "▾"; color: var(--amber); flex: none; }
.lesson[open] summary::after { content: "▴"; }
.lesson-panel {
  display: none;
}
.lesson[open] .lesson-panel {
  display: block;
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px 14px;
  max-height: min(62dvh, 460px);
  overflow: auto;
  box-shadow: var(--shadow);
}
.lesson-h {
  margin: 12px 0 6px;
  color: var(--amber);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.words { display: flex; flex-direction: column; gap: 8px; }
.word {
  display: grid;
  grid-template-columns: minmax(88px, 0.7fr) minmax(88px, 0.8fr) 1.4fr;
  gap: 6px 10px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.word b { color: var(--ink); font-weight: 640; }
.word span { color: var(--sage); }
.word em { color: var(--muted); font-style: normal; }
.gram { margin: 0 0 8px; color: var(--ink); font-size: 0.92rem; }
.gram b { color: var(--amber); font-weight: 640; }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand h1 {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1;
}
.brand-kicker {
  margin: 0 0 2px;
  color: var(--sage);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--amber);
  box-shadow: inset 0 -8px 0 var(--clay);
  flex: none;
}
#search-form {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}
#q {
  flex: 1;
  min-width: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  outline: none;
}
#q:focus { border-color: var(--amber); }
.ghost, .solid {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 10px 14px;
  min-height: 44px;
}
.solid {
  background: var(--amber);
  color: #1a140c;
  border-color: transparent;
  font-weight: 640;
}
.mic[aria-pressed="true"] {
  background: var(--clay);
  color: #2a1210;
  border-color: transparent;
}
#menu-toggle { display: none; }

#shell {
  display: grid;
  grid-template-columns: var(--nav) 1fr;
  min-height: calc(100dvh - 118px);
}
#nav {
  border-right: 1px solid var(--line);
  padding: 12px;
  position: sticky;
  top: var(--head, 168px);
  align-self: start;
  max-height: calc(100dvh - var(--head, 168px));
  overflow: auto;
}
.group { margin-bottom: 8px; }
.group-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  padding: 10px 8px;
  min-height: 44px;
}
.group-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}
.group.open .group-panel { grid-template-rows: 1fr; }
.group-panel-inner { overflow: hidden; }
.topic-link {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  min-height: 44px;
  color: var(--ink);
}
.topic-link:hover, .topic-link.active { background: var(--card); }
.topic-link.active { box-shadow: inset 3px 0 0 var(--amber); }

#main { padding: 22px 22px 120px; min-width: 0; }
.rise { animation: rise 0.45s ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rise, .group-panel { animation: none; transition: none; }
}

.lede {
  max-width: 42rem;
  margin: 0 0 18px;
  color: var(--muted);
}
h2.page-title {
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  line-height: 1.15;
}
.note {
  background: #2a2418;
  border: 1px solid #5c4a2c;
  color: var(--amber);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 18px;
  max-width: 46rem;
}
.note strong { color: var(--ink); }
.care {
  color: var(--clay);
}
.amber { color: var(--amber); }

.home-grid, .cards {
  display: grid;
  gap: 14px;
}
.home-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); max-width: 920px; }
.jump {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 120px;
  box-shadow: var(--shadow);
}
.jump b { font-family: var(--display); font-size: 1.25rem; font-weight: 650; }
.jump span { color: var(--muted); }

.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.shot {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #101410;
  text-decoration: none;
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .play {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: var(--amber);
  color: #1a140c;
  font-weight: 640;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
}
.plate {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--amber) 35%, transparent), transparent 55%),
    var(--bg-2);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.4rem;
}
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.meta { color: var(--muted); font-size: 0.86rem; margin: 0; }
.card h3 { margin: 0; font-size: 1.08rem; line-height: 1.3; font-weight: 500; }
.help { margin: 0; color: var(--amber); }
.card details { border-top: 1px solid var(--line); padding-top: 8px; }
.card summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--sage); }
.about { margin: 0 0 8px; color: var(--ink); }
.when { margin: 0; color: var(--sage); font-size: 0.86rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sage);
}

.practice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 8px;
  margin: 0 0 12px;
}
.practice h3 { margin: 0 0 6px; font-family: var(--display); font-size: 1.35rem; }
.practice ol { margin: 8px 0 12px; padding-left: 1.2rem; }
.practice li { margin: 6px 0; }
.practice .why { color: var(--amber); margin: 0 0 8px; }

.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  max-width: 720px;
}
label.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; color: var(--muted); font-size: 0.92rem; }
label.field input, label.field select {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-height: 44px;
}
.chimes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chimes button[aria-pressed="true"] { background: var(--amber); color: #1a140c; border-color: transparent; }
.clock {
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 5rem);
  margin: 8px 0;
  letter-spacing: -0.04em;
}
.breath-stage {
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  margin: 12px auto;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--sage) 28%, var(--bg)) 0%, var(--bg) 70%);
  transform: scale(0.86);
  transition: transform 0.4s linear;
}
.breath-stage strong { font-family: var(--display); font-size: 1.6rem; }
.steps { color: var(--muted); }

#dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  background: #1a1f1a;
  border: 1px solid var(--amber);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
#dock[hidden] { display: none; }
#dock p { margin: 0; }
#yt-slot { width: 160px; height: 90px; flex: none; background: #000; border-radius: 8px; overflow: hidden; }
#yt-slot:empty, #yt-slot.off { display: none; }

#modal[hidden] { display: none; }
#modal { position: fixed; inset: 0; z-index: 40; }
.modal-back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }
.modal-card {
  position: relative;
  margin: 6dvh auto;
  width: min(760px, calc(100% - 24px));
  max-height: 86dvh;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px 14px 20px;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; position: sticky; top: 0; background: var(--bg); padding-bottom: 8px; }
.hit {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.hit img, .hit .mini {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--card);
}
.net-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.foot { margin-top: 28px; color: var(--muted); font-size: 0.88rem; max-width: 46rem; }
.log-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.log-item button { background: none; border: 0; padding: 0; text-align: left; color: var(--amber); min-height: 44px; }

@media (max-width: 860px) {
  #menu-toggle { display: inline-flex; }
  #shell { display: block; min-height: 0; }
  #nav {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #nav.collapsed { display: none; }
  #main { padding: 16px 14px 120px; }
  .hit { grid-template-columns: 96px 1fr; }
  .top { grid-template-columns: auto 1fr; }
}

@media (max-width: 640px) {
  .word { grid-template-columns: 1fr; gap: 2px; }
  .langbar { flex-wrap: wrap; }
  .lesson { flex-basis: 100%; }
}

@media (min-width: 861px) {
  #search-form { grid-column: auto; }
  .top { grid-template-columns: auto 1fr minmax(280px, 460px); }
}
