/* StudyRoom for Canvas — Notion Workspace Layout
   Fixed 248px warm paper sidebar (#F7F7F5) + calm pure-white document pane (#FFFFFF)
   Zero heavy cards, zero drop-shadow clutter, whisper hairlines */

@font-face {
  font-family: "SR Geist";
  src: url("assets/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --rail: #f7f7f5;
  --surface: #ffffff;
  --hover: rgba(55, 53, 47, 0.055);
  --active: rgba(55, 53, 47, 0.085);
  --ink: #2f2e2b;
  --ink-2: #5b5955;
  --muted: #787774;
  --line: rgba(55, 53, 47, 0.09);
  --line-strong: rgba(55, 53, 47, 0.16);

  --accent: #2383e2;
  --accent-hover: #0070d2;
  --accent-soft: rgba(35, 131, 226, 0.08);

  --cta-bg: #2f2e2b;
  --cta-hover: #1a1918;
  --cta-ink: #ffffff;

  --r-sm: 5px;
  --r-md: 6px;
  --r-lg: 8px;
  --rail-w: 248px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #191919;
  --rail: #202020;
  --surface: #202020;
  --hover: rgba(255, 255, 255, 0.06);
  --active: rgba(255, 255, 255, 0.1);
  --ink: rgba(255, 255, 255, 0.88);
  --ink-2: rgba(255, 255, 255, 0.65);
  --muted: rgba(255, 255, 255, 0.45);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  --accent: #529cca;
  --accent-hover: #7cc0eb;
  --accent-soft: rgba(82, 156, 202, 0.14);

  --cta-bg: rgba(255, 255, 255, 0.9);
  --cta-hover: #ffffff;
  --cta-ink: #191919;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "SR Geist", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
.view[hidden], [hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  padding: 8px 14px; border-radius: var(--r-sm);
  background: var(--cta-bg); color: var(--cta-ink);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.skip:focus { left: 16px; z-index: 200; }

/* ---------- Notion Two-Pane Shell ---------- */

.shell {
  min-height: 100vh;
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 12px 14px;
  border-right: 1px solid var(--line);
  background: var(--rail);
}

.rail__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark {
  /* flex, not grid: "sr" and the dot stay on one line */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #141414;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
html[data-theme="dark"] .brand__mark {
  background: #f5f5f5;
  color: #141414;
}
.brand__word {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
}
.brand__dot { color: #e06b24; font-weight: 700; }
.brand--mobile { display: none; }

.theme-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.theme-btn:hover { background: var(--hover); color: var(--ink); }
.theme-btn--mobile { display: none; }

.rail__cta { padding: 0 2px; }

.rail__nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 16px;
}

.rail__group { display: grid; gap: 2px; }
.rail__label {
  margin: 0 0 4px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.rail__link {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 31px;
  padding: 0 8px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.rail__link svg { flex: none; opacity: 0.78; }
.rail__link:hover { background: var(--hover); color: var(--ink); }
.rail__link[aria-current="page"] {
  background: var(--active);
  color: var(--ink);
  font-weight: 600;
}
.rail__link[aria-current="page"] svg { opacity: 1; }

.rail__foot {
  display: grid;
  gap: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.rail__blurb {
  margin: 0 0 6px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.fb-trigger {
  color: var(--accent) !important;
  font-weight: 550;
}
.fb-trigger svg { opacity: 1; color: var(--accent); }
.fb-trigger:hover,
.fb-trigger[aria-current="page"] {
  background: var(--accent-soft) !important;
  color: var(--accent-hover) !important;
}
.fb-trigger__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  margin-left: auto;
}

/* ---------- Right Workspace + Top Breadcrumb Bar ---------- */

.workspace {
  margin-left: var(--rail-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 48px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}
.topbar__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__right { display: flex; align-items: center; gap: 6px; }
.mobile-nav { display: none; align-items: center; gap: 2px; }

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}
.crumb__sep { opacity: 0.45; }
.crumb__cur { color: var(--ink); font-weight: 550; }

/* ---------- Centered Notion Document Column ---------- */

.page {
  width: min(760px, calc(100% - 56px));
  margin-inline: auto;
  padding: 44px 0 64px;
  flex: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease);
}
.btn:hover { background: var(--hover); }
.btn--primary {
  border-color: transparent;
  background: var(--cta-bg);
  color: var(--cta-ink);
  font-weight: 550;
}
.btn--primary:hover { background: var(--cta-hover); color: var(--cta-ink); }
.btn--subtle { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--subtle:hover { background: var(--hover); color: var(--ink); }
.btn--block { width: 100%; height: 32px; font-size: 13px; }

/* ---------- Overview Page ---------- */

.hero { padding-bottom: 44px; }
.kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.page-title {
  margin: 0 0 12px;
  font-size: clamp(30px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.12;
}
.page-lead {
  margin: 0 0 20px;
  max-width: 60ch;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.65;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.hero__note {
  margin: 12px 0 28px;
  color: var(--muted);
  font-size: 12.5px;
}

/* Carousel */
.carousel { display: grid; gap: 10px; }
.carousel__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.carousel__meta { display: inline-flex; align-items: baseline; gap: 10px; min-width: 0; }
.carousel__count { font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.carousel__caption { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carousel__nav { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.carousel__dots { display: inline-flex; align-items: center; gap: 4px; margin-right: 4px; }
.carousel__dot {
  width: 12px; height: 3px; padding: 0; border: 0; border-radius: 2px;
  background: var(--line-strong); cursor: pointer;
  transition: width 200ms var(--ease), background-color 160ms var(--ease);
}
.carousel__dot[aria-current="true"] { width: 24px; background: var(--ink); }
.carousel__btn {
  display: grid; place-items: center;
  width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--bg); color: var(--ink); cursor: pointer;
}
.carousel__btn:hover { background: var(--hover); }

.carousel__viewport {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--rail);
}
.carousel__track {
  display: flex;
  transition: transform 380ms var(--ease);
  will-change: transform;
}
.carousel__slide { flex: 0 0 100%; min-width: 100%; aspect-ratio: 16 / 10; }
.carousel__slide .zoomable { height: 100%; }
.carousel__slide img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.zoomable {
  display: block; width: 100%; padding: 0; border: 0;
  background: transparent; cursor: zoom-in; position: relative;
}
.zoomable::after {
  content: "Expand";
  position: absolute; right: 10px; bottom: 10px;
  padding: 3px 9px; border-radius: var(--r-sm);
  background: rgba(20, 20, 20, 0.78); color: #ffffff;
  font-size: 11px; font-weight: 550;
  opacity: 0; pointer-events: none;
  transition: opacity 150ms var(--ease);
}
.zoomable:hover::after, .zoomable:focus-visible::after { opacity: 1; }
.zoomable--dark { display: grid; place-items: center; padding: 16px; background: #14171f; }
.zoomable--dark img { width: auto; max-height: 280px; border-radius: 6px; }

/* Sections */
.block {
  padding: 38px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 64px;
}
.block--last { padding-bottom: 12px; }
.block__h {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.block__sub {
  margin: 0 0 22px;
  max-width: 60ch;
  color: var(--ink-2);
  font-size: 14.5px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 32px;
}
.prose { display: grid; gap: 10px; align-content: start; }
.prose h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.prose p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.65; }
.plain-list { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 6px; color: var(--ink-2); font-size: 14px; }

/* Swatches */
.swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.swatch {
  display: grid; gap: 10px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg);
}
.swatch__preview {
  display: grid; grid-template-columns: 26% 1fr; gap: 5px;
  height: 64px; padding: 6px;
  border-radius: var(--r-sm); border: 1px solid rgba(15, 15, 15, 0.08);
  background: var(--sw-bg);
}
.swatch__rail { border-radius: 3px; background: var(--sw-rail); padding: 4px 3px; display: grid; gap: 3px; align-content: start; }
.swatch__rail i { display: block; height: 3px; border-radius: 2px; background: var(--sw-accent); opacity: 0.85; }
.swatch__rail i:nth-child(2) { width: 70%; background: var(--sw-ink); opacity: 0.22; }
.swatch__rail i:nth-child(3) { width: 55%; background: var(--sw-ink); opacity: 0.16; }
.swatch__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-content: start; }
.swatch__card { height: 21px; border-radius: 3px; background: var(--sw-card); border: 1px solid var(--sw-line); }
.swatch__card--wide { grid-column: 1 / -1; height: 18px; }
.swatch__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.swatch__name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.swatch__hex { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.swatch--paper { --sw-bg: #f6f3ed; --sw-rail: #ebe5db; --sw-card: #ffffff; --sw-ink: #1c1917; --sw-accent: #2563eb; --sw-line: rgba(28, 25, 23, 0.1); }
.swatch--sage { --sw-bg: #edf3ed; --sw-rail: #dfeae0; --sw-card: #ffffff; --sw-ink: #1f2e24; --sw-accent: #2f7d57; --sw-line: rgba(31, 46, 36, 0.1); }
.swatch--blossom { --sw-bg: #f8eff2; --sw-rail: #efe0e6; --sw-card: #ffffff; --sw-ink: #361f29; --sw-accent: #be3e6b; --sw-line: rgba(54, 31, 41, 0.1); }
.swatch--cozy { --sw-bg: #181614; --sw-rail: #12100f; --sw-card: #24211e; --sw-ink: #f4f1ec; --sw-accent: #60a5fa; --sw-line: rgba(255, 255, 255, 0.1); }

/* Quiet inline facts */
.facts {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--rail);
}
.fact { display: grid; gap: 2px; }
.fact__num { font-size: 22px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fact__label { font-size: 12px; color: var(--muted); line-height: 1.35; }

/* Study tool cards */
.tool-card { display: grid; gap: 10px; align-content: start; }
.tool-card__frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--rail);
}
.tool-card__frame img { width: 100%; height: auto; }
.tool-card__frame .zoomable--dark img { width: auto; max-width: 100%; height: auto; max-height: 280px; }
.tool-card h3 { margin: 2px 0 0; font-size: 15px; font-weight: 600; }
.tool-card p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.6; }

/* Quiet Callout */
.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--rail);
}
.callout__copy { display: grid; gap: 6px; max-width: 46ch; }
.callout__copy h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.callout__copy p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.callout__btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Document Views (#/feedback, #/privacy, #/legal) ---------- */

.doc__head {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
.doc__head h1 {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.doc__meta { margin: 0; color: var(--muted); font-size: 13.5px; }

.doc__rows { display: grid; }
.doc__row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.doc__row:last-child { border-bottom: 0; }
.doc__label { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); padding-top: 2px; }
.doc__body { display: grid; gap: 10px; }
.doc__body p, .doc__body li { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.65; }
.doc__body ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.doc__body code { padding: 1px 5px; border-radius: 4px; background: var(--rail); color: var(--ink); font-size: 13px; }

/* Feedback View */
.fb-note {
  margin: 22px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--rail);
  display: grid;
  gap: 6px;
}
.fb-note p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.fb-note__alt { font-size: 12.5px !important; color: var(--muted) !important; }
.fb-note__alt a { color: var(--ink); text-decoration: underline; }
.fb-note__alt a:hover { color: var(--accent); }

.fb-embed-card {
  padding: 16px 20px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #ffffff;
  color-scheme: light;
  overflow: hidden;
}
.fb-embed { display: block; width: 100%; min-height: 700px; border: 0; background: transparent; }

/* Footer */
.foot {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.foot__legal { margin: 0; max-width: 52ch; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.foot__links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); }
.foot__links a { text-decoration: none; }
.foot__links a:hover { color: var(--ink); text-decoration: underline; }

/* Lightbox */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-rows: auto 1fr auto; align-items: center;
  padding: 20px 28px;
  background: rgba(15, 15, 15, 0.9);
  backdrop-filter: blur(8px);
  color: #f8fafc;
}
.lightbox__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1240px; width: 100%; margin-inline: auto; }
.lightbox__title { font-size: 13.5px; font-weight: 500; color: rgba(248, 250, 252, 0.85); }
.lightbox__close {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.08); color: #ffffff;
  font-size: 13px; font-weight: 550; cursor: pointer;
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.16); }
.lightbox__stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; max-width: 1280px; width: 100%; margin-inline: auto; min-height: 0; }
.lightbox__img-wrap { display: grid; place-items: center; min-height: 0; max-height: 80vh; }
.lightbox__img { max-width: 100%; max-height: 80vh; width: auto; height: auto; border-radius: var(--r-lg); }
.lightbox__arrow {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.08); color: #ffffff; cursor: pointer;
}
.lightbox__arrow:hover { background: rgba(255, 255, 255, 0.18); }
.lightbox__foot { text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, 0.6); font-variant-numeric: tabular-nums; }

/* Responsive (collapses sidebar cleanly on mobile / narrow screens) */
@media (max-width: 880px) {
  .rail { display: none; }
  .workspace { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .brand--mobile, .theme-btn--mobile, .mobile-nav { display: inline-flex; }
  .crumb { display: none; }
  .page { width: calc(100% - 32px); padding: 28px 0 48px; }
  .two-col { grid-template-columns: 1fr; }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc__row { grid-template-columns: 1fr; gap: 6px; }
  .fb-embed-card { padding: 12px 12px 6px; }
}

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