@font-face {
  font-family: Pretendard;
  src: url('./PretendardVariable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --canvas: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #eeeeeb;
  --surface-3: #e5e5e1;
  --ink: #191918;
  --ink-2: #4f4f4b;
  --ink-3: #7d7d77;
  --line: #d9d9d4;
  --line-strong: #b8b8b1;
  --inverse: #1b1b1a;
  --on-inverse: #f7f7f4;
  --danger: #72534d;
  --today-bg: #171716;
  --today-ink: #f7f7f3;
  --today-muted: #b9b9b2;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --content: 1180px;
  --reading: 720px;
}

* { box-sizing: border-box; }

html {
  font-family: Pretendard, system-ui, -apple-system, sans-serif;
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  letter-spacing: -.012em;
}

button, input { font: inherit; }
button { color: inherit; }
button, a, .card, .source, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, .card:focus-visible, a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(120%) blur(18px);
}

.topin {
  width: min(100%, calc(var(--content) + 48px));
  height: 100%;
  margin: auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
}

.brand {
  margin: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -.025em;
}

.brand small, .kicker, .meta {
  display: block;
  margin: 0 0 5px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: .115em;
  text-transform: uppercase;
}

.brand small { margin-bottom: 2px; font-size: 8px; }
.topActions { display: flex; justify-content: flex-end; }

.icon {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

.icon:active, .primary:active, .chip:active, .path:active, .controls button:active { transform: scale(.96); }
.icon:hover { background: var(--surface-2); }

.layout { width: min(100%, calc(var(--content) + 48px)); margin: auto; }
.main { min-width: 0; padding: 38px 16px 112px; }
.side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: min(340px, calc(100vw - 44px));
  padding: 18px 18px 32px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform .24s cubic-bezier(.2,.7,.2,1), visibility 0s linear .24s;
}
.menuOpen .side { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.menuBackdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(12,12,11,.48);
  backdrop-filter: blur(2px);
}
.menuBackdrop[hidden] { display: none; }
.menuHead { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding-left: 12px; border-bottom: 1px solid var(--line); }
.menuHead span { color: var(--ink-3); font-size: 10px; font-weight: 650; letter-spacing: .12em; }
.sidenav { display: grid; gap: 4px; padding: 18px 0; }
.sidenav .navbtn { min-height: 50px; padding: 0 14px; border-radius: var(--r-sm); text-align: left; font-size: 15px; }
.sidenav .navbtn b { display: none; }
.sidenav .navbtn.active { background: var(--inverse); color: var(--on-inverse); }
.menuNote { margin: auto 12px 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 11px; }
.view { display: none; }
.view.active { display: block; animation: enter .22s ease-out; }

@keyframes enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.title {
  max-width: 850px;
  margin: 0;
  font-size: clamp(31px, 7.5vw, 50px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -.052em;
  text-wrap: balance;
  word-break: keep-all;
}

.lead {
  max-width: 680px;
  margin: 16px 0 38px;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  word-break: keep-all;
}

.pageIntro { margin-bottom: 28px; }
.pageIntro h2 { max-width: 760px; margin: 0; font-size: clamp(27px, 6vw, 38px); font-weight: 650; line-height: 1.12; letter-spacing: -.042em; }
.dashboard { display: grid; gap: 20px; }
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.panel h2, .panel h3 { margin: 4px 0 8px; font-weight: 650; letter-spacing: -.035em; }
.panel h2 { font-size: clamp(24px, 5.5vw, 33px); line-height: 1.12; }
.panel h3 { font-size: 18px; }
.panel p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.68; }
.today { background: var(--today-bg); border-color: var(--today-bg); color: var(--today-ink); }
.today .kicker, .today p, .today .dayProgress, .today .stat small { color: var(--today-muted); }
.paneltop { display: grid; gap: 20px; }

.primary {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--on-inverse);
  border-radius: 999px;
  background: var(--on-inverse);
  color: var(--inverse);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 24px; background: rgba(255,255,255,.16); }
.stat { padding: 16px 6px; background: var(--today-bg); text-align: center; }
.stat b { display: block; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat small { display: block; margin-top: 3px; font-size: 11px; }

.todayNav { display: flex; align-items: center; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.16); }
.todayNav button {
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  background: transparent;
  color: var(--today-ink);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}
.todayNav .dayMove { width: 44px; flex: 0 0 44px; font-size: 20px; }
.todayNav .randomDay { flex: 1; }
.dayProgress { display: block; margin-top: 10px; font-size: 11px; }

