/* ==========================================================================
   Mbbs Study Hub — portal styles
   Palette is taken from histology stains: each academic year owns one stain.
   ========================================================================== */

:root {
  --paper: #f4f3f8;
  --surface: #ffffff;
  --surface-2: #faf9fc;
  --ink: #17142a;
  --ink-2: #4a4663;
  --ink-3: #7d7996;
  --line: #e2dfec;
  --glass: rgba(255, 255, 255, .72);

  /* the four stains */
  --y1: #0b8a9c;  /* methylene blue */
  --y2: #5b3fb3;  /* hematoxylin   */
  --y3: #d23b78;  /* eosin         */
  --y4: #c4770f;  /* iodine        */
  --accent: var(--y2);

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --shadow-slide: 0 1px 0 rgba(255,255,255,.9) inset, 0 18px 40px -18px rgba(23,20,42,.35), 0 2px 6px rgba(23,20,42,.08);
  --shadow-pop: 0 20px 50px -20px rgba(23,20,42,.35);

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

html.dark {
  --paper: #100e1c;
  --surface: #191630;
  --surface-2: #1e1a38;
  --ink: #f1eff9;
  --ink-2: #bdb8d6;
  --ink-3: #8c87a9;
  --line: #2d2950;
  --glass: rgba(35, 31, 66, .72);
  --y1: #3cc4d8;
  --y2: #a18df0;
  --y3: #f27aa6;
  --y4: #f2a93f;
  --shadow-slide: 0 1px 0 rgba(255,255,255,.07) inset, 0 18px 40px -18px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.3);
  --shadow-pop: 0 20px 50px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

/* --accent follows the theme (brighter in dark mode); --ys is the fixed deep stain used behind white text */
[data-year="1"] { --accent: var(--y1); --ys: #0b8a9c; }
[data-year="2"] { --accent: var(--y2); --ys: #5b3fb3; }
[data-year="3"] { --accent: var(--y3); --ys: #d23b78; }
[data-year="4"] { --accent: var(--y4); --ys: #b36a0b; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, white); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .78rem 1.25rem; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { box-shadow: 0 10px 24px -10px var(--ink); }
.btn-accent { background: var(--ys, var(--y2)); color: #fff; }
.btn-accent:hover { box-shadow: 0 10px 24px -10px var(--ys, var(--y2)); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 22px; border-radius: 4px; position: relative; border: 1.5px solid var(--ink);
  background: linear-gradient(90deg, var(--surface) 0 34%, transparent 34%), radial-gradient(circle at 70% 55%, var(--y3) 0 4px, var(--y2) 5px 7px, transparent 8px); }
.nav { display: flex; gap: .25rem; margin-left: auto; align-items: center; }
.nav a, .nav button.link { padding: .5rem .85rem; border-radius: 999px; font-weight: 500; font-size: .93rem; color: var(--ink-2); background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button.link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.nav a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 9%, transparent); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-sun { display: none; } html.dark .theme-sun { display: block; } html.dark .theme-moon { display: none; }

.user-menu { position: relative; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 700; display: grid; place-items: center; border: 0; cursor: pointer; font-family: var(--font-display); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 10px); min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: .5rem; display: none; }
.menu-pop.open { display: block; }
.menu-pop .who { padding: .6rem .75rem .75rem; border-bottom: 1px solid var(--line); margin-bottom: .4rem; }
.menu-pop .who strong { display: block; font-family: var(--font-display); }
.menu-pop .who span { color: var(--ink-3); font-size: .85rem; word-break: break-all; }
.menu-pop button, .menu-pop a { display: block; width: 100%; text-align: left; padding: .6rem .75rem; border-radius: 8px; border: 0; background: none; cursor: pointer; font-size: .93rem; }
.menu-pop button:hover, .menu-pop a:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }

@media (max-width: 640px) { .nav a.hide-sm { display: none; } .site-header .wrap { gap: .75rem; } }

/* ---------- landing hero ---------- */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(56px, 8vw, 110px); position: relative; overflow: hidden; }
.hero::before { /* faint stained wash behind the slides */
  content: ""; position: absolute; right: -10%; top: -20%; width: 70%; aspect-ratio: 1; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--y3) 16%, transparent), transparent 70%),
              radial-gradient(closest-side at 30% 70%, color-mix(in srgb, var(--y2) 14%, transparent), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.6rem, 6.2vw, 5rem); font-weight: 800; letter-spacing: -.035em; line-height: .98; font-variation-settings: "wdth" 90; }
