:root {
  color-scheme: dark;
  --bg: #0b0e15;
  --bg-deep: #070910;
  --sidebar: #10141d;
  --surface: #151a24;
  --surface-2: #1a202b;
  --surface-3: #222935;
  --text: #f5efe7;
  --muted: #999da8;
  --muted-strong: #c4c2c0;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(221, 186, 116, 0.28);
  --accent: #ddba74;
  --accent-soft: #f1dbad;
  --rose: #c98d9f;
  --rose-soft: #e8c1cc;
  --sage: #87aaa0;
  --danger: #db8f8f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --sidebar-w: 250px;
  --content-w: 1180px;
  --font-sans: "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  --font-display: "DM Serif Display", "Noto Serif KR", Georgia, serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3efe8;
  --bg-deep: #e8e1d7;
  --sidebar: #f9f6f0;
  --surface: #fffdf9;
  --surface-2: #f6f0e7;
  --surface-3: #ece4d9;
  --text: #1b1d23;
  --muted: #77756f;
  --muted-strong: #504f4d;
  --line: rgba(22, 23, 27, 0.1);
  --line-strong: rgba(143, 103, 47, 0.28);
  --accent: #9a7136;
  --accent-soft: #6e4d20;
  --rose: #a96478;
  --rose-soft: #784255;
  --sage: #527a70;
  --shadow: 0 22px 60px rgba(60, 48, 32, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 2%, rgba(201, 141, 159, 0.08), transparent 28rem),
    radial-gradient(circle at 42% 100%, rgba(221, 186, 116, 0.05), transparent 34rem),
    var(--bg);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

button,
a,
input,
textarea,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

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

img,
svg {
  display: block;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--bg);
  background: var(--accent-soft);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.cosmic-ambient {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.cosmic-ambient::before,
.cosmic-ambient::after {
  content: "";
  position: absolute;
  width: 48vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.13;
  animation: ambient-drift 18s ease-in-out infinite alternate;
}

.cosmic-ambient::before {
  top: -24vw;
  right: -10vw;
  background: #8d36ff;
}

.cosmic-ambient::after {
  bottom: -30vw;
  left: 14vw;
  background: #17c9c4;
  animation-delay: -9s;
}

.cosmic-ambient i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff8d8;
  box-shadow: 0 0 14px 3px rgba(255, 236, 173, 0.55);
  animation: star-float 11s ease-in-out infinite;
}

.cosmic-ambient i:nth-child(1) { top: 12%; left: 30%; animation-delay: -2s; }
.cosmic-ambient i:nth-child(2) { top: 27%; left: 84%; width: 2px; height: 2px; animation-delay: -7s; }
.cosmic-ambient i:nth-child(3) { top: 54%; left: 19%; animation-delay: -5s; }
.cosmic-ambient i:nth-child(4) { top: 72%; left: 74%; width: 4px; height: 4px; animation-delay: -9s; }
.cosmic-ambient i:nth-child(5) { top: 89%; left: 47%; width: 2px; height: 2px; animation-delay: -4s; }
.cosmic-ambient i:nth-child(6) { top: 41%; left: 57%; animation-delay: -1s; }

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 34px 22px 24px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 30%),
    var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(221, 186, 116, 0.06);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}

.brand-copy {
  min-width: 0;
  display: grid;
}

.brand-copy b {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.13rem;
  font-weight: 400;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.72rem;
}

.primary-nav {
  display: grid;
  gap: 7px;
  margin-top: 48px;
}

.nav-item {
  min-height: 50px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted-strong);
  background: transparent;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-item.active {
  color: var(--accent-soft);
  border-color: var(--line-strong);
  background: rgba(221, 186, 116, 0.07);
}

.nav-icon,
[data-icon] {
  display: inline-grid;
  place-items: center;
}

.nav-icon svg,
.icon-button svg,
.mobile-nav svg,
.inline-icon svg,
.chip-icon svg,
.button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.nav-item em {
  min-width: 26px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 0.69rem;
  font-style: normal;
  text-align: center;
}

.nav-item.active em {
  color: var(--accent-soft);
}

.sidebar-note {
  margin-top: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.sidebar-note p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.6;
}

.sidebar-note b {
  color: var(--muted-strong);
  font-weight: 600;
}

.moon-mini {
  width: 21px;
  height: 21px;
  display: block;
  border: 1px solid var(--accent);
  border-radius: 50%;
  box-shadow: inset -6px 0 0 var(--surface);
}

.main {
  grid-column: 2;
  min-width: 0;
  padding: 0 clamp(24px, 5vw, 70px) 72px;
}

.topbar {
  max-width: var(--content-w);
  min-height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 0 auto;
  padding: 42px 0 34px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 5px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.topbar p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  word-break: keep-all;
}