.panelLabel { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panelLabel h3 { margin: 0; }
.panelLabel > span { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.referenceCard { width: 100%; padding: 0; display: grid; gap: 15px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.referenceVisual { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; border-radius: var(--r-md); background: var(--surface-3); }
.referenceVisual img { width: 100%; height: 100%; display: block; object-fit: cover; transform: scale(1.035); }
.referenceVisual i { position: absolute; inset: 50% auto auto 50%; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.9); color: #171716; font-size: 15px; font-style: normal; transform: translate(-50%,-50%); }
.referenceCopy { display: grid; gap: 5px; }
.referenceCopy b { font-size: 18px; font-weight: 650; letter-spacing: -.03em; }
.referenceCopy small { color: var(--ink-3); font-size: 11px; line-height: 1.45; }
.referenceCopy em { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--ink-2); font-size: 13px; font-style: normal; line-height: 1.6; }

.experimentCard { width: 100%; min-height: 104px; padding: 4px 0 0; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: start; gap: 14px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.experimentMark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 16px; font-weight: 650; }
.experimentCard > span:nth-child(2) { min-width: 0; display: grid; gap: 5px; }
.experimentCard b { font-size: 18px; font-weight: 650; letter-spacing: -.03em; }
.experimentCard small { color: var(--ink-3); font-size: 11px; }
.experimentCard em { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; color: var(--ink-2); font-size: 13px; font-style: normal; line-height: 1.62; }
.experimentCard > i { padding-top: 11px; color: var(--ink-3); font-style: normal; }

.path {
  width: 100%;
  min-height: 60px;
  margin-top: 0;
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.path:first-of-type { margin-top: 8px; }
.path b { font-size: 15px; font-weight: 600; }
.path small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 12px; }
.path i { flex: none; color: var(--ink-3); font-size: 12px; font-style: normal; font-weight: 550; }
.path:hover b { text-decoration: underline; text-underline-offset: 3px; }

.toolbar {
  position: sticky;
  top: 64px;
  z-index: 10;
  margin: 22px 0 26px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--canvas) 90%, transparent);
  backdrop-filter: saturate(120%) blur(18px);
}

.search {
  width: 100%;
  min-height: 46px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
}
.search::placeholder { color: var(--ink-3); }
.chips { display: flex; gap: 4px; margin-top: 7px; overflow: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.emotionBar { margin-top: 7px; padding-top: 7px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.emotionBar > span { padding-left: 10px; color: var(--ink-3); font-size: 10px; font-weight: 650; letter-spacing: .08em; }
.emotionBar .chips { margin-top: 0; }
.chip {
  flex: none;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip.active { background: var(--inverse); color: var(--on-inverse); }

.head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.head h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.025em; }
.head span { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.referenceHead { align-items: end; gap: 16px; }
.referenceHead small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 11px; font-weight: 400; line-height: 1.45; }
.headActions { display: flex; align-items: center; gap: 10px; }
.headActions select { min-height: 38px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 550; cursor: pointer; }
.grid { display: grid; gap: 38px 16px; }

.card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}
.visual, .miniSeq {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--surface-3);
}
.visual img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; transform: scale(1.035); transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.card:hover .visual img { transform: scale(1.065); }
.body { padding: 15px 2px 0; }
.card h3 { margin: 6px 0 9px; font-size: 18px; font-weight: 650; line-height: 1.28; letter-spacing: -.032em; word-break: keep-all; }
.summary { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.68; word-break: keep-all; }
.tags { display: flex; flex-wrap: wrap; gap: 0; margin-top: 10px; color: var(--ink-3); }
.tag { padding: 0; background: transparent; color: inherit; font-size: 10px; font-weight: 500; }
.tag:not(:last-child)::after { content: ' · '; white-space: pre; color: var(--line-strong); }