.hero .lede { margin-top: 1.4rem; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-2); max-width: 34rem; }
.hero .cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin-top: 2.6rem; color: var(--ink-2); font-size: .95rem; }
.hero-stats b { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); margin-right: .35rem; letter-spacing: -.02em; }

/* the glass-slide stack: the signature element, also the year navigator */
.slides { display: flex; flex-direction: column; gap: 14px; perspective: 1200px; }
.slide {
  --stain: var(--accent);
  position: relative; display: grid; grid-template-columns: 38% 1fr; min-height: 108px;
  border-radius: 8px; overflow: hidden; background: var(--glass);
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  box-shadow: var(--shadow-slide);
  transform: translateX(var(--shift, 0)) rotate(var(--rot, 0deg));
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.slide:hover, .slide:focus-visible { transform: translateX(calc(var(--shift, 0px) - 14px)) rotate(0deg); }
.slide .label { /* the frosted end of a real slide */
  padding: 14px 16px; background: repeating-linear-gradient(0deg, transparent 0 7px, color-mix(in srgb, var(--ink) 6%, transparent) 7px 8px), color-mix(in srgb, var(--surface) 85%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.slide .label strong { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -.02em; line-height: 1.05; }
.slide .label small { color: var(--ink-3); font-size: .8rem; }
.slide .tissue { position: relative; overflow: hidden; }
.slide .tissue::before, .slide .tissue::after { content: ""; position: absolute; border-radius: 50%; filter: blur(.4px); }
.slide .tissue::before { width: 62%; height: 150%; left: 14%; top: -25%; transform: rotate(var(--tilt, 18deg));
  background: radial-gradient(ellipse at 40% 40%, color-mix(in srgb, var(--stain) 90%, white 0%) 0 22%, color-mix(in srgb, var(--stain) 55%, transparent) 45%, transparent 70%); }
.slide .tissue::after { width: 38%; height: 90%; right: 6%; top: 18%; transform: rotate(calc(var(--tilt, 18deg) * -1.6));
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--stain) 70%, black 10%) 0 14%, color-mix(in srgb, var(--stain) 35%, transparent) 40%, transparent 68%); }
.slide .tissue i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--stain) 80%, black); opacity: .8; }
.slide::after { /* glass sheen */ content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, rgba(255,255,255,.35), transparent 32%, transparent 70%, rgba(255,255,255,.12)); }
html.dark .slide::after { background: linear-gradient(115deg, rgba(255,255,255,.1), transparent 32%); }
.slides .slide:nth-child(1) { --shift: 0px; --rot: -1.2deg; --tilt: 12deg; }
.slides .slide:nth-child(2) { --shift: 34px; --rot: .8deg; --tilt: -20deg; }
.slides .slide:nth-child(3) { --shift: 8px; --rot: -.6deg; --tilt: 30deg; }
.slides .slide:nth-child(4) { --shift: 42px; --rot: 1.1deg; --tilt: -8deg; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .slides .slide:nth-child(n) { --shift: 0px; }
}

/* ---------- landing sections ---------- */
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section-head { max-width: 40rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); letter-spacing: -.03em; }
.section-head p { margin-top: .9rem; color: var(--ink-2); font-size: 1.1rem; }

.year-row { display: grid; grid-template-columns: minmax(0, 20rem) 1fr; gap: 2rem 4rem; padding: 2rem 0; border-top: 2px solid var(--accent); }
.year-row h3 { font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--accent); letter-spacing: -.03em; }
.year-row .phase { color: var(--ink-3); font-size: .9rem; margin-top: .35rem; }
.year-row p.tag { margin-top: .9rem; color: var(--ink-2); max-width: 20rem; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; align-content: flex-start; }
.chip { display: inline-flex; align-items: baseline; gap: .55rem; padding: .55rem .95rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 500; }
.chip small { color: var(--ink-3); font-size: .8rem; font-weight: 400; }
@media (max-width: 760px) { .year-row { grid-template-columns: 1fr; gap: 1.2rem; } }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2rem 4rem; }
.features h3 { font-size: 1.2rem; letter-spacing: -.015em; margin-bottom: .4rem; }
.features p { color: var(--ink-2); max-width: 30rem; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

.cta-band { margin: 0 auto; padding: clamp(36px, 6vw, 72px); border-radius: var(--r-lg); background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: auto -10% -60% 40%; aspect-ratio: 1; background: radial-gradient(closest-side, color-mix(in srgb, var(--y3) 55%, transparent), transparent 70%); }
.cta-band > * { position: relative; }
.cta-band h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); max-width: 28rem; }
.cta-band p { margin: .8rem 0 1.6rem; opacity: .75; max-width: 30rem; }
.cta-band .btn-primary { background: var(--paper); color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--ink-3); font-size: .9rem; margin-top: 4rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }

/* ---------- login ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-art { background: var(--ink); color: var(--paper); padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(closest-side at 70% 30%, color-mix(in srgb, var(--y3) 60%, transparent), transparent 70%),
  radial-gradient(closest-side at 25% 75%, color-mix(in srgb, var(--y2) 70%, transparent), transparent 70%),
  radial-gradient(closest-side at 80% 85%, color-mix(in srgb, var(--y1) 45%, transparent), transparent 70%); opacity: .75; }
.auth-art > * { position: relative; }
.auth-art .brand-mark { border-color: var(--paper); }
.auth-art h1 { font-size: clamp(2rem, 3.6vw, 3.2rem); max-width: 22rem; letter-spacing: -.03em; }
.auth-art p { opacity: .8; margin-top: 1rem; max-width: 24rem; }
.auth-panel { position: relative; display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(420px, 100%); }
.auth-card h2 { font-size: 1.9rem; letter-spacing: -.025em; }
.auth-card .sub { color: var(--ink-2); margin: .5rem 0 1.6rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 999px; margin-bottom: 1.6rem; }
.tabs button { border: 0; background: none; padding: .6rem; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px -2px rgba(23,20,42,.25); }
.field { display: block; margin-bottom: 1rem; }
.field span { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .35rem; color: var(--ink-2); }
.field input { width: 100%; padding: .8rem .95rem; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.pw-wrap { position: relative; display: block; margin: 0; }
.pw-wrap input { padding-right: 4.2rem; }
.field .pw-wrap { font-size: inherit; font-weight: inherit; color: inherit; margin-bottom: 0; }
.pw-toggle { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: .35rem .6rem; font-size: .82rem; font-weight: 600; color: var(--accent); cursor: pointer; border-radius: 6px; }
.btn[disabled], .link-btn[disabled] { pointer-events: none; }
.divider { display: flex; align-items: center; gap: 1rem; color: var(--ink-3); font-size: .85rem; margin: 1.2rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { padding: .75rem .95rem; border-radius: 10px; font-size: .92rem; margin-bottom: 1rem; display: none; }
.msg.show { display: block; }
.msg.error { background: color-mix(in srgb, #d6334a 12%, var(--surface)); color: #b3162d; border: 1px solid color-mix(in srgb, #d6334a 35%, transparent); }
.msg.ok { background: color-mix(in srgb, #1a9c5c 12%, var(--surface)); color: #0e7a45; border: 1px solid color-mix(in srgb, #1a9c5c 35%, transparent); }
html.dark .msg.error { color: #ff8da0; } html.dark .msg.ok { color: #6fdca2; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.setup-box { background: var(--surface); border: 1px dashed var(--ink-3); border-radius: var(--r-md); padding: 1rem 1.2rem; margin-bottom: 1.2rem; font-size: .92rem; }
.setup-box code { background: color-mix(in srgb, var(--ink) 8%, transparent); padding: .1rem .4rem; border-radius: 4px; font-size: .85em; }
@media (max-width: 860px) { .auth-page { grid-template-columns: 1fr; } .auth-art { min-height: 220px; } .auth-art h1 { font-size: 1.8rem; } .auth-art p { display: none; } }

/* ---------- dashboard ---------- */
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); letter-spacing: -.035em; }
.page-head p { color: var(--ink-2); margin-top: .5rem; }

