/* The study binder. This is not a website with a menu bar: it is a ring binder lying on a desk.
   Folder tabs along the top, a sheet of squared paper with punched holes, chapters as books on shelves,
   and the days to the exam as a trail. Loaded last. */
:root { --desk: #c3d0e4; }
:root[data-theme="dark"] { --desk: #0a1220; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --desk: #0a1220; } }
body { background: var(--desk); background-image: none; }

/* each section has its own ink */
body[data-sec="DILR"] { --pen: #0e7c86; --pen-soft: #dff3f4; }
body[data-sec="VARC"] { --pen: #7b3fb0; --pen-soft: #f1e8fa; }
:root[data-theme="dark"] body[data-sec="DILR"] { --pen: #5fd0d8; --pen-soft: #17363a; }
:root[data-theme="dark"] body[data-sec="VARC"] { --pen: #c79bf0; --pen-soft: #33264a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-sec="DILR"] { --pen: #5fd0d8; --pen-soft: #17363a; }
  :root:not([data-theme="light"]) body[data-sec="VARC"] { --pen: #c79bf0; --pen-soft: #33264a; }
}

/* ---------------------------------------------------------------- folder tabs */
.top { background: var(--desk); border-bottom: 0; box-shadow: none; align-items: flex-end; padding: 10px 18px 0; min-height: 66px; }
.top .brand, .top .tright { align-self: center; padding-bottom: 4px; }
.tnav { gap: 4px; align-items: flex-end; padding-top: 6px; }
.tnav a { --tc: #3d5a80; flex-direction: row; gap: 7px; padding: 9px 15px 9px 12px; border-radius: 13px 13px 0 0; background: var(--tc); color: #fff; font-size: 14px; font-weight: 700; border-bottom: 0; transform: translateY(6px); transition: transform .16s cubic-bezier(.3, 1.4, .5, 1); box-shadow: inset 0 -7px 8px -6px rgba(0, 0, 0, .4); }
.tnav a .ic { width: 19px; height: 19px; }
.tnav a:hover { background: var(--tc); color: #fff; transform: translateY(1px); }
.tnav a.on { background: var(--paper); color: var(--ink); transform: none; padding-bottom: 13px; box-shadow: inset 0 5px 0 var(--tc); border-bottom-color: transparent; }
.tnav a[data-r="Quant"] { --tc: #2557d6; } .tnav a[data-r="DILR"] { --tc: #0e7c86; } .tnav a[data-r="VARC"] { --tc: #7b3fb0; }
.tnav a[data-r="mocks"] { --tc: #c8372d; } .tnav a[data-r="labs"] { --tc: #a87400; } .tnav a[data-r="plan"] { --tc: #b3560f; }
.tnav a[data-r="errors"] { --tc: #6b4a2f; } .tnav a[data-r="search"] { --tc: #5b6b85; }
.ibtn { background: var(--paper); }

/* ---------------------------------------------------------------- the sheet of paper */
.shell { position: relative; margin: 0 14px 16px; padding-left: 30px; min-height: calc(100vh - 84px); border-radius: 4px 18px 18px 18px; background-color: var(--paper); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; box-shadow: 0 0 0 1px var(--line), 0 22px 40px -26px rgba(10, 20, 40, .7); }
.shell::before { content: ""; position: absolute; left: 8px; top: 30px; bottom: 30px; width: 14px; background: radial-gradient(circle at 50% 50%, var(--desk) 0 5.500px, transparent 6px) 0 0 / 14px 48px repeat-y; opacity: .9; }
.rail { background: transparent; top: 66px; height: calc(100vh - 66px); }

/* ---------------------------------------------------------------- chapters as books on a shelf */
.shelfhint { flex-basis: 100%; margin: 0; font-size: 14.5px; }
.shelf { margin-top: 22px; padding-bottom: 30px; }
.books.tiles { display: flex; align-items: flex-end; gap: 5px; padding: 18px 16px 0; overflow-x: auto; scrollbar-width: thin; }
.tile.book { position: relative; flex: none; width: var(--w); height: var(--h); min-height: 0; padding: 10px 5px 8px; gap: 7px; align-items: center; border: 0; border-radius: 5px 5px 2px 2px; background: var(--bc); color: #fff; overflow: hidden; transform-origin: 50% 100%; transition: transform .18s cubic-bezier(.3, 1.4, .5, 1); box-shadow: inset -8px 0 10px -6px rgba(0, 0, 0, .5), inset 4px 0 6px -4px rgba(255, 255, 255, .4), 0 2px 0 rgba(0, 0, 0, .3); }
.tile.book::before { content: ""; position: absolute; left: 5px; right: 5px; top: 50px; height: 2px; background: rgba(255, 255, 255, .45); box-shadow: 0 4px 0 rgba(255, 255, 255, .25); }
.tile.book:hover, .tile.book:focus-visible { transform: translateY(-16px) rotate(-2deg); z-index: 2; border: 0; }
.tile.book:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
.bico { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; flex: none; }
.bico .ic { width: 20px; height: 20px; }
.tile.book .btitle { flex: 1; min-height: 0; margin-top: 12px; writing-mode: vertical-rl; font: 800 15px/1.12 var(--f-head); overflow: hidden; }
.bn { display: flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; background: rgba(0, 0, 0, .28); font: 800 12.5px var(--f-head); }
.blab .ic { width: 12px; height: 12px; display: block; }
.bfill { position: absolute; right: 0; bottom: 0; width: 6px; background: var(--hl); border-radius: 3px 0 0 0; }
.tile.book.done .bn { background: var(--green); }
.bmark { position: absolute; top: 0; right: 10px; width: 12px; height: 34px; background: var(--hl); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%); }
.board { position: relative; height: 16px; border-radius: 3px; background: linear-gradient(#93714f, #6b4f35); box-shadow: 0 8px 12px -8px rgba(0, 0, 0, .6); }
.board span { position: absolute; left: 16px; top: 22px; font: 800 15.5px var(--f-head); color: var(--ink); }

/* ---------------------------------------------------------------- the trail to the exam */
.trailwrap { margin: 4px 0 16px; padding: 8px 12px 4px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.trail { display: block; width: 100%; height: auto; max-height: 340px; }
.tpath { fill: none; stroke: var(--line); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 1 18; }
.tdone { fill: none; stroke: var(--green); stroke-width: 6; stroke-linecap: round; }
.stop { cursor: pointer; }
.stop .ring { fill: var(--card); stroke: var(--ink); stroke-width: 3; transition: stroke-width .12s; }
.stop.test .ring { stroke: var(--red); stroke-width: 4.5; }
.stop.done .ring { fill: var(--green-soft); stroke: var(--green); }
.stop.now .ring { fill: var(--hl); stroke: var(--ink); }
.stop.sel .ring, .stop:hover .ring, .stop:focus-visible .ring { stroke-width: 7; }
.stop:focus-visible { outline: none; }
.stop .si * { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stop.now .si * { stroke: #4a3b00; }
.stop .si .tick { stroke: var(--green); stroke-width: 3.2; }
.trail .sd { font: 600 15px var(--f-body); fill: var(--muted); text-anchor: middle; }
.trail .snow { font: 700 20px var(--f-hand); fill: var(--red); text-anchor: middle; }
.trail .pulse { fill: none; stroke: var(--hl); stroke-width: 5; }
.flag .pole { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.flag .cloth { fill: var(--red); }
.trail .fcat { font: 800 11.5px var(--f-head); fill: #fff; }
@media (min-width: 761px) { .strip { display: none; } }
@media (max-width: 760px) { .trailwrap { display: none; } }

@media (prefers-reduced-motion: no-preference) {
  .trail .pulse { animation: tpulse 1.6s ease-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }
  @keyframes tpulse { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
  #main.enter .books .tile.book { animation: shelve .5s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: calc(var(--i) * 28ms); }
  @keyframes shelve { from { opacity: 0; transform: translateY(-34px) rotate(5deg); } }
  #main.enter .tdone { animation: walk 1.2s ease-out both; }
  @keyframes walk { from { stroke-dasharray: 0 6000; } }
}
@media (max-width: 980px) {
  .top { padding: 8px 8px 0; min-height: 62px; }
  .tnav a { flex-direction: column; gap: 1px; padding: 6px 10px 7px; font-size: 12px; border-radius: 10px 10px 0 0; }
  .tnav a.on { padding-bottom: 10px; }
  .shell { margin: 0 6px 10px; padding-left: 0; border-radius: 4px 12px 12px 12px; }
  .shell::before { display: none; }
}
@media print { body { background: #fff; } .shell { box-shadow: none; margin: 0; padding: 0; } .shell::before { display: none; } }