.save {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  background: rgba(22,22,21,.62);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.save.on { background: #fff; color: #171716; }
.done { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 7px 10px; border-radius: 999px; background: rgba(22,22,21,.75); color: #fff; font-size: 10px; font-weight: 600; backdrop-filter: blur(8px); }

.miniSeq { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; padding: 1px; background: var(--line); }
.mini { overflow: hidden; padding: 8px; background: var(--surface); }
.mini b { display: block; margin-bottom: 3px; color: var(--ink); font-size: 9px; font-weight: 650; }
.mini span { color: var(--ink-2); font-size: 9px; line-height: 1.25; }

.nav {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 30;
  height: 62px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(130%) blur(22px);
}
.navbtn { border: 0; background: transparent; color: var(--ink-3); font-size: 10px; font-weight: 550; cursor: pointer; }
.navbtn b { display: block; margin-bottom: 3px; font-size: 18px; font-weight: 400; }
.navbtn.active { color: var(--ink); font-weight: 650; }

dialog {
  width: min(760px, 100%);
  max-width: none;
  height: min(94dvh, 960px);
  max-height: none;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  color: var(--ink);
}
dialog::backdrop { background: rgba(12,12,11,.58); backdrop-filter: blur(2px); }
.sheet { height: 100%; overflow: auto; overscroll-behavior: contain; }
.sheetbar { position: sticky; top: 0; z-index: 5; height: 58px; padding: 7px 12px; display: flex; justify-content: space-between; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(120%) blur(18px); }
.detailvisual { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-3); }
.detailvisual img { width: 100%; height: 100%; display: block; object-fit: contain; }
.detailvisual.case img { object-fit: cover; }
.detail { max-width: var(--reading); margin: auto; padding: 34px 22px 76px; }
.detail h2 { margin: 6px 0 10px; font-size: clamp(28px, 6.5vw, 40px); font-weight: 650; line-height: 1.1; letter-spacing: -.044em; word-break: keep-all; }
.sub { margin: 0 0 40px; color: var(--ink-3); font-size: 12px; line-height: 1.65; }
.block { margin: 0; padding: 26px 0; border: 0; border-top: 1px solid var(--line); background: transparent; }
.block dt { margin: 0 0 7px; color: var(--ink-3); font-size: 10px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; }
.block dd { margin: 0; font-size: 15.5px; line-height: 1.82; letter-spacing: -.008em; word-break: keep-all; }
.practice { margin: 22px 0; padding: 24px; border: 0; border-radius: var(--r-md); background: var(--inverse); color: var(--on-inverse); }
.practice dt { color: color-mix(in srgb, var(--on-inverse) 64%, transparent); }
.warning dt { color: var(--danger); }
.videoStudy { margin: 0 0 32px; }
.videoFrame { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; border-radius: var(--r-md); background: #000; color: #171716; text-decoration: none; }
.ytPlayer, .ytPlayer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.videoPoster { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; padding: 0; overflow: hidden; border: 0; background: #000; color: #171716; cursor: pointer; }
.videoPoster[hidden] { display: none; }
.videoPoster > img { width: 100%; height: 100%; display: block; object-fit: cover; transform: scale(1.035); transition: transform .3s ease, filter .2s ease; }
.videoPoster:hover > img { transform: scale(1.06); }
.videoPoster.waiting > img { filter: brightness(.64); }
.videoPlay { position: absolute; inset: 50% auto auto 50%; min-height: 48px; padding: 0 18px; display: flex; align-items: center; gap: 9px; border-radius: 999px; background: rgba(255,255,255,.92); transform: translate(-50%,-50%); white-space: nowrap; }
.videoPlay i { font-size: 13px; font-style: normal; }
.videoPlay b { font-size: 13px; font-weight: 650; }
.videoFallback { position: absolute; inset: 0; z-index: 3; padding: 24px; display: grid; place-content: center; gap: 18px; background: #111; color: #f5f5f3; text-align: center; }
.videoFallback[hidden] { display: none; }
.videoFallback p { margin: 0; display: grid; gap: 7px; }
.videoFallback b { font-size: 16px; font-weight: 650; }
.videoFallback span { color: #a7a7a2; font-size: 12px; line-height: 1.55; }
.videoFallback a { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #f5f5f3; color: #171716; text-decoration: none; font-size: 13px; font-weight: 650; }
.videoCaption { padding: 12px 2px 0; display: grid; gap: 4px; }
.videoCaption b { font-size: 13px; font-weight: 650; }
.videoCaption span { color: var(--ink-3); font-size: 11px; line-height: 1.5; }
.steps { display: grid; margin: 16px 0; border-top: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.step strong { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 12px; font-weight: 600; }
.step b { font-size: 15px; font-weight: 650; }
.step p { margin: 4px 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.step small { color: var(--ink-3); font-size: 11px; }
.source { display: block; margin-top: 18px; padding: 14px 18px; border-radius: 999px; background: var(--inverse); color: var(--on-inverse); text-align: center; text-decoration: none; font-size: 14px; font-weight: 650; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 36px; padding: 12px 0; }
.controls button { min-height: 48px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; }
.controls .on { border-color: var(--inverse); background: var(--inverse); color: var(--on-inverse); }
.empty { padding: 64px 20px; color: var(--ink-3); text-align: center; }

@media (min-width: 560px) {
  .paneltop { grid-template-columns: 1fr auto; align-items: start; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 22px; }
}

@media (min-width: 760px) {
  .topin { padding: 0 24px; }
  .brand { text-align: left; }
  .layout { padding: 0 24px; }
  .main { padding: 56px 0 96px; }
  .nav { display: none; }
  .dashboard { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 24px; align-items: start; }
  .today { grid-row: span 2; }
  .dailyReference { grid-row: span 2; }
  .continuePanel, .pathsPanel { grid-column: span 1; }
  .panel { padding: 28px; }
  dialog { height: 100dvh; margin: 0 0 0 auto; border-radius: 0; }
}

@media (min-width: 1080px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 20px; }
}

@media (max-width: 759px) {
  .main { padding-top: 34px; }
  .title { font-size: clamp(31px, 9.5vw, 42px); }
  .lead { font-size: 15px; margin-bottom: 32px; }
  .referenceHead { align-items: start; }
  .headActions { flex-direction: column; align-items: end; }
  .headActions select { max-width: 132px; }
}

@media (hover: none) and (pointer: coarse) {
  button:focus:not(:focus-visible), a:focus:not(:focus-visible), .card:focus:not(:focus-visible), select:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
  }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #141413;
    --surface: #1d1d1c;
    --surface-2: #272725;
    --surface-3: #30302d;
    --ink: #f0f0ec;
    --ink-2: #bebeb7;
    --ink-3: #92928b;
    --line: #363633;
    --line-strong: #555550;
    --inverse: #efefea;
    --on-inverse: #171716;
    --danger: #c49a91;
    --today-bg: #050505;
    --today-ink: #f7f7f3;
    --today-muted: #b8b8b1;
  }
  .primary { border-color: #f7f7f3; background: #f7f7f3; color: #121211; }
}