.topbar .eyebrow,
.eyebrow {
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.topbar-actions {
  align-self: center;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted-strong);
  background: var(--surface);
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.view {
  max-width: var(--content-w);
  margin: 0 auto;
  padding-top: 38px;
}

.view-enter {
  animation: view-in 300ms ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.mobile-nav {
  display: none;
}

.stack {
  display: grid;
  gap: 24px;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 24px;
}

.hero {
  --pointer-x: 74%;
  --pointer-y: 46%;
  position: relative;
  min-height: 438px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 34px;
  overflow: hidden;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid rgba(221, 186, 255, 0.28);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, rgba(5, 6, 14, 0.97) 0%, rgba(5, 6, 14, 0.83) 40%, rgba(5, 6, 14, 0.24) 72%, rgba(5, 6, 14, 0.5) 100%),
    linear-gradient(0deg, rgba(4, 5, 11, 0.72), transparent 48%),
    url("experience/hero_cosmic_opera_v1.png") center / cover no-repeat,
    #080912;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42), 0 0 90px rgba(118, 49, 255, 0.09);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(160, 95, 255, 0.24), transparent 21%),
    linear-gradient(112deg, transparent 24%, rgba(255, 255, 255, 0.09) 47%, transparent 62%);
  background-size: auto, 220% 100%;
  mix-blend-mode: screen;
  animation: hero-sheen 9s ease-in-out infinite;
}

.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 90px rgba(5, 6, 14, 0.52);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 3;
  align-self: center;
  color: #fff8f0;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.hero-copy h2 {
  max-width: 520px;
  margin: 10px 0 15px;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.8vw, 3.65rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.035em;
  word-break: keep-all;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 480px;
  margin: 0 0 30px;
  color: rgba(245, 239, 255, 0.78);
  word-break: keep-all;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 25px;
}

.soft-chip,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.72rem;
}

.hero-art {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  align-self: stretch;
  opacity: 0.72;
  filter: drop-shadow(0 0 30px rgba(210, 157, 255, 0.28));
}

.moon-orbit {
  position: absolute;
  width: 260px;
  aspect-ratio: 1;
  border: 1px solid rgba(234, 215, 255, 0.3);
  border-radius: 50%;
  animation: orbit-spin 18s linear infinite;
}

.moon-orbit::before,
.moon-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.moon-orbit::before {
  inset: 18%;
  border: 1px dashed rgba(111, 231, 255, 0.34);
}

.moon-orbit::after {
  width: 7px;
  height: 7px;
  top: 12%;
  left: 15%;
  background: #ff75cf;
  box-shadow: 0 0 22px #ff75cf;
}

.moon-core {
  width: 126px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.46);
  background:
    radial-gradient(circle at 34% 28%, #fff 0 5%, transparent 6%),
    radial-gradient(circle at 58% 62%, rgba(77, 29, 117, 0.4) 0 9%, transparent 10%),
    radial-gradient(circle at 43% 45%, #f7e3ff, #a471dc 54%, #28123f 78%);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.24), 0 0 90px rgba(128, 50, 255, 0.36);
  animation: moon-breathe 5s ease-in-out infinite;
}

.hero-kinetic {
  position: absolute;
  z-index: 2;
  inset: 0 0 0 46%;
  pointer-events: none;
}

.hero-kinetic i {
  position: absolute;
  width: 34px;
  aspect-ratio: 0.64;
  border: 1px solid rgba(232, 219, 255, 0.48);
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(111, 43, 255, 0.08));
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.08), 0 0 26px rgba(116, 73, 255, 0.26);
  backdrop-filter: blur(4px);
  animation: kinetic-card 7s ease-in-out infinite;
}

.hero-kinetic i:nth-child(1) { top: 17%; left: 23%; transform: rotate(-17deg); animation-delay: -1s; }
.hero-kinetic i:nth-child(2) { top: 63%; left: 31%; width: 27px; transform: rotate(22deg); animation-delay: -4s; }
.hero-kinetic i:nth-child(3) { top: 20%; right: 15%; width: 24px; transform: rotate(13deg); animation-delay: -2.5s; }
.hero-kinetic i:nth-child(4) { top: 69%; right: 9%; width: 38px; transform: rotate(-25deg); animation-delay: -6s; }
.hero-kinetic i:nth-child(5) { top: 45%; right: 34%; width: 20px; transform: rotate(8deg); animation-delay: -3s; }

.hero .soft-chip {
  color: rgba(255, 248, 240, 0.78);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(8, 8, 20, 0.34);
  backdrop-filter: blur(8px);
}

.hero .button.ghost {
  color: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(7, 8, 18, 0.28);
  backdrop-filter: blur(8px);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: var(--surface-2);
  font-weight: 600;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.button.primary {
  border-color: var(--accent);
  color: #15120c;
  background: var(--accent-soft);
}

.button.ghost {
  color: var(--muted-strong);
  background: transparent;
}

.button.danger {
  color: var(--danger);
  background: transparent;
}

.button.small {
  min-height: 38px;
  padding: 0 13px;
  font-size: 0.79rem;
}

.button.wide {
  width: 100%;
}

.insight-card {
  min-height: 186px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.insight-card h3 {
  margin: 8px 0 8px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
}

.insight-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  word-break: keep-all;
}

.progress-line {
  height: 5px;
  overflow: hidden;
  margin: 21px 0 10px;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress-line i {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--accent));
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.stat {
  padding: 17px 15px;
  background: var(--surface);
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
}

.stat small {
  color: var(--muted);
  font-size: 0.69rem;
}

.section {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.section.plain {
  padding: 0;
  border: 0;
  background: transparent;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-head h2,
.section-head h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
}

.section-head p {
  max-width: 560px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  word-break: keep-all;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 0.76rem;
}

.filter-chip:hover,
.filter-chip.active {
  color: var(--accent-soft);
  border-color: var(--line-strong);
  background: rgba(221, 186, 116, 0.06);
}

.portal-section {
  position: relative;
  display: grid;
  gap: 24px;
  padding: clamp(24px, 4vw, 36px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% -30%, rgba(129, 83, 255, 0.15), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--surface) 88%, #15102b), var(--surface));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.portal-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
  pointer-events: none;
}

.portal-intro {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(300px, 1fr);
  align-items: end;
  gap: 38px;
}

.portal-intro h2 {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.portal-intro > p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  word-break: keep-all;
}

.portal-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reading-portal {
  --pointer-x: 50%;
  --pointer-y: 42%;
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  color: #fff;
  background: #080a12;
  text-align: left;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.24);
  isolation: isolate;
  animation: portal-arrive 650ms cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--portal-index) * 90ms);
  transition: transform 340ms cubic-bezier(.2,.8,.2,1), border-color 260ms ease, box-shadow 340ms ease;
}