.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin: 1.8rem 0; }
.glance div { background: var(--surface); padding: 1rem 1.2rem; }
.glance b { display: block; font-family: var(--font-display); font-size: 1.9rem; letter-spacing: -.03em; }
.glance span { color: var(--ink-3); font-size: .88rem; }
@media (max-width: 680px) { .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.resume { display: flex; align-items: center; gap: 1.2rem; justify-content: space-between; flex-wrap: wrap; padding: 1.1rem 1.4rem; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--accent); margin-bottom: 1.8rem; }
.resume h3 { font-size: 1.15rem; }
.resume p { color: var(--ink-2); font-size: .93rem; margin-top: .15rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin: 2.2rem 0 1.4rem; position: sticky; top: 64px; z-index: 20; padding: .7rem 0; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.year-tabs { display: flex; gap: .45rem; flex-wrap: wrap; }
.year-tab { --c: var(--ink); display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .95rem; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--ink-2); }
.year-tab::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.year-tab[data-year="1"] { --c: var(--y1); } .year-tab[data-year="2"] { --c: var(--y2); } .year-tab[data-year="3"] { --c: var(--y3); } .year-tab[data-year="4"] { --c: var(--y4); }
.year-tab[data-year="all"]::before { background: conic-gradient(var(--y1), var(--y2), var(--y3), var(--y4), var(--y1)); }
.year-tab[aria-pressed="true"] { border-color: var(--c); color: var(--ink); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.search { position: relative; }
.search input { padding: .6rem 1rem .6rem 2.4rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); width: 260px; max-width: 100%; }
.search input:focus { outline: none; border-color: var(--accent); }
.search svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }

.year-block { margin-bottom: 3rem; scroll-margin-top: 150px; }
.year-block > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem; padding-bottom: .8rem; border-bottom: 2px solid var(--accent); margin-bottom: 1.2rem; }
.year-block h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--accent); letter-spacing: -.03em; }
.year-block header span { color: var(--ink-3); font-size: .95rem; }
.subj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.subj { display: grid; grid-template-columns: 76px 1fr; border-radius: 10px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s, border-color .2s; }
.subj:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.subj .mono { display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.03em; color: #fff; position: relative;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--ys) 60%, white), transparent 55%), radial-gradient(circle at 75% 80%, color-mix(in srgb, var(--ys) 100%, black 30%), transparent 60%), var(--ys); }
.subj .body { padding: .95rem 1.1rem 1rem; min-width: 0; }
.subj h3 { font-size: 1.12rem; letter-spacing: -.015em; }
.subj .meta { color: var(--ink-3); font-size: .85rem; margin-top: .25rem; }
.bar { height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 10%, transparent); margin-top: .8rem; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.subj .pct { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-3); margin-top: .35rem; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--ink-2); border: 1.5px dashed var(--line); border-radius: var(--r-md); }

/* ---------- subject page ---------- */
.subject-hero { background: var(--ys); color: #fff; position: relative; overflow: hidden; padding: 36px 0 44px; }
.subject-hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(ellipse 60% 90% at 100% 0%, rgba(255,255,255,.2), transparent 70%),
  radial-gradient(ellipse 70% 80% at 40% 130%, rgba(0,0,0,.25), transparent 70%); }
