/* Ranker Faculty public homepage. Home v3 tokens (homepage only in Phase A).
   Light is the base; html[data-theme="dark"] is set before first paint by the shared theme contract.
   Visitors without JavaScript get the device setting through the prefers-color-scheme block. */

/* Local fallbacks sized to the web fonts (text widths measured in Chrome and WebKit, 26 Sep 2026), so the
   swap from fallback to web font barely moves anything and a blocked font never overflows a line.
   Archivo 75% bold is 0.81x Arial Bold and 1.013x Arial Narrow Bold; Inter is 1.065x Arial; Georgia already
   matches Newsreader. */
@font-face { font-family: 'Archivo Narrow Fallback'; src: local('Arial Narrow Bold'), local('ArialNarrow-Bold'); font-weight: 100 900; size-adjust: 98.7%; }
@font-face { font-family: 'Archivo Fallback'; src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'), local('Helvetica-Bold'), local('Roboto Bold'), local('Roboto-Bold'), local('Roboto'); font-weight: 100 900; size-adjust: 81%; }
@font-face { font-family: 'Inter Fallback'; src: local('Arial'), local('ArialMT'), local('Helvetica'), local('Roboto'), local('Roboto-Regular'); font-weight: 100 550; size-adjust: 106.5%; }
@font-face { font-family: 'Inter Fallback'; src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'), local('Helvetica-Bold'), local('Roboto Bold'), local('Roboto-Bold'); font-weight: 551 900; size-adjust: 106.5%; }

:root {
  color-scheme: light;
  --rf-page: #F5F6F8; --rf-header: rgba(245,246,248,.95); --rf-card: #FFFFFF; --rf-card-edge: #D5DBE0;
  --rf-stage: #EEF1F4; --rf-grid: #E1E6EA; --rf-grid2: #E1E6EA; --rf-well: #EEF1F4; --rf-float: #FFFFFF; --rf-float-line: #E3E7EB;
  --rf-cell: #FFFFFF; --rf-chip: #FFFFFF; --rf-raised-2: #EEF1F4; --rf-hover: #E9EDF1; --rf-tint: #E9F4EE;
  --rf-line: #E3E7EB; --rf-line-soft: #E3E7EB; --rf-line-strong: #C4CBD2; --rf-field: #7C8792;
  --rf-text: #20262C; --rf-text-2: #3A434C; --rf-text-strong: #111820; --rf-muted: #5A6570; --rf-faint: #5A6570;
  --rf-accent: #176852; --rf-primary: #176852; --rf-on-primary: #FFFFFF; --rf-primary-hover: #125A46;
  --rf-link: #3159A8; --rf-link-hover: #24478A; --rf-highlight: #3159A8; --rf-warn: #8A5A12; --rf-blue: #3159A8;
  --rf-marquee: #D5DBE0; --rf-chip-on-bg: #20262C; --rf-chip-on-fg: #FFFFFF; --rf-logo-ring: #E3E7EB; --rf-sh: rgba(16,24,32,.16);
  --rf-pro-bg: #E9F4EE; --rf-pro-fg: #20262C; --rf-pro-muted: #5A6570; --rf-pro-line: #176852; --rf-pro-border: #176852;
  --rf-pro-badge-bg: #176852; --rf-pro-badge-fg: #FFFFFF;
  --display: 'Archivo', 'Archivo Narrow Fallback', 'Archivo Fallback', 'Arial Narrow', sans-serif; --body: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace; --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --gutter: clamp(20px, 4vw, 48px);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --rf-page: #0A0D0C; --rf-header: rgba(10,13,12,.95); --rf-card: #111614; --rf-card-edge: #232B28;
  --rf-stage: #0F1412; --rf-grid: #18201D; --rf-grid2: #161D1A; --rf-well: #0E1311; --rf-float: #141A18; --rf-float-line: #2A3430;
  --rf-cell: #161C1A; --rf-chip: #1B2320; --rf-raised-2: #1B2320; --rf-hover: #161C1A; --rf-tint: #16201C;
  --rf-line: #232B28; --rf-line-soft: #1A211E; --rf-line-strong: #2C3632; --rf-field: #5F6B66;
  --rf-text: #EEF3F0; --rf-text-2: #C9D3CE; --rf-text-strong: #FFFFFF; --rf-muted: #9BA7A1; --rf-faint: #8A9690;
  --rf-accent: #86F7B8; --rf-primary: #86F7B8; --rf-on-primary: #062117; --rf-primary-hover: #B5FBD2;
  --rf-link: #86F7B8; --rf-link-hover: #B5FBD2; --rf-highlight: #86F7B8; --rf-warn: #F2C38B; --rf-blue: #8FB0FF;
  --rf-marquee: #2A3531; --rf-chip-on-bg: #EEF3F0; --rf-chip-on-fg: #0A0D0C; --rf-logo-ring: transparent; --rf-sh: rgba(0,0,0,.7);
  --rf-pro-bg: #86F7B8; --rf-pro-fg: #062117; --rf-pro-muted: #2E6B55; --rf-pro-line: #062117; --rf-pro-border: #86F7B8;
  --rf-pro-badge-bg: #062117; --rf-pro-badge-fg: #86F7B8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --rf-page: #0A0D0C; --rf-header: rgba(10,13,12,.95); --rf-card: #111614; --rf-card-edge: #232B28;
    --rf-stage: #0F1412; --rf-grid: #18201D; --rf-grid2: #161D1A; --rf-well: #0E1311; --rf-float: #141A18; --rf-float-line: #2A3430;
    --rf-cell: #161C1A; --rf-chip: #1B2320; --rf-raised-2: #1B2320; --rf-hover: #161C1A; --rf-tint: #16201C;
    --rf-line: #232B28; --rf-line-soft: #1A211E; --rf-line-strong: #2C3632; --rf-field: #5F6B66;
    --rf-text: #EEF3F0; --rf-text-2: #C9D3CE; --rf-text-strong: #FFFFFF; --rf-muted: #9BA7A1; --rf-faint: #8A9690;
    --rf-accent: #86F7B8; --rf-primary: #86F7B8; --rf-on-primary: #062117; --rf-primary-hover: #B5FBD2;
    --rf-link: #86F7B8; --rf-link-hover: #B5FBD2; --rf-highlight: #86F7B8; --rf-warn: #F2C38B; --rf-blue: #8FB0FF;
    --rf-marquee: #2A3531; --rf-chip-on-bg: #EEF3F0; --rf-chip-on-fg: #0A0D0C; --rf-logo-ring: transparent; --rf-sh: rgba(0,0,0,.7);
    --rf-pro-bg: #86F7B8; --rf-pro-fg: #062117; --rf-pro-muted: #2E6B55; --rf-pro-line: #062117; --rf-pro-border: #86F7B8;
    --rf-pro-badge-bg: #062117; --rf-pro-badge-fg: #86F7B8;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--rf-page); color: var(--rf-text); font: 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; transition: background-color .3s, color .3s; }
.page { min-height: 100vh; overflow-x: clip; }
a { color: var(--rf-link); text-decoration: none; }
a:hover { color: var(--rf-link-hover); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--rf-highlight); outline-offset: 3px; }
main:focus { outline: none; }
img, svg { display: block; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--rf-primary); color: var(--rf-on-primary); padding: 10px 16px; border-radius: 99px; font-weight: 700; }
.skip:focus { top: 12px; color: var(--rf-on-primary); }
.wrap { max-width: 1320px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.display { font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; letter-spacing: -0.01em; line-height: .95; }
.label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--rf-muted); }
.faint { color: var(--rf-faint); }
.accent { color: var(--rf-accent); }
.small { font-size: 14px; }
.balance { text-wrap: balance; }
.m { white-space: nowrap; }
math { font-size: 1.04em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 12px 22px; border-radius: 99px; border: 1px solid transparent; font-size: 15px; font-weight: 700; line-height: 1.2; text-align: center; transition: background-color .2s, border-color .2s, color .2s; }
.btn-primary { background: var(--rf-primary); color: var(--rf-on-primary); }
.btn-primary:hover { background: var(--rf-primary-hover); color: var(--rf-on-primary); }
.btn-outline { border-color: var(--rf-line-strong); color: var(--rf-text); background: transparent; font-weight: 600; }
.btn-outline:hover { border-color: var(--rf-highlight); color: var(--rf-text-strong); }
.btn-sm { min-height: 40px; padding: 10px 18px; font-size: 14px; }
.btn-lg { padding: 17px 28px; font-size: 16px; }
.btn-xl { padding: 20px 36px; font-size: 18px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.round-btn { width: 44px; height: 44px; padding: 0; border-radius: 99px; border: 1px solid var(--rf-line-strong); background: transparent; color: var(--rf-text); display: grid; place-items: center; flex-shrink: 0; transition: border-color .2s; }
.round-btn:hover { border-color: var(--rf-highlight); }
.tag { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 99px; border: 1px solid var(--rf-line-strong); color: var(--rf-muted); margin-left: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--rf-header); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--rf-line-soft); }
.header-in { height: 68px; display: flex; align-items: center; gap: clamp(10px, 2.4vw, 32px); }
.brand { display: flex; align-items: center; gap: clamp(8px, 2vw, 12px); color: var(--rf-text); min-width: 0; }
.brand:hover { color: var(--rf-text); }
.logo-tile { width: 38px; height: 38px; border-radius: 10px; background: #FFFFFF; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 0 0 1px var(--rf-logo-ring); }
.logo-tile img { width: 32px; height: 32px; }
.logo-tile.lg { width: 56px; height: 56px; border-radius: 14px; }
.logo-tile.lg img { width: 44px; height: 44px; }
.wordmark { font-family: var(--display); font-weight: 800; font-stretch: 85%; font-size: clamp(13px, 4.2vw, 19px); letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; }
.nav-wide { display: none; gap: 2px; flex: 1; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav-wide a { padding: 9px 12px; border-radius: 99px; color: var(--rf-text-2); }
.nav-wide a:hover { background: var(--rf-hover); color: var(--rf-text-strong); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.theme-btn { width: 40px; height: 40px; }
:root[data-theme="dark"] .i-moon, :root:not([data-theme="dark"]) .i-sun { display: none; }
.hdr-link { display: none; align-items: center; padding: 10px 12px; border-radius: 99px; color: var(--rf-text); font-size: 14px; font-weight: 600; white-space: nowrap; }
.hdr-link:hover { color: var(--rf-text-strong); background: var(--rf-hover); }
.start-free { display: none; }
.menu-btn { display: none; }
.js .menu-btn { display: grid; }
html:not(.js) .theme-btn { display: none; }
html:not(.js) .start-free { display: inline-flex; }
.bars { position: relative; width: 18px; height: 10px; display: block; }
.bars span { position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s; }
.bars span:first-child { top: 0; }
.bars span:last-child { top: 8px; }
.menu-btn[aria-expanded="true"] .bars span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars span:last-child { transform: translateY(-4px) rotate(-45deg); }
.menu { position: absolute; left: 0; right: 0; top: 100%; background: var(--rf-page); border-bottom: 1px solid var(--rf-line-soft); box-shadow: 0 24px 48px -24px var(--rf-sh); animation: rfIn .22s ease-out; max-height: calc(100vh - 68px); overflow-y: auto; }
.menu-in { display: flex; flex-direction: column; padding-top: 4px; padding-bottom: 24px; }
.menu-link { padding: 16px 0; border-bottom: 1px solid var(--rf-line); font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 30px; line-height: 1; text-transform: uppercase; color: var(--rf-text); }
.menu-link:hover { color: var(--rf-accent); }
.menu-actions { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; }
.menu-actions .btn { width: 100%; padding: 15px 20px; font-size: 16px; }
@media (min-width: 560px) { .start-free { display: inline-flex; } }
@media (min-width: 1280px) {
  .nav-wide, .hdr-link { display: flex; }
  .js .menu-btn { display: none; }
  .menu { display: none; }
}

/* Returning-teacher banner */
.resume { display: none; background: var(--rf-tint); border-bottom: 1px solid var(--rf-line); }
html[data-saved] .resume { display: block; }
html[data-saved="papers"] .resume-link[data-for="planner"], html[data-saved="planner"] .resume-link[data-for="papers"] { display: none; }
.resume-in { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; font-size: 15px; }

/* Hero */
.hero { position: relative; }
.hero-copy { padding-top: clamp(48px, 7vw, 96px); padding-bottom: 48px; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
.pill-solid { background: var(--rf-primary); color: var(--rf-on-primary); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .1em; padding: 6px 10px; border-radius: 99px; }
.h1 { font-size: clamp(50px, 9vw, 128px); letter-spacing: -0.015em; }
.h1-vis, .h1-line { display: block; }
.rotator { display: block; height: .95em; overflow: hidden; color: var(--rf-accent); }
.rotator-track { display: block; transition: transform .7s cubic-bezier(.75,0,.2,1); }
.rotator-track > span { display: block; height: .95em; white-space: nowrap; text-transform: none; }
/* Each word shrinks only when it would not fit the line (320 px phones, or a wider fallback font). */
.rotator-track .w { font-size: min(1em, calc((100vw - 2 * var(--gutter)) / 6.4)); }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 32px; flex-wrap: wrap; margin-top: 36px; }
.hero-text { max-width: 580px; display: flex; flex-direction: column; gap: 12px; }
.lead { font-size: 18px; line-height: 1.6; color: var(--rf-muted); text-wrap: pretty; }
.lead-note { font-size: 15px; line-height: 1.55; color: var(--rf-text-2); }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.stage { position: relative; height: clamp(470px, 46vw, 600px); border-radius: 32px; background-color: var(--rf-stage); background-image: linear-gradient(var(--rf-grid) 1px, transparent 1px), linear-gradient(90deg, var(--rf-grid) 1px, transparent 1px); background-size: 36px 36px; border: 1px solid var(--rf-line); overflow: hidden; }
.paper { background: #FFFFFF; color: #111111; font-family: var(--serif); }
.paper-head { text-align: center; border-bottom: 2px solid #111111; padding-bottom: 10px; margin-bottom: 14px; }
.paper-inst { font-size: 19px; font-weight: 600; line-height: 1.3; }
.paper-inst.sm { font-size: 17px; }
.paper-inst.lg { font-size: 20px; min-height: 26px; }
.paper-sub { font-size: 13px; margin-top: 2px; }
.paper-meta { display: flex; justify-content: space-between; gap: 8px; font-family: var(--body); font-size: 10.5px; margin-top: 8px; color: #333333; }
.paper-qs { display: flex; flex-direction: column; gap: 11px; }
.pq { display: grid; grid-template-columns: 28px minmax(0, 1fr); font-size: 14px; line-height: 1.45; }
.pq b { font-weight: 600; }
.opts4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 4px; font-size: 12.5px; color: #333333; }
.opts2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 14px; margin-top: 5px; font-size: 13px; color: #333333; }
.paper-key { margin-top: 16px; padding-top: 8px; border-top: 1px dashed #999999; font-family: var(--body); font-size: 10.5px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-paper { position: absolute; left: 50%; top: 40px; width: min(400px, 86%); transform: translateX(-50%) rotate(-1.5deg); padding: 26px 28px 26px; box-shadow: 0 40px 80px -24px var(--rf-sh); z-index: 2; }
.float { position: absolute; display: none; background: var(--rf-float); border: 1px solid var(--rf-float-line); border-radius: 20px; padding: 16px 18px; box-shadow: 0 24px 48px -20px var(--rf-sh); color: var(--rf-text); }
.float .label { font-size: 10.5px; color: var(--rf-muted); }
.float-graph { left: 3%; top: 60px; width: 250px; transform: rotate(-3deg); }
.float-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-family: var(--serif); font-size: 16px; }
.float-merge { right: 3%; top: 72px; width: 230px; transform: rotate(2.5deg); }
.float-merge .label { margin-bottom: 10px; }
.pages { position: relative; height: 120px; }
.merge-note { margin-top: 8px; text-align: center; font-size: 12px; font-weight: 600; color: var(--rf-accent); }
.graph-svg { width: 100%; height: auto; }
.graph-svg .axis { stroke: var(--rf-line-strong); stroke-width: 1; }
.graph-svg .curve { fill: none; stroke: var(--rf-accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; transition: stroke-dashoffset .7s linear; }
.mini-page { position: absolute; left: 50%; top: 50%; width: 62px; height: 82px; margin: -41px 0 0 -31px; background: #FFFFFF; border-radius: 3px; padding: 8px 7px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 6px 16px -6px var(--rf-sh); }
.mini-page.lg { width: 58px; height: 76px; margin: -40px 0 0 -29px; }
.mini-page span { height: 2px; background: #DDDDDD; }
.mini-page .bar { height: 4px; width: 70%; border-radius: 2px; }
.mini-page .w80 { width: 80%; }
.mini-page .w60 { width: 60%; }
.stage-chips { position: absolute; left: 4%; bottom: 40px; display: none; flex-direction: column; gap: 8px; z-index: 3; }
.chip { align-self: flex-start; background: var(--rf-cell); border: 1px solid var(--rf-line-strong); color: var(--rf-text); padding: 9px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.sm { background: var(--rf-chip); padding: 7px 12px; font-size: 12px; }
.chip-primary { background: var(--rf-primary) !important; color: var(--rf-on-primary); border-color: var(--rf-primary); font-weight: 700; }
.stage-toast { position: absolute; right: 4%; bottom: 40px; display: none; background: var(--rf-primary); color: var(--rf-on-primary); padding: 11px 16px; border-radius: 14px; font-size: 13px; font-weight: 700; z-index: 3; }
@media (min-width: 700px) { .stage-chips { display: flex; } .stage-toast { display: block; } .hero-paper { width: min(390px, 80%); top: 44px; } }
/* Pause control for the looping demos (WCAG 2.2.2). Shown only when scripts run and motion is allowed. */
.stage-wrap { position: relative; }
.motion-btn { position: absolute; z-index: 4; top: 14px; right: calc(var(--gutter) + 14px); display: none; align-items: center; gap: 8px; min-height: 36px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--rf-line-strong); background: var(--rf-card); color: var(--rf-text); font-size: 13px; font-weight: 600; line-height: 1.2; transition: background-color .2s, color .2s, border-color .2s; }
.motion-btn:hover { border-color: var(--rf-highlight); }
.motion-btn .i-play, .motion-btn[aria-pressed="true"] .i-pause { display: none; }
.motion-btn[aria-pressed="true"] .i-play { display: block; }
.motion-btn[aria-pressed="true"] { background: var(--rf-chip-on-bg); color: var(--rf-chip-on-fg); border-color: var(--rf-chip-on-bg); }
.js .motion-btn { display: inline-flex; }
.motion-paused .marquee-track { animation-play-state: paused; }
/* Phones: the paper fills the stage, so the control sits under it instead of over it. */
@media (max-width: 699px) { .js .stage-wrap { display: flex; flex-direction: column; align-items: flex-end; } .stage { width: 100%; } .motion-btn { position: static; margin-top: 12px; } }
@media (min-width: 1240px) { .float { display: block; } }

/* Animation states. Without JavaScript every element shows its finished state ("on"). */
.fx { transition: opacity .45s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.pq.fx:not(.on), .paper-key.fx:not(.on) { opacity: 0; transform: translateX(26px); }
.tile-paper .pq.fx:not(.on) { transform: translateY(10px); }
.chip.fx:not(.on), .stage-toast.fx:not(.on) { opacity: 0; transform: translateY(10px); }
.tile-chips .chip.fx:not(.on) { transform: translateX(-12px); }
.merge-note.fx:not(.on), .tile-badge.fx:not(.on) { opacity: 0; }
.mini-page.fx, .qcard.fx { transform: var(--off); transition: transform .7s cubic-bezier(.7,0,.2,1); }
.mini-page.fx.on, .qcard.fx.on { transform: var(--on); }
.out-page.fx:not(.on) { opacity: 0; transform: scale(.9); }
.day-cell.fx { transition: background-color .35s, color .35s, border-color .35s; }
.day-cell.fx.on { background: var(--rf-primary); color: var(--rf-on-primary); border-color: var(--rf-primary); }

/* Formula strip (decorative) */
.marquee { padding: 56px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.marquee-row { display: flex; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; align-items: center; gap: 72px; padding-right: 72px; flex-shrink: 0; font-family: var(--serif); font-size: clamp(28px, 3.6vw, 52px); color: var(--rf-marquee); animation: rfMarquee 60s linear infinite; }
.marquee-track.reverse { animation-duration: 70s; animation-direction: reverse; }
html:not(.js) .marquee-track { animation: none; }

/* Exams */
.exams { padding-top: 72px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 28px 48px; align-items: start; }
.h2 { font-size: clamp(44px, 6.4vw, 92px); text-wrap: balance; }
.exam-list { border-top: 1px solid var(--rf-line); }
.exam-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 20px 0; border-bottom: 1px solid var(--rf-line); }
.exam-name { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.exam-title { font-size: clamp(26px, 2.6vw, 34px); line-height: 1; text-wrap: balance; }
.exam-detail { font-size: 15px; line-height: 1.45; color: var(--rf-muted); }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-bank { background: var(--rf-primary); color: var(--rf-on-primary); }
.badge-personal { background: var(--rf-tint); border-color: var(--rf-accent); color: var(--rf-accent); }
.badge-review { border-color: var(--rf-line-strong); color: var(--rf-warn); }
.badge-soon { border: 1px dashed var(--rf-field); color: var(--rf-muted); }
.badge-soon .dot { width: 7px; height: 7px; background: transparent; border: 1.5px solid currentColor; }
.badge.sm { padding: 3px 9px; font-size: 12px; gap: 6px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.exam-more > summary { cursor: pointer; list-style: none; }
.exam-more > summary::-webkit-details-marker { display: none; }
.more-sign::after { content: ' +'; color: var(--rf-accent); }
.exam-more[open] .more-sign::after { content: ' −'; }
.exam-families { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px 32px; padding: 20px 0 8px; }
.exam-family h3 { margin-bottom: 8px; }
.exam-family li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rf-line-soft); font-size: 14px; line-height: 1.4; color: var(--rf-text-2); }
.exam-family li .badge { flex-shrink: 0; }
.exam-note { padding: 8px 0 20px; font-size: 14px; color: var(--rf-muted); border-bottom: 1px solid var(--rf-line); }

/* Workspace tiles */
.tools { padding-top: 72px; padding-bottom: 96px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.section-head .label { margin-bottom: 14px; }
.section-head h2 { max-width: 900px; }
.tiles { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(300px, auto); gap: 16px; }
.tile { position: relative; border-radius: 28px; background: var(--rf-card); border: 1px solid var(--rf-card-edge); overflow: hidden; display: flex; flex-direction: column; color: var(--rf-text); transition: border-color .3s; }
.tile-link { color: inherit; }
.tile-link:hover { color: inherit; }
/* The title link covers the whole card, so a click or tap anywhere opens the tool. */
.tile-link::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: 28px; }
.tile-link:focus-visible { outline: none; }
.tile-link:focus-visible::after { outline: 2px solid var(--rf-highlight); outline-offset: -3px; }
/* Touch screens cannot hover: a separate Preview button plays the demo without opening the tool. */
.tile-preview { position: absolute; z-index: 4; top: 12px; right: 12px; display: none; align-items: center; gap: 6px; min-height: 36px; padding: 8px 12px; border-radius: 99px; border: 1px solid var(--rf-line-strong); background: var(--rf-card); color: var(--rf-text); font-size: 12px; font-weight: 700; line-height: 1.2; }
.tile-preview[aria-pressed="true"] { background: var(--rf-primary); color: var(--rf-on-primary); border-color: var(--rf-primary); }
@media (hover: none) { .js .tile-preview { display: inline-flex; } }
/* The tile hint promises previews only where they play: not without JavaScript, when paused or with reduced motion. */
.hint-still { display: none; }
html:not(.js) .hint-live, .motion-paused .hint-live { display: none; }
html:not(.js) .hint-still, .motion-paused .hint-still { display: inline; }
/* With reduced motion nothing plays, so neither motion control is offered. */
@media (prefers-reduced-motion: reduce) { .js .tile-preview, .js .motion-btn, .hint-live { display: none; } .hint-still { display: inline; } }
.tile.is-active { border-color: var(--rf-highlight); }
.tile-builder { grid-row: span 2; }
.tile-planner { grid-column: 1 / -1; }
.tile-art { flex: 1; position: relative; overflow: hidden; background: var(--rf-well); min-height: 180px; }
.art-grid { background-image: linear-gradient(var(--rf-grid2) 1px, transparent 1px), linear-gradient(90deg, var(--rf-grid2) 1px, transparent 1px); background-size: 28px 28px; }
.tile-chips { position: absolute; left: 24px; top: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.tile-paper { position: absolute; left: 56%; top: 36px; bottom: -24px; width: min(58%, 400px); transform: translateX(-50%) rotate(-1.5deg); padding: 24px 26px 60px; box-shadow: 0 30px 60px -20px var(--rf-sh); }
.tile-paper .paper-head { padding-bottom: 8px; margin-bottom: 12px; }
.tile-paper .paper-sub { font-size: 12px; }
.tile-paper .pq { font-size: 13px; grid-template-columns: 22px minmax(0, 1fr); }
.tile-foot { padding: 16px 20px 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.tile-builder .tile-foot { padding: 22px 24px; border-top: 1px solid var(--rf-line-soft); }
.tile-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-title { font-size: 26px; line-height: 1; }
.tile-title.lg { font-size: 40px; }
.tile-sub { font-size: 13px; color: var(--rf-muted); }
.tile-builder .tile-sub { font-size: 14px; }
.tile-go { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--rf-raised-2); color: var(--rf-text); transition: background-color .3s, color .3s; }
.tile-go.lg { width: 48px; height: 48px; font-size: 20px; }
.tile.is-active .tile-go { background: var(--rf-primary); color: var(--rf-on-primary); }
.tile-badge { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: var(--rf-primary); color: var(--rf-on-primary); font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.convert-art { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 18px; }
.board { position: relative; width: 46%; height: 110px; border-radius: 8px; background: #26302C; color: #CFE2D8; overflow: hidden; padding: 14px; display: flex; flex-direction: column; gap: 8px; transform: rotate(-2deg); font-family: var(--serif); font-size: 15px; }
.scan { position: absolute; left: 0; right: 0; top: 100%; height: 2px; background: #86F7B8; box-shadow: 0 0 12px #86F7B8; opacity: 0; transition: top .65s linear, opacity .3s; }
.arrow-faint { color: var(--rf-faint); font-size: 18px; }
.out-page { width: 36%; min-height: 110px; background: #FFFFFF; color: #111111; border-radius: 3px; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-family: var(--serif); font-size: 13px; box-shadow: 0 8px 18px -8px var(--rf-sh); }
.out-page .rule { height: 2px; background: #DDDDDD; margin-top: 4px; }
.out-page .rule.w70 { width: 70%; margin-top: 0; }
.graph-art { padding: 14px 20px 0; display: flex; flex-direction: column; }
.graph-eq { font-family: var(--serif); font-size: 17px; color: var(--rf-text); }
.graph-art .graph-svg { flex: 1; min-height: 0; height: 100%; max-height: 190px; margin: 0 auto; }
.qcard { position: absolute; left: 50%; top: 50%; width: 160px; min-height: 100px; margin: -54px 0 0 -80px; background: var(--rf-chip); border: 1px solid var(--rf-line-strong); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 10px 24px -10px var(--rf-sh); }
.qcard-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; }
.tone-accent { color: var(--rf-accent); } .tone-blue { color: var(--rf-blue); } .tone-warn { color: var(--rf-warn); }
.qcard-text { font-family: var(--serif); font-size: 13px; line-height: 1.35; color: var(--rf-text); }
.planner-art { padding: 22px 24px 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; align-content: center; }
.day { display: flex; flex-direction: column; gap: 8px; }
.day .label { font-size: 10.5px; letter-spacing: .1em; }
.day-cell { min-height: 76px; border-radius: 12px; padding: 12px; font-size: 13px; font-weight: 600; line-height: 1.3; background: var(--rf-cell); color: var(--rf-muted); border: 1px solid var(--rf-line); }
@media (min-width: 680px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-builder { grid-column: span 2; }
  .tile-art { min-height: 0; }
}
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } .planner-art { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 679px) {
  .tile-paper { left: auto; right: -12px; width: 64%; transform: rotate(-1.5deg); }
  .tile-chips { left: 16px; top: 16px; }
  .tile-title.lg { font-size: 34px; }
  .planner-art { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Try it */
.try { padding-bottom: 110px; }
.try-panel { border-radius: 36px; background: var(--rf-card); border: 1px solid var(--rf-card-edge); padding: clamp(24px, 4vw, 56px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 48px; }
.try-controls, .try-output { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.try-output { gap: 14px; }
.h-try { font-size: clamp(44px, 5.4vw, 80px); }
.try-intro { display: flex; flex-direction: column; gap: 8px; }
.try-intro p:first-child { max-width: 480px; }
.seg { display: inline-flex; align-self: flex-start; padding: 4px; background: var(--rf-page); border: 1px solid var(--rf-line); border-radius: 99px; gap: 4px; flex-wrap: wrap; }
.seg button { padding: 9px 16px; border: 0; border-radius: 99px; font-size: 13px; font-weight: 600; background: transparent; color: var(--rf-text-2); transition: background-color .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--rf-primary); color: var(--rf-on-primary); }
.demo-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-chip { padding: 9px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; border: 1px solid var(--rf-line-strong); background: transparent; color: var(--rf-text-2); transition: background-color .2s, color .2s, border-color .2s; }
.demo-chip[aria-pressed="true"] { background: var(--rf-chip-on-bg); color: var(--rf-chip-on-fg); border-color: var(--rf-chip-on-bg); }
.demo-list { display: flex; flex-direction: column; gap: 10px; }
.dq { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; text-align: left; padding: 14px 16px; border-radius: 16px; background: var(--rf-well); border: 1px solid var(--rf-line); color: var(--rf-text); transition: border-color .2s, background-color .2s; }
.dq:hover { border-color: var(--rf-highlight); }
.dq[aria-pressed="true"] { background: var(--rf-tint); border-color: var(--rf-highlight); }
.dq-t { font-family: var(--serif); font-size: 17px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.dq-t .m { white-space: normal; }
.dq-b { padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--rf-raised-2); color: var(--rf-text); }
.dq[aria-pressed="true"] .dq-b { background: var(--rf-primary); color: var(--rf-on-primary); }
.demo-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field .label { font-size: 11px; }
.field input { padding: 15px 18px; border-radius: 14px; border: 1px solid var(--rf-field); background: var(--rf-page); color: var(--rf-text); font: inherit; font-size: 16px; width: 100%; }
.field input::placeholder { color: var(--rf-muted); }
.demo-paper { padding: clamp(20px, 3vw, 32px); min-height: 420px; border-radius: 4px; border: 1px solid var(--rf-line); box-shadow: 0 30px 60px -30px var(--rf-sh); }
:root[data-theme="dark"] .demo-paper { border-color: transparent; }
.demo-paper .paper-head { margin-bottom: 16px; }
.demo-paper .paper-meta { font-size: 11px; }
.demo-qs { gap: 14px; }
.demo-qs .pq { font-size: 14.5px; line-height: 1.5; animation: rfIn .35s cubic-bezier(.2,.8,.2,1); }
.paper-empty { font-family: var(--body); font-size: 14px; color: #595959; text-align: center; padding: 60px 0; }
.demo-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.strong-link { font-weight: 700; }

/* How it works */
.how { padding-bottom: 110px; }
.how > .label { margin-bottom: 14px; }
.how h2 { margin-bottom: 48px; max-width: 900px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.step { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; border-top: 1px solid var(--rf-line-strong); }
.step-no { font-size: 56px; line-height: 1; color: var(--rf-accent); }
.step-title { font-size: 30px; line-height: 1; }
.step p { font-size: 15px; line-height: 1.6; }

/* Pricing (only when RANKER_PRICING=preview) */
.pricing { padding-bottom: 110px; }
.pricing .section-head p { margin-top: 12px; max-width: 560px; }
.pricing .seg { background: var(--rf-card); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px; }
.plan { border-radius: 32px; background: var(--rf-card); border: 1px solid var(--rf-card-edge); padding: clamp(28px, 3vw, 40px); display: flex; flex-direction: column; gap: 28px; }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 38px; }
.plan-name { font-size: 32px; }
.plan-price .plan-badge { align-self: center; margin-left: 6px; }
.plan-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.plan-price p { flex-basis: 100%; font-size: 15px; font-weight: 500; line-height: 1.5; }
.price { font-size: 72px; line-height: 1; }
.per { font-size: 15px; font-weight: 500; }
.plan-list { display: flex; flex-direction: column; gap: 12px; }
.plan-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.plan-list b { flex-shrink: 0; color: var(--rf-accent); }
.plan-list .soon, .plan-list .limit { color: var(--rf-muted); }
.plan-list .soon b, .plan-list .limit b { color: var(--rf-faint); font-weight: 500; }
.plan .btn { margin-top: auto; }
.plan-pro { background: var(--rf-pro-bg); color: var(--rf-pro-fg); border-color: var(--rf-pro-border); }
.plan-pro .plan-list b { color: inherit; }
.plan-pro .plan-list .soon, .plan-pro .plan-list .soon b { color: var(--rf-pro-muted); }
/* In dark the Pro card is the highlight colour itself, so its focus ring uses the card's text colour. */
.plan-pro :focus-visible { outline-color: var(--rf-pro-fg); }
.plan-status { margin-top: -16px; font-size: 14px; font-weight: 600; text-align: center; }
.plan-badge { background: var(--rf-pro-badge-bg); color: var(--rf-pro-badge-fg); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 99px; }
.btn-pro { background: var(--rf-pro-badge-bg); color: var(--rf-pro-badge-fg); padding: 16px 24px; font-size: 16px; }
.btn-pro:hover { color: var(--rf-pro-badge-fg); text-decoration: underline; text-underline-offset: 3px; }
/* Checkout not open yet: the Pro card's "See Pro plans" is a secondary button in the card's own colours. */
.plan-pro .btn-outline { color: var(--rf-pro-fg); border-color: var(--rf-pro-line); }
.plan-pro .btn-outline:hover { color: var(--rf-pro-fg); border-color: var(--rf-pro-fg); text-decoration: underline; text-underline-offset: 3px; }
.plan-note { margin-top: 20px; max-width: 760px; }
/* Without JavaScript both Pro prices are listed (each with its own period), so the switch is hidden. With it, the
   30-day price shows from first paint (home.js marks the section once the switch works), so nothing shifts. */
html:not(.js) .pricing .seg { display: none; }
.js .pricing:not([data-billing]) [data-plan-show="yearly"] { display: none; }

/* Final call to action */
.final { padding-top: 130px; padding-bottom: 130px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 36px; }
.h-final { font-size: clamp(56px, 11vw, 168px); line-height: .9; letter-spacing: -0.015em; text-wrap: balance; }
.ticks { display: flex; gap: 10px 28px; flex-wrap: wrap; justify-content: center; font-size: 14px; color: var(--rf-muted); }
.ticks li { display: flex; gap: 8px; }
.ticks b { color: var(--rf-accent); }

/* 404 */
.notfound { padding-top: clamp(64px, 10vw, 140px); padding-bottom: clamp(64px, 10vw, 140px); display: flex; flex-direction: column; gap: 24px; }
.notfound p { max-width: 620px; font-size: 18px; }

/* Footer */
.site-footer { border-top: 1px solid var(--rf-line-soft); }
.footer-in { padding-top: 56px; padding-bottom: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 40px; }
.footer-brand { display: flex; flex-direction: column; gap: 14px; }
.footer-brand p { max-width: 300px; line-height: 1.6; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-row .wordmark { font-size: 18px; }
.footer-col { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.footer-col h2 { font-size: 11px; }
.footer-col a { color: var(--rf-text-2); }
.footer-col a:hover { color: var(--rf-text-strong); }
.all-chapters summary { cursor: pointer; color: var(--rf-text); font-weight: 600; }
.all-chapters h3 { margin: 14px 0 6px; font-size: 11px; }
.all-chapters li { padding: 3px 0; }
.footer-note { padding-bottom: 40px; display: flex; flex-direction: column; gap: 8px; }
.operator { font-size: 14px; line-height: 1.6; color: var(--rf-text-2); }

@keyframes rfIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rfMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* Forced colours (Windows high contrast) drop background colours, so pressed toggles use the system selection colours. */
@media (forced-colors: active) {
  .seg button[aria-pressed="true"], .demo-chip[aria-pressed="true"], .tile-preview[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
}
@media print {
  .site-header, .marquee, .stage, .tiles, .try, .site-footer, .resume { display: none !important; }
  body { background: #FFFFFF; color: #111111; }
}