.portal-visual,
.portal-visual::after,
.portal-glow {
  position: absolute;
  inset: 0;
}

.portal-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  filter: saturate(1.04) contrast(1.03);
  transition: transform 800ms cubic-bezier(.16,.8,.2,1), filter 500ms ease;
}

.portal-visual::after {
  content: "";
  background:
    linear-gradient(to top, rgba(4, 5, 11, 0.94) 3%, rgba(5, 5, 14, 0.37) 47%, rgba(5, 5, 14, 0.06) 75%),
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), transparent 0 12%, rgba(255, 255, 255, 0.09) 24%, transparent 44%);
}

.portal-glow {
  z-index: 1;
  opacity: 0;
  background: radial-gradient(circle at var(--pointer-x) var(--pointer-y), color-mix(in srgb, var(--portal-tone) 46%, transparent), transparent 37%);
  mix-blend-mode: screen;
  transition: opacity 320ms ease;
}

.portal-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
  padding: 25px 26px 27px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
}

.portal-copy small {
  color: color-mix(in srgb, var(--portal-tone) 78%, white);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.portal-copy b {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.08;
}

.portal-copy em {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.73rem;
  font-style: normal;
}

.portal-arrow {
  position: absolute;
  z-index: 3;
  right: 20px;
  bottom: 24px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #fff;
  background: rgba(5, 6, 14, 0.34);
  backdrop-filter: blur(9px);
  transform: translateX(10px);
  opacity: 0;
  transition: transform 260ms ease, opacity 260ms ease, background 260ms ease;
}

.portal-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.reading-portal:hover,
.reading-portal:focus-visible,
.reading-portal.active {
  border-color: color-mix(in srgb, var(--portal-tone) 64%, white 8%);
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.4), 0 0 42px color-mix(in srgb, var(--portal-tone) 18%, transparent);
  transform: translateY(-7px);
}

.reading-portal:hover .portal-visual img,
.reading-portal:focus-visible .portal-visual img,
.reading-portal.active .portal-visual img {
  transform: scale(1.1);
  filter: saturate(1.18) contrast(1.08);
}

.reading-portal:hover .portal-glow,
.reading-portal:focus-visible .portal-glow,
.reading-portal.active .portal-glow {
  opacity: 0.76;
}

.reading-portal:hover .portal-arrow,
.reading-portal:focus-visible .portal-arrow,
.reading-portal.active .portal-arrow {
  opacity: 1;
  transform: none;
}

.reading-portal.active .portal-arrow {
  color: #090a10;
  background: color-mix(in srgb, var(--portal-tone) 82%, white);
}

.reading-showcase {
  --pointer-x: 50%;
  --pointer-y: 38%;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(148, 84, 255, 0.1), transparent 35%),
    radial-gradient(circle at 88% 92%, rgba(32, 207, 202, 0.07), transparent 30%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, #171029), var(--surface));
  isolation: isolate;
}

.reading-showcase::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 70%;
  aspect-ratio: 1;
  left: var(--pointer-x);
  top: var(--pointer-y);
  border-radius: 50%;
  background: conic-gradient(from 90deg, rgba(125, 69, 255, 0.15), rgba(255, 93, 178, 0.08), rgba(45, 207, 210, 0.13), rgba(125, 69, 255, 0.15));
  filter: blur(60px);
  opacity: 0.62;
  transform: translate(-50%, -50%);
  animation: showcase-aurora 16s linear infinite;
  pointer-events: none;
}

.reading-showcase::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0 1px, transparent 1.5px);
  background-size: 53px 53px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 70%);
  opacity: 0.22;
  pointer-events: none;
}

.reading-showcase > .section-head,
.reading-showcase > .reading-grid {
  position: relative;
  z-index: 2;
}

.reading-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reading-card {
  --pointer-x: 50%;
  --pointer-y: 50%;
  position: relative;
  min-height: 238px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 19px;
  color: #fff;
  background: #090b12;
  text-align: left;
  isolation: isolate;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.05);
  animation: reading-card-arrive 620ms cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--card-index) * 55ms);
  transition: transform 330ms cubic-bezier(.2,.8,.2,1), border-color 260ms ease, box-shadow 330ms ease;
}