.subject-hero .wrap { position: relative; }
.crumbs { display: flex; gap: .5rem; font-size: .92rem; opacity: .85; margin-bottom: 1.2rem; flex-wrap: wrap; }
.crumbs a:hover { text-decoration: underline; }
.subject-hero h1 { font-size: clamp(2.2rem, 5.4vw, 4rem); letter-spacing: -.035em; font-weight: 800; max-width: 22ch; }
.subject-hero .stats { display: flex; flex-wrap: wrap; gap: .4rem 2rem; margin-top: 1.2rem; opacity: .95; }
.subject-hero .stats b { font-family: var(--font-display); font-size: 1.4rem; margin-right: .3rem; }
.subject-hero .actions { margin-top: 1.8rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.subject-hero .btn-light { background: #fff; color: #17142a; }
.subject-hero .btn-line { border-color: rgba(255,255,255,.6); color: #fff; }
.subject-hero .btn-line:hover { background: rgba(255,255,255,.14); }
.ring { margin-left: auto; display: flex; align-items: center; gap: .9rem; }
.ring svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: rgba(255,255,255,.28); } .ring .val { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .8s; }
.ring div { line-height: 1.2; } .ring b { font-family: var(--font-display); font-size: 1.5rem; display: block; }
.ring span { font-size: .85rem; opacity: .85; }

.chapters { display: grid; gap: 10px; margin-top: 1rem; }
.chapter { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; overflow: hidden; }
.chapter summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .9rem; align-items: center; padding: .85rem 1.1rem; }
.chapter summary::-webkit-details-marker { display: none; }
.chapter summary:hover { background: var(--surface-2); }
.chapter .idx { font-family: var(--font-display); font-weight: 700; color: var(--accent); font-size: 1.1rem; }
.chapter .name { font-weight: 600; }
.chapter .sub { color: var(--ink-3); font-size: .85rem; }
.chapter .right { display: flex; align-items: center; gap: .9rem; }
.chapter .mini { width: 90px; } .chapter .mini .bar { margin: 0; }
.chapter .chev { width: 16px; height: 16px; color: var(--ink-3); transition: transform .2s; }
.chapter[open] .chev { transform: rotate(90deg); }
.chapter .tests { border-top: 1px solid var(--line); padding: .4rem; display: grid; gap: 2px; background: var(--surface-2); }
.test-row { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; padding: .6rem .75rem; border-radius: 8px; font-size: .93rem; }
.test-row:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.test-row small { color: var(--ink-3); }
.badge { font-size: .78rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink-2); }
.badge.done { background: color-mix(in srgb, #1a9c5c 18%, transparent); color: #0e7a45; }
html.dark .badge.done { color: #6fdca2; }
.badge.prog { background: color-mix(in srgb, var(--y4) 20%, transparent); color: var(--y4); }
.sub-chapter { padding: .2rem .4rem .4rem 1.2rem; }
.sub-chapter h4 { font-size: .9rem; color: var(--ink-3); padding: .6rem .75rem .2rem; font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }
@media (max-width: 560px) { .chapter .mini { display: none; } .test-row { grid-template-columns: 1fr auto; } .test-row small { display: none; } }

.loading { padding: 4rem 0; text-align: center; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) rotate(var(--rot, 0)); } to { opacity: 1; } }
.slides .slide { animation: rise .7s cubic-bezier(.2,.8,.2,1) backwards; }
.slides .slide:nth-child(2) { animation-delay: .08s; } .slides .slide:nth-child(3) { animation-delay: .16s; } .slides .slide:nth-child(4) { animation-delay: .24s; }


/* ---------- minimal back button (used on every inner page) ---------- */
.back-btn {
  display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .95rem .45rem .6rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .9rem/1 var(--font-body);
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
}
.back-btn svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.back-btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.back-btn:active { transform: scale(.97); }
.subject-hero .back-btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.34); color: #fff; margin-bottom: 1.3rem; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.subject-hero .back-btn svg { color: #fff; }
.subject-hero .back-btn:hover { background: rgba(255,255,255,.24); border-color: rgba(255,255,255,.5); }
.auth-panel .back-btn { position: absolute; top: 18px; left: 18px; }


/* ---------- about page ---------- */
.site-footer a { text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--ink); }

.about-hero { padding: clamp(40px, 7vw, 88px) 0 clamp(24px, 4vw, 48px); position: relative; overflow: hidden; }
.about-hero::before { content: ""; position: absolute; right: -12%; top: -40%; width: 60%; aspect-ratio: 1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--y2) 16%, transparent), transparent 70%),
              radial-gradient(closest-side at 30% 70%, color-mix(in srgb, var(--y3) 12%, transparent), transparent 70%); }
.about-hero .wrap { position: relative; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1rem; }
.about-hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); font-weight: 800; letter-spacing: -.035em; line-height: 1; max-width: 18ch; }
.about-hero .lede { margin-top: 1.2rem; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 38rem; }

.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.person { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--r-lg); padding: clamp(1.4rem, 3vw, 2.2rem); display: flex; flex-direction: column; gap: 1rem; box-shadow: var(--shadow-slide); }
.person-top { display: flex; align-items: center; gap: 1rem; }
.person-avatar { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--ys); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; }
.person-role { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.person h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.03em; margin-top: .15rem; }
.person .handle { display: inline-block; margin-top: .2rem; color: var(--ink-2); font-weight: 500; }
a.handle:hover { color: var(--accent); }
.person p { color: var(--ink-2); }
.person-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: auto; padding-top: .4rem; }
.person-links .chip { transition: border-color .15s ease, transform .15s ease; }
.person-links a.chip:hover { border-color: var(--accent); transform: translateY(-1px); }
@media (max-width: 760px) { .people { grid-template-columns: 1fr; } }