.reading-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0.38;
  background: radial-gradient(circle at var(--pointer-x) var(--pointer-y), color-mix(in srgb, var(--tone, var(--accent)) 35%, transparent), transparent 38%);
  mix-blend-mode: screen;
  transition: opacity 240ms ease;
  pointer-events: none;
}

.reading-card::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 1px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  box-shadow: inset 0 0 52px rgba(3, 4, 10, 0.32);
  pointer-events: none;
}

.reading-card-art {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  transition: transform 850ms cubic-bezier(.16,.8,.2,1);
}

.reading-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--art-focus, center);
  transform: scale(1.04);
  animation: reading-art-drift 11s ease-in-out infinite alternate;
  animation-delay: calc(var(--card-index) * -1.1s);
}

.reading-card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(4, 5, 11, 0.96) 1%, rgba(4, 5, 11, 0.64) 38%, rgba(4, 5, 11, 0.08) 73%),
    linear-gradient(105deg, rgba(4, 5, 11, 0.34), transparent 58%),
    radial-gradient(circle at 88% 17%, color-mix(in srgb, var(--tone) 23%, transparent), transparent 35%);
}

.reading-card-sheen {
  position: absolute;
  z-index: 3;
  inset: -45%;
  opacity: 0.16;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.52) 49%, transparent 60%);
  transform: translateX(-62%) rotate(8deg);
  animation: spectral-scan 7.5s ease-in-out infinite;
  animation-delay: calc(var(--card-index) * -0.7s);
  pointer-events: none;
}

.reading-card:hover {
  border-color: var(--tone, var(--line-strong));
  transform: translateY(-8px) scale(1.012);
  box-shadow: 0 26px 58px rgba(0, 0, 0, 0.36), 0 0 42px color-mix(in srgb, var(--tone, var(--accent)) 20%, transparent);
}

.reading-card:hover::before,
.reading-card:focus-visible::before {
  opacity: 1;
}

.reading-card:hover .reading-card-art,
.reading-card:focus-visible .reading-card-art {
  transform: scale(1.075);
}

.reading-card:hover .reading-card-sheen,
.reading-card:focus-visible .reading-card-sheen {
  opacity: 0.42;
}

.reading-card > *:not(.reading-card-art):not(.reading-card-sheen) {
  position: relative;
  z-index: 5;
}

.reading-card .card-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.reading-card .reading-symbol {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 66%, white 8%);
  border-radius: 50%;
  color: color-mix(in srgb, var(--tone, var(--accent)) 74%, white);
  background: rgba(5, 6, 13, 0.46);
  box-shadow: 0 0 24px color-mix(in srgb, var(--tone, var(--accent)) 20%, transparent);
  backdrop-filter: blur(9px);
  font-family: var(--font-display);
}

.reading-card .reading-state {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(5, 6, 13, 0.38);
  font-size: 0.67rem;
  backdrop-filter: blur(8px);
}

.reading-card h3 {
  margin: auto 0 5px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.82);
}

.reading-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.75rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.reading-card.locked {
  filter: saturate(0.52) brightness(0.72);
}

.reading-card.locked:hover {
  transform: none;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.field > span {
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 600;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-2);
}

.input,
.select {
  height: 44px;
  padding: 0 13px;
}

.textarea {
  min-height: 104px;
  resize: vertical;
  padding: 12px 13px;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
}

.search-wrap {
  position: relative;
  width: min(100%, 340px);
}

.search-wrap .input {
  padding-left: 42px;
}

.search-wrap [data-icon] {
  position: absolute;
  left: 14px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-wrap svg {
  width: 17px;
  height: 17px;
}

.archive-hero {
  --pointer-x: 64%;
  --pointer-y: 48%;
  position: relative;
  min-height: 360px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(169, 132, 255, 0.26);
  border-radius: var(--radius-lg);
  color: #fff;
  background: #070910;
  box-shadow: 0 28px 75px rgba(0, 0, 0, 0.34), 0 0 70px rgba(105, 64, 210, 0.08);
  isolation: isolate;
}

.archive-hero > img {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  animation: archive-river-pan 18s ease-in-out infinite alternate;
}

.archive-hero::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 5, 12, 0.96) 0%, rgba(4, 5, 12, 0.74) 43%, rgba(4, 5, 12, 0.08) 75%),
    linear-gradient(0deg, rgba(4, 5, 12, 0.62), transparent 55%);
}

.archive-hero::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 1px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: inherit;
  pointer-events: none;
}

.archive-hero-glow {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(147, 100, 255, 0.32), transparent 31%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.archive-hero-copy {
  position: relative;
  z-index: 4;
  max-width: 590px;
  padding: clamp(30px, 6vw, 66px);
  text-shadow: 0 3px 28px rgba(0, 0, 0, 0.74);
}

.archive-hero-copy h2 {
  margin: 9px 0 15px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.archive-hero-copy > p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
}

.archive-orbits {
  position: absolute;
  z-index: 3;
  right: 6%;
  top: 50%;
  width: 250px;
  aspect-ratio: 1;
  margin-top: -125px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  animation: orbit-spin 28s linear infinite;
  pointer-events: none;
}

.archive-orbits::before,
.archive-orbits::after {
  content: "";
  position: absolute;
  border: 1px dashed rgba(180, 141, 255, 0.25);
  border-radius: 50%;
}

.archive-orbits::before { inset: 18%; }
.archive-orbits::after { inset: 37%; border-style: solid; }

.archive-orbits i {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff4bf;
  box-shadow: 0 0 18px 4px rgba(255, 233, 156, 0.52);
}

.archive-orbits i:nth-child(1) { top: 10%; left: 21%; }
.archive-orbits i:nth-child(2) { right: 8%; top: 48%; background: #9d7aff; }
.archive-orbits i:nth-child(3) { left: 30%; bottom: 8%; background: #57d7de; }

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 42px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state > div {
  max-width: 380px;
}

.empty-state .empty-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
}

.empty-state h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 400;
}

.empty-state p {
  margin: 0 0 20px;
  font-size: 0.82rem;
}

.archive-list {
  display: grid;
  gap: 11px;
}

.archive-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.archive-item:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.16);
}

.archive-thumb-stack {
  position: relative;
  width: 70px;
  height: 82px;
}

.archive-thumb-stack img {
  position: absolute;
  width: 50px;
  height: 74px;
  object-fit: cover;
  border: 2px solid var(--surface-2);
  border-radius: 7px;
  transition: transform 300ms cubic-bezier(.2,.8,.2,1), left 300ms ease;
}

.archive-thumb-stack img:nth-child(2) { left: 10px; transform: rotate(3deg); }
.archive-thumb-stack img:nth-child(3) { left: 20px; transform: rotate(6deg); }

.archive-item:hover .archive-thumb-stack img:first-child { transform: translateX(-5px) rotate(-7deg); }
.archive-item:hover .archive-thumb-stack img:nth-child(2) { left: 13px; transform: translateY(-4px) rotate(1deg); }
.archive-item:hover .archive-thumb-stack img:nth-child(3) { left: 27px; transform: translateX(5px) rotate(9deg); }

.archive-copy {
  min-width: 0;
}

.archive-copy h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 400;
}

.archive-copy p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-copy .archive-date {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.67rem;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 13px;
}

.collection-card {
  --pointer-x: 50%;
  --pointer-y: 38%;
  position: relative;
  display: block;
  aspect-ratio: 0.64;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #fff;
  background: var(--surface-2);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
  transition: transform 280ms cubic-bezier(.2,.8,.2,1), border-color 240ms ease, box-shadow 280ms ease;
  isolation: isolate;
}

.collection-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(255, 255, 255, 0.28), transparent 30%),
    linear-gradient(112deg, transparent 35%, rgba(255, 255, 255, 0.28) 48%, transparent 61%);
  mix-blend-mode: screen;
  transition: opacity 240ms ease;
  pointer-events: none;
}

.collection-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease, filter 280ms ease;
}

.collection-card:hover img {
  transform: scale(1.075);
  filter: saturate(1.16) contrast(1.04);
}

.collection-card:hover {
  z-index: 2;
  border-color: var(--line-strong);
  transform: translateY(-7px) rotate(-0.5deg);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.32), 0 0 32px rgba(149, 91, 255, 0.12);
}

.collection-card:hover::before,
.collection-card:focus-visible::before {
  opacity: 0.72;
}

.collection-card .card-caption {
  z-index: 3;
  position: absolute;
  inset: auto 0 0;
  padding: 32px 10px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.86));
  text-align: left;
}

.collection-card .card-caption b {
  display: block;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 400;
}

.collection-card .card-caption small {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.59rem;
}

.collection-card.locked img {
  filter: grayscale(1) brightness(0.28) blur(2px);
}

.collection-card.locked::after {
  content: "미해금";
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 9px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.58);
  background: rgba(0, 0, 0, 0.32);
  font-size: 0.57rem;
}

.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
}

.settings-menu {
  align-self: start;
  position: sticky;
  top: 20px;
  display: grid;
  gap: 5px;
}

.settings-menu button {
  min-height: 42px;
  padding: 0 13px;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 0.77rem;
}

.settings-menu button.active {
  color: var(--accent-soft);
  background: rgba(221, 186, 116, 0.07);
}

.settings-panel {
  display: grid;
  gap: 18px;
}

.setting-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.setting-group-head {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.setting-group-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
}

.setting-group-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.setting-row {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row h3 {
  margin: 0 0 3px;
  font-size: 0.83rem;
}

.setting-row p {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  word-break: keep-all;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.segmented button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 0.69rem;
}

.segmented button.active {
  color: var(--text);
  background: var(--surface-3);
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  display: inline-block;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  transition: 180ms ease;
}

.switch i::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: var(--muted);
  transition: 180ms ease;
}

.switch input:checked + i {
  border-color: var(--accent);
  background: rgba(221, 186, 116, 0.13);
}

.switch input:checked + i::after {
  left: 23px;
  background: var(--accent);
}

.draw-layout {
  display: grid;
  gap: 24px;
}

.draw-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 22px 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.draw-intro h2 {
  margin: 4px 0 3px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
}

.draw-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.draw-progress {
  min-width: 92px;
  color: var(--muted);
  font-size: 0.71rem;
  text-align: right;
}

.draw-progress b {
  display: block;
  color: var(--accent-soft);
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 400;
}

.deck-stage {
  position: relative;
  min-height: 555px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: center;
  gap: 10px;
  overflow: hidden;
  padding: 38px 0 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at 50% 52%, rgba(133, 68, 255, 0.17), transparent 34%),
    radial-gradient(ellipse at 70% 65%, rgba(42, 219, 224, 0.09), transparent 34%),
    linear-gradient(140deg, rgba(201, 141, 159, 0.055), rgba(95, 128, 143, 0.055)),
    var(--bg-deep);
  isolation: isolate;
}

.deck-stage::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: min(74vw, 720px);
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(221, 186, 116, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 52px rgba(221, 186, 116, 0.012), 0 0 0 104px rgba(128, 91, 255, 0.009);
  transform: translate(-50%, -50%);
  animation: deck-orbit 36s linear infinite;
}

.deck-aura {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
}

.deck-aura i {
  position: absolute;
  width: 200px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.18;
  animation: deck-aura 10s ease-in-out infinite alternate;
}

.deck-aura i:nth-child(1) { top: 14%; left: 12%; background: #8c52ff; }
.deck-aura i:nth-child(2) { right: 12%; bottom: 8%; background: #25d1d2; animation-delay: -4s; }
.deck-aura i:nth-child(3) { left: 48%; bottom: -24%; background: #ff5aa8; animation-delay: -7s; }

.deck-guide {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 0 20px;
  text-align: center;
}

.deck-guide span {
  color: var(--accent);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.deck-guide b {
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 400;
}

.deck-guide em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
}

.deck {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 27px calc(50% - 71px) 42px;
  scroll-padding-inline: calc(50% - 71px);
  scroll-snap-type: x mandatory;
  scrollbar-color: rgba(221, 186, 116, 0.45) transparent;
  scrollbar-width: thin;
}

.deck::-webkit-scrollbar {
  height: 5px;
}

.deck::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(90deg, #8c52ff, #ddba74, #27c7cf);
}

.deck-card {
  --i: 0;
  --count: 22;
  position: relative;
  flex: 0 0 142px;
  width: 142px;
  aspect-ratio: 0.625;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(221, 186, 116, 0.4);
  border-radius: 13px;
  background: #090b10;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  scroll-snap-align: center;
  transform: none;
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.deck-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deck-card:hover,
.deck-card:focus-visible {
  z-index: 4;
  transform: translateY(-14px) scale(1.035);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.46), 0 0 0 2px var(--accent), 0 0 34px rgba(143, 84, 255, 0.24);
}

.deck-card.selected {
  z-index: 5;
  filter: brightness(0.62) saturate(0.65);
  transform: translateY(-8px) scale(1.025);
  box-shadow: 0 0 0 2px var(--accent), 0 18px 48px rgba(221, 186, 116, 0.22), 0 0 35px rgba(135, 75, 255, 0.2);
}

.deck-card.selected::after {
  content: "✓";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: #17130d;
  background: var(--accent-soft);
  font-weight: 700;
  transform: translate(-50%, -50%);
}

.draw-actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
}

.result-summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.55fr);
  gap: 24px;
  isolation: isolate;
}

.result-summary::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 72%;
  aspect-ratio: 1;
  left: 12%;
  top: -18%;
  border-radius: 50%;
  background: conic-gradient(from 40deg, rgba(116, 70, 255, 0.17), rgba(28, 204, 206, 0.09), rgba(255, 79, 164, 0.11), rgba(116, 70, 255, 0.17));
  filter: blur(85px);
  animation: result-aura 18s linear infinite;
}

.result-cards {
  display: grid;
  grid-template-columns: repeat(var(--result-count, 1), minmax(0, 1fr));
  gap: 14px;
}

.result-card {
  min-width: 0;
  animation: result-card-reveal 720ms cubic-bezier(.16,.8,.2,1) both;
}

.result-card:nth-child(2) { animation-delay: 110ms; }
.result-card:nth-child(3) { animation-delay: 220ms; }

.result-card-art::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -30%;
  opacity: 0.24;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.58) 49%, transparent 60%);
  transform: translateX(-65%) rotate(7deg);
  animation: spectral-scan 6.5s ease-in-out infinite;
  pointer-events: none;
}

.result-card-art::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 45%), rgba(157, 105, 255, 0.25), transparent 35%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.result-card-art {
  position: relative;
  aspect-ratio: 0.68;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.result-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 650ms cubic-bezier(.16,.8,.2,1), filter 400ms ease;
}

.result-card.reversed .result-card-art img {
  transform: rotate(180deg);
}

.result-card:not(.reversed) .result-card-art:hover img {
  transform: scale(1.045);
  filter: saturate(1.08) contrast(1.03);
}

.result-card.reversed .result-card-art:hover img {
  transform: rotate(180deg) scale(1.045);
  filter: saturate(1.08) contrast(1.03);
}

.result-card-art .position-label {
  z-index: 4;
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: white;
  background: rgba(7, 9, 16, 0.72);
  font-size: 0.65rem;
  backdrop-filter: blur(8px);
}

.result-card-copy {
  padding: 15px 3px 0;
}

.result-card-copy h3 {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
}

.result-card-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.reading-note {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(132, 79, 255, 0.13), transparent 40%),
    linear-gradient(155deg, var(--surface), color-mix(in srgb, var(--surface) 91%, #15102d));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.reading-note::before {
  content: "";
  position: absolute;
  width: 160px;
  aspect-ratio: 1;
  right: -70px;
  top: -70px;
  border: 1px solid rgba(178, 137, 255, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(147, 95, 255, 0.025), 0 0 0 58px rgba(44, 205, 210, 0.018);
  animation: orbit-spin 24s linear infinite;
  pointer-events: none;
}

.reading-note h2 {
  margin: 6px 0 10px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 400;
}

.reading-note > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.78rem;
  word-break: keep-all;
}

.meaning-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 25px;
}

.meaning-item {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.meaning-item b {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-soft);
  font-size: 0.78rem;
}

.meaning-item p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.76rem;
  line-height: 1.7;
  word-break: keep-all;
}

.action-callout {
  position: relative;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(221, 186, 116, 0.055);
}

.action-callout::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, rgba(255, 235, 177, 0.12) 50%, transparent 75%);
  background-size: 230% 100%;
  animation: action-glow 6s ease-in-out infinite;
  pointer-events: none;
}

.action-callout small {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-weight: 700;
}

.action-callout p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.77rem;
}

.dialog-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 9, 0.72);
  backdrop-filter: blur(12px);
}

.dialog-layer[hidden] {
  display: none;
}

.dialog {
  width: min(900px, 100%);
  max-height: min(850px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 38px 110px rgba(0, 0, 0, 0.5);
}

.dialog.compact {
  width: min(480px, 100%);
}

.dialog-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
}

.dialog-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
}

.dialog-body {
  padding: 24px;
}

.card-detail {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 28px;
}

.card-detail > img {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.card-detail-copy h2 {
  margin: 7px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1;
}

.card-detail-copy .english-name {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--font-display);
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 26px;
  max-width: min(440px, calc(100vw - 30px));
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-3);
  box-shadow: var(--shadow);
  font-size: 0.77rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.skeleton {
  min-height: 120px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}

.skeleton::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.035), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-120%); }
  to { transform: translateX(300%); }
}

@keyframes ambient-drift {
  from { transform: translate3d(-3%, -2%, 0) scale(0.92); }
  to { transform: translate3d(5%, 4%, 0) scale(1.08); }
}

@keyframes star-float {
  0%, 100% { opacity: 0.18; transform: translateY(0) scale(0.7); }
  48% { opacity: 0.9; transform: translateY(-18px) scale(1.25); }
}

@keyframes hero-sheen {
  0%, 100% { background-position: center, 130% 0; opacity: 0.56; }
  50% { background-position: center, -30% 0; opacity: 0.92; }
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes deck-orbit {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes moon-breathe {
  0%, 100% { transform: scale(0.96); filter: saturate(0.88); }
  50% { transform: scale(1.04); filter: saturate(1.2); }
}

@keyframes kinetic-card {
  0%, 100% { margin-top: 0; filter: brightness(0.82); }
  50% { margin-top: -15px; filter: brightness(1.25); }
}

@keyframes portal-arrive {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes deck-aura {
  from { transform: translate3d(-10px, 10px, 0) scale(0.88); }
  to { transform: translate3d(20px, -12px, 0) scale(1.12); }
}

@keyframes showcase-aurora {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.9); }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.08); }
  100% { transform: translate(-50%, -50%) rotate(360deg) scale(0.9); }
}

@keyframes reading-card-arrive {
  from { opacity: 0; transform: translateY(24px) scale(0.965); }
  to { opacity: 1; transform: none; }
}

@keyframes reading-art-drift {
  0% { transform: scale(1.04) translate3d(0, 0, 0); filter: saturate(0.96); }
  50% { filter: saturate(1.12); }
  100% { transform: scale(1.09) translate3d(-1.1%, -0.8%, 0); filter: saturate(1.03); }
}

@keyframes spectral-scan {
  0%, 28% { transform: translateX(-66%) rotate(8deg); }
  64%, 100% { transform: translateX(66%) rotate(8deg); }
}

@keyframes archive-river-pan {
  from { transform: scale(1.025) translate3d(-0.8%, 0, 0); filter: saturate(0.92); }
  to { transform: scale(1.075) translate3d(1.2%, -0.8%, 0); filter: saturate(1.14); }
}

@keyframes result-aura {
  from { transform: rotate(0deg) scale(0.94); }
  to { transform: rotate(360deg) scale(1.06); }
}

@keyframes result-card-reveal {
  from { opacity: 0; transform: translateY(35px) rotateY(14deg) scale(0.94); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes action-glow {
  0%, 100% { background-position: 140% 0; opacity: 0.3; }
  50% { background-position: -40% 0; opacity: 0.85; }
}

@media (max-width: 1040px) {
  :root {
    --sidebar-w: 84px;
  }

  .sidebar {
    align-items: center;
    padding-inline: 14px;
  }

  .brand-copy,
  .nav-item > span:not(.nav-icon),
  .nav-item em,
  .sidebar-note {
    display: none;
  }

  .brand {
    justify-content: center;
  }

  .nav-item {
    width: 54px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .collection-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1041px) and (max-width: 1320px) {
  .home-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(245px, 0.4fr);
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-art {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --mobile-nav-h: 78px;
  }

  body {
    padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 0 18px 32px;
  }

  .topbar {
    min-height: 142px;
    align-items: flex-end;
    padding: 30px 0 24px;
  }

  .topbar h1 {
    font-size: 2.25rem;
  }

  .topbar p:not(.eyebrow) {
    max-width: 310px;
    font-size: 0.78rem;
  }

  .view {
    padding-top: 22px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    inset: auto 0 0;
    height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--sidebar) 92%, transparent);
    backdrop-filter: blur(18px);
  }

  .mobile-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    border-radius: 13px;
    color: var(--muted);
    background: transparent;
  }

  .mobile-nav button.active {
    color: var(--accent-soft);
    background: rgba(221, 186, 116, 0.07);
  }

  .mobile-nav b {
    font-size: 0.62rem;
    font-weight: 600;
  }

  .mobile-nav svg {
    width: 21px;
    height: 21px;
  }

  .hero {
    min-height: 492px;
    grid-template-columns: 1fr;
    padding: 28px 24px;
    background-position: center, center, 62% center, center;
  }

  .hero-copy h2 {
    font-size: 2.55rem;
  }

  .hero-art {
    display: none;
  }

  .hero-kinetic {
    inset-inline-start: 38%;
    opacity: 0.7;
  }

  .portal-section {
    margin-inline: -18px;
    padding: 25px 18px 27px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .portal-intro {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .portal-intro > p {
    max-width: 350px;
    font-size: 0.75rem;
  }

  .portal-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    margin-inline: -18px;
    padding: 4px 18px 16px;
    scroll-padding-inline: 18px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .portal-grid::-webkit-scrollbar {
    display: none;
  }

  .reading-portal {
    flex: 0 0 min(78vw, 330px);
    min-height: 390px;
    scroll-snap-align: start;
  }

  .home-aside {
    grid-template-columns: 1fr;
  }

  .stat-row {
    border-radius: 15px;
  }

  .stat {
    padding: 13px 10px;
  }

  .section {
    padding: 21px 17px;
    border-radius: 21px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .reading-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reading-card {
    min-height: 225px;
    padding: 17px;
  }

  .reading-card h3 {
    font-size: 1.35rem;
  }

  .archive-hero {
    min-height: 430px;
    align-items: flex-end;
    margin-inline: -18px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .archive-hero > img {
    object-position: 64% center;
  }

  .archive-hero::before {
    background:
      linear-gradient(to top, rgba(4, 5, 12, 0.96) 0%, rgba(4, 5, 12, 0.66) 46%, rgba(4, 5, 12, 0.12) 78%),
      linear-gradient(90deg, rgba(4, 5, 12, 0.48), transparent 70%);
  }

  .archive-hero-copy {
    padding: 28px 22px 35px;
  }

  .archive-hero-copy h2 {
    font-size: 2.05rem;
  }

  .archive-orbits {
    right: -16%;
    top: 10%;
    width: 210px;
    margin-top: 0;
    opacity: 0.65;
  }

  .archive-item {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 11px;
  }

  .archive-thumb-stack {
    width: 58px;
    height: 70px;
  }

  .archive-thumb-stack img {
    width: 44px;
    height: 66px;
  }

  .archive-item .button {
    width: 38px;
    padding: 0;
    font-size: 0;
  }

  .archive-item .button::after {
    content: "›";
    font-size: 1.25rem;
  }

  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-menu {
    position: static;
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .settings-menu button {
    flex: 0 0 auto;
    padding: 0 15px;
  }

  .setting-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .segmented {
    justify-self: start;
  }

  .draw-intro {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .draw-progress {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 7px;
    text-align: left;
  }

  .draw-progress b {
    display: inline;
    font-size: 1.35rem;
  }

  .deck-stage {
    min-height: 515px;
    margin-inline: -18px;
    padding-block: 32px 27px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .deck {
    width: 100%;
    min-height: 235px;
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    padding: 23px calc(50% - 52px) 34px;
    scroll-padding-inline: calc(50% - 52px);
  }

  .deck-card {
    position: relative;
    flex-basis: 104px;
    width: 104px;
    transform: none;
  }

  .deck-card:hover,
  .deck-card:focus-visible {
    transform: translateY(-8px) scale(1.025);
  }

  .result-summary {
    grid-template-columns: 1fr;
  }

  .result-cards {
    gap: 8px;
  }

  .result-card-copy h3 {
    font-size: 0.92rem;
  }

  .result-card-copy p {
    font-size: 0.62rem;
  }

  .dialog-layer {
    align-items: end;
    padding: 0;
  }

  .dialog,
  .dialog.compact {
    width: 100%;
    max-height: 92vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }

  .card-detail {
    grid-template-columns: 1fr;
  }

  .card-detail > img {
    width: min(76%, 320px);
    margin: 0 auto;
  }

  .toast {
    bottom: calc(var(--mobile-nav-h) + 16px);
  }
}

@media (max-width: 430px) {
  .reading-grid {
    grid-template-columns: 1fr;
  }

  .reading-card {
    min-height: 230px;
  }

  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation: none !important;
  transition: none !important;
}
