/* ================================================================
   UniCheatSheet – Homepage
   Modern Premium Dark Theme with Cyan Accents
   ================================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --accent: #00e5ff;
  --accent-dim: rgba(0, 229, 255, 0.15);
  --accent-glow: rgba(0, 229, 255, 0.35);
  --surface: rgba(255, 255, 255, 0.06);
  --surface-hover: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(0, 229, 255, 0.4);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  /* Critically-damped spring settle — quick out, no overshoot. The navbar
     and scroll reveal already moved on this curve; routing the shared
     tokens through it makes everything decelerate the same way. */
  --spring-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 0.25s var(--spring-out);
  --transition-smooth: 0.4s var(--spring-out);
}

/* ---------- Base Reset ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--f-ui);
}

p,
span,
a,
button,
li {
  font-family: var(--f-ui);
}

.nav-text {
  font-family: var(--f-ui);
}

html,
body {
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #000;
}

/* ============================================
   HEADER & HERO
   ============================================ */

#header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center; /* vertically centres .text-box, the one in-flow child */
  min-height: 100vh;
  /* dvh override lives just below — 100vh counts the collapsed mobile URL
     bar, so the hero ran taller than the screen and pushed the semester
     pills under the fold on phones. Same fix #navbar already had. */
  width: 100%;
  background-image: linear-gradient(to bottom,
      rgba(0, 5, 15, 0.3) 0%,
      rgba(0, 5, 15, 0.5) 40%,
      rgba(0, 5, 15, 0.85) 80%,
      rgba(0, 5, 15, 0.98) 100%), url('https://unicheatsheet.com/t/2cc0bf7c855ba9fa.webp');
  background-position: center;
  background-size: cover;
  z-index: auto;
}

@supports (min-height: 100dvh) {
  #header {
    min-height: 100dvh;
  }
}

/* Phones: the quote widget sits at the bottom edge, collapsed to its pill
   by default (see js/quotes.js). The hero centres its content inside a
   full-viewport box, so without this the bottom of that box — where the
   semester buttons and the Notes / Solutions / PYQs row land — sits
   underneath it. Reserving the strip lifts the whole group clear. */
@media screen and (max-width: 640px) {
  #header {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================
   NAVBAR (Full-Screen Overlay)
   ============================================ */

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  background-color: rgba(0, 5, 15, 1);
  width: 100%;
  height: 100vh;
  text-align: left;
  /* Animate transform (GPU-composited) instead of `top` to avoid layout jank */
  transform: translateY(-103%);
  visibility: hidden;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.55s;
  will-change: transform;
  margin: 0;
  z-index: 9999;
  padding: 120px 60px 80px 60px;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

#navbar.active {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

/* Mobile browsers: 100vh includes the collapsed URL bar; dvh tracks the
   real visible viewport so the menu never overflows or leaves a gap */
@supports (height: 100dvh) {
  #navbar {
    height: 100dvh;
  }
}

/* Navbar Header */
.navbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10001;
}

.navbar-logo {
  display: block;
  opacity: 0;
}

.navbar-logo img {
  height: 0px;
  width: auto;
}

#navbar.active .navbar-logo {
  opacity: 1;
}

/* Close Button */
.close-btn {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: rgba(0, 10, 20, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.2);
  padding: 12px 18px;
  cursor: pointer;
  border-radius: 6px;
  z-index: 10001;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

#navbar.active .close-btn {
  display: flex;
}

.close-btn i {
  color: var(--accent);
  font-size: 22px;
  transition: transform 0.3s ease;
}

.close-btn span {
  color: #fff;
  font-size: 18px;
  font-family: var(--f-ui);
  font-weight: 500;
  letter-spacing: 1px;
}

.close-btn:hover {
  background-color: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.4);
}

.close-btn:hover i {
  transform: rotate(90deg);
}

/* Navbar Content */

#navbar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#navbar li {
  list-style: none;
  padding: 4px 0;
  margin: 0;
  position: relative;
}

/* Hide main logo when navbar is active */
#navbar.active~#header .logo {
  opacity: 0;
}

/* Adjust main nav items to not overlap with header */
#navbar .nav-items {
  margin-top: 0;
  padding: 0;
}

/* ---------- Main Nav Links ---------- */
.nav-link {
  font-family: var(--f-ui);
  text-decoration: none;
  font-size: 48px;
  font-weight: 600;
  color: #fff;
  transition: all 0.3s var(--spring-out);
  text-align: left;
  display: inline-flex;
  align-items: center;
  line-height: 1.15;
  /* 48px display type — tighten, don't spread */
  letter-spacing: -0.01em;
}

/* Text wrapper for underline effect */
.nav-text {
  position: relative;
  font-family: var(--f-ui);
}

.nav-text::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: linear-gradient(90deg, var(--accent), rgba(0, 229, 255, 0.3));
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 1px;
}

.nav-link:hover .nav-text::after {
  width: 100%;
}

/* Remove the underline effect */
#navbar li::after {
  display: none;
}

/* Hover effect */
#navbar li a:hover {
  opacity: 0.8;
}

/* ============================================
   HAMBURGER MENU BUTTON
   ============================================ */

.header-right {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(0, 10, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  cursor: pointer;
  border-radius: 6px;
  color: #fff;
  z-index: 1000;
  touch-action: manipulation;
  transition: all 0.3s var(--spring-out);
  /* A brighter top edge is light catching the material — at blur(8px)
     under an 85%-opaque fill the translucency was doing nothing */
  border-top-color: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  position: static;
}

.hamburger:hover {
  background-color: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.3);
}

.menu-text {
  color: #fff;
  font-size: 18px;
  font-family: var(--f-ui);
  font-weight: 500;
  letter-spacing: 1px;
}

.hamburger i {
  color: var(--accent);
  font-size: 20px;
  transition: transform 0.3s ease;
}

.hamburger:hover i {
  transform: scale(1.1);
}

/* Hide hamburger when navbar is active */
.hamburger.hide {
  display: none;
}

.hamburger.active {
  right: 20px;
  top: 20px;
}

.hamburger.active .menu-text {
  display: none;
}

/* Hamburger icon transition */
.hamburger .bar {
  transition: all 0.6s ease;
}

/* ============================================
   SUBMENU
   ============================================ */

.submenu {
  display: none;
  margin-top: 8px;
  margin-left: 20px;
}

.submenu li {
  margin-left: 0;
  padding: 4px 0;
}

.submenu li a {
  color: #fff !important;
  font-size: clamp(24px, 3vw, 30px);
  opacity: 0.6;
  white-space: nowrap;
  display: block;
  text-decoration: none !important;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.submenu li a:hover {
  opacity: 1;
  color: var(--accent) !important;
  transform: translateX(8px);
}

.submenu li a .nav-text::after {
  display: none !important;
}

/* Keep main nav item underlines */
.nav-item>.nav-link .nav-text::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: linear-gradient(90deg, var(--accent), rgba(0, 229, 255, 0.3));
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show submenu when parent is active */
.nav-item.active .submenu {
  display: block;
  animation: submenuFade 0.3s ease-out;
}

@keyframes submenuFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Arrow indicator for items with submenus */
.nav-link.has-submenu::after {
  content: '+';
  margin-left: 15px;
  font-size: 0.7em;
  transition: all 0.3s ease;
  color: var(--accent);
  font-weight: 300;
}

.nav-item.active .nav-link.has-submenu::after {
  content: '−';
}

/* When any item is active, dim all nav items */
.nav-items.has-active .nav-item .nav-link {
  color: rgba(255, 255, 255, 0.25);
}

/* Keep active item white */
.nav-items.has-active .nav-item.active .nav-link {
  color: #fff;
}

/* Keep submenu items white */
.nav-items.has-active .submenu a {
  color: #fff;
}

/* ============================================
   HERO TEXT BOX
   ============================================ */

/* Three.js ambient particle layer (decorative, sits behind hero text) */
.hero-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* In flow, centred by #header's flex box, with top padding that clears
   the fixed logo/Search/Menu. It used to be absolutely pinned at 45%,
   which on shorter laptop screens (e.g. 1366x657) pushed the title up
   level with the chips and left dead space underneath — and needed
   margin-top hacks on phones. Now a short screen just grows the hero. */
.text-box {
  color: #fff;
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(96px, 13vh, 132px) 20px clamp(40px, 7vh, 80px);
  text-align: center;
  box-sizing: border-box;
}

.text-box h1 {
  font-family: var(--f-ui);
  font-size: clamp(28px, 6.5vw, 84px);
  line-height: 1.1;
  margin-bottom: 24px;
  font-weight: 800;
  /* em, not px — tracking has to tighten as the clamp grows, otherwise
     -1px is too tight at 28px and too loose at 84px */
  letter-spacing: -0.02em;
  text-shadow: 0 0 40px rgba(0, 229, 255, 0.15);
  animation: heroTitleReveal 1s ease-out both;
  white-space: nowrap;
}

/* .com part — inline by default (desktop) */
.title-dot-com {
  display: inline;
}

@keyframes heroTitleReveal {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.text-box p:where(.container > *) {
  font-family: var(--f-ui);
  font-size: clamp(16px, 2.5vw, 24px);
  line-height: 1.6;
  margin: 0 auto;
  max-width: 800px;
  opacity: 0.85;
  animation: heroFadeIn 1s ease-out 0.3s both;
}

/* Uses `translate`, not `transform`. With animation-fill-mode: both this
   keyframe holds its end state forever, and an animated `transform` beats
   any normal declaration in the cascade — which silently swallowed the
   press state on .hero-btn. The independent property composes with
   transform instead of overriding it. */
@keyframes heroFadeIn {
  from {
    opacity: 0;
    translate: 0 10px;
  }

  to {
    opacity: 0.85;
    translate: 0 0;
  }
}

/* Same motion, full strength. 0.85 is the resting state of the hero
   paragraphs, but fill-mode: both holds a keyframe's end value forever,
   so the CTA and the semester picker were inheriting the body copy's
   dimming — controls shouldn't sit at 85%. */
@keyframes heroRiseIn {
  from {
    opacity: 0;
    translate: 0 10px;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

.text-box p:where(.container > *):last-of-type {
  margin-top: 30px;
}

.impact {
  font-weight: 600 !important;
  margin-bottom: clamp(5px, 1vh, 10px);
}

.impact a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.impact a:hover {
  color: var(--accent);
}

/* ============================================
   SEMESTER QUICK ENTRY (hero)
   ============================================ */

.sem-jump {
  margin-top: clamp(22px, 4vh, 34px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: heroRiseIn 1s ease-out 0.75s both;
}

.sem-jump-label {
  font-size: clamp(0.72rem, 1.5vw, 0.8rem);
  color: var(--text-secondary);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
}

.sem-jump-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Same surface/border language as .hero-btn, one size down */
.sem-pill {
  font-family: var(--f-ui);
  font-size: clamp(0.78rem, 1.5vw, 0.88rem);
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all var(--transition-fast);
}

.sem-pill:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.sem-pill.is-active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.12);
}


/* Narrow phones: tighten so all five pills stay on one row instead of
   leaving a single stranded pill on a second line */
@media screen and (max-width: 480px) {
  .sem-pill {
    padding: 10px 9px;
    font-size: 0.76rem;
  }

  .sem-jump-pills {
    gap: 6px;
  }

  .sem-jump {
    margin-top: 20px;
    gap: 8px;
  }
}









/* ============================================
   LEGACY
   ============================================ */





/* Same short accent rule the About page headings already use, so the
   panel reads as existing UniCheatSheet rather than a new component */




/* Desktop: compact two-column story panel, heading left / paragraph right.
   Matches the breakpoint where the resource cards go to three columns. */


/* ============================================
   CALL TO ACTION
   ============================================ */







/* ============================================
   FOOTER
   ============================================ */

.footer {
  width: 100%;
  text-align: center;
  padding: clamp(1.5rem, 3vw, 2.5rem) 0;
  background: rgba(0, 0, 0, 0.95);
  position: relative;
  border-top: 1px solid var(--border);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
}

.footer h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: 2px;
}

.footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 8px;
}

.footer h4 {
  margin: clamp(0.8rem, 2vw, 1.25rem) 0;
  font-weight: 600;
  font-size: clamp(14px, 2vw, 16px);
  color: var(--text-secondary);
}

/* ============================================
   FIXED LOGO
   ============================================ */

.fixed-logo {
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 1001;
  transition: all 0.3s ease;
}

.fixed-logo img {
  height: 80px;
  width: auto;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.fixed-logo img:hover {
  filter: drop-shadow(0 2px 12px rgba(0, 229, 255, 0.2));
}

/* ============================================
   UTILITY
   ============================================ */

a {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media screen and (min-width: 1200px) {
  .text-box h1 {
    font-size: 78px;
  }

  .text-box p:where(.container > *) {
    font-size: 22px;
  }

  

  .footer h3 {
    font-size: 1.6rem;
  }
}

@media screen and (min-width: 1440px) {
  .fixed-logo {
    left: 20px;
    top: 20px;
  }

  .fixed-logo img {
    height: 100px;
  }

  .text-box h1 {
    font-size: 84px;
  }

  .text-box p:where(.container > *) {
    font-size: 24px;
  }
}


/* Desktop: 3:4 at 360px wide was 480px of mostly photo per card */

@media screen and (max-width: 1024px) {
  #navbar {
    padding: 100px 40px 60px 40px;
  }

  .nav-link {
    font-size: 44px;
  }
}

@media screen and (max-width: 768px) {
  #navbar {
    padding: 100px 30px 50px 30px;
  }

  .nav-link {
    font-size: 40px;
  }

  .fixed-logo img {
    height: 65px;
  }
}

@media screen and (max-width: 767px) {
  #navbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    padding-top: 50px;
  }

  .text-box h1 {
    white-space: normal;
    font-size: clamp(32px, 10vw, 72px);
    font-weight: 800 !important;
    line-height: 1.05;
  }

  .title-dot-com {
    display: block;
    font-size: 0.55em;
    color: var(--accent);
    /* 6px on lowercase read as ". c o m"; em keeps the accent airy
       without breaking the word apart */
    letter-spacing: 0.14em;
    margin-top: 4px;
    font-weight: 700;
  }
}

@media screen and (max-width: 576px) {
  .search-text {
    display: none;
  }

  .search-trigger {
    padding: 12px;
    right: auto;
  }

  .header-right {
    right: 12px;
    gap: 8px;
  }

  .fixed-logo {
    left: 8px;
    top: 8px;
  }

  .fixed-logo img {
    height: 55px;
  }
}

@media screen and (max-width: 480px) {
  #navbar {
    padding: 90px 20px 40px 20px;
  }

  .nav-link {
    font-size: 36px;
  }

  .fixed-logo img {
    height: 48px;
  }

  /* Same phone sizing the semester pages already use (style_nav.css) —
     the homepage chip was still desktop-sized and crowded the logo */
  .hamburger {
    padding: 10px 14px;
    min-height: 44px;
  }

  .menu-text {
    font-size: 16px;
  }

  .hamburger i {
    font-size: 18px;
  }

  .text-box {
    width: 95%;
    padding-left: 12px;
    padding-right: 12px;
  }

  

  
}

@media screen and (max-width: 390px) {
  .nav-link {
    font-size: clamp(32px, 8vw, 42px);
  }

  .text-box p:where(.container > *) {
    font-size: clamp(14px, 3.5vw, 18px) !important;
  }

}

@media screen and (max-width: 376px) {
  #navbar .nav-items {
    margin-top: 100px;
    padding: 0;
  }

  #navbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
  }
}

@media screen and (max-width: 320px) {
  #navbar {
    padding: 80px 15px 30px 15px;
  }

  .nav-link {
    font-size: 32px;
  }

  .fixed-logo img {
    height: 40px;
  }
}

@media screen and (max-height: 480px) {
  .fixed-logo img {
    height: 50px;
  }
}

/* Print styles */
@media print {

  .hamburger,
  .hero-btn,
  .services__card button {
    display: none;
  }
}

/* ============================================
   SCROLL REVEAL (class added via JS)
   ============================================ */





/* ============================================
   PRESS FEEDBACK
   Applied on pointerdown by script.js. Touch never fires :hover, so
   this is the only response a tap gets before the page changes. The
   shrink is deliberately faster than the release so it reads as
   caused by the finger rather than played back at it.
   ============================================ */

.hero-btn.is-pressing,
.sem-pill.is-pressing,
.services__card button.is-pressing {
  transform: scale(0.96);
  transition-duration: 0.08s;
}

.hamburger.is-pressing,
.close-btn.is-pressing {
  transform: scale(0.95);
  transition-duration: 0.08s;
}

/* Scaling 48px menu text would wobble; dimming reads as a press without
   moving the word under the finger */
#navbar .nav-link.is-pressing,
#navbar .submenu li a.is-pressing {
  opacity: 0.55;
  transition-duration: 0.08s;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  
}

/* Translucency carries no information here — it's atmosphere. When the
   user has asked for less of it, make the floating chrome solid rather
   than leaving a blur that only costs them legibility. */
@media (prefers-reduced-transparency: reduce) {

  .hamburger,
  .search-trigger,
  .close-btn {
    background-color: #00121f;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .hero-btn,
  .sem-pill {
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Near-solid surfaces with a defined border, so controls stay separable
   from the photographic hero rather than relying on a faint 6% fill. */
@media (prefers-contrast: more) {

  .hero-btn,
  .sem-pill,
  .services__card button {
    background: #00121f;
    border-color: rgba(255, 255, 255, 0.75);
    color: #fff;
  }

  .hamburger,
  .search-trigger,
  .close-btn {
    background-color: #00121f;
    border-color: rgba(255, 255, 255, 0.7);
  }

  

  .text-box p,
  .legacy p,
  .services__card p,
  .footer p {
    color: rgba(255, 255, 255, 0.95);
  }
}
/* ============================================
   FIRST-VISIT PERFORMANCE (2026-09-28)
   Same design, less to download before the first screen.
   ============================================ */

/* Imagekit backgrounds at the size they are actually drawn. The originals
   are 1.6–3.3 MB each; the CDN resizes on the fly (tr=w-…). Phones get the
   narrow variant, desktops the wide one. */
#header {
  background-image: linear-gradient(to bottom,
      rgba(0, 5, 15, 0.3) 0%,
      rgba(0, 5, 15, 0.5) 40%,
      rgba(0, 5, 15, 0.85) 80%,
      rgba(0, 5, 15, 0.98) 100%),
    url('https://unicheatsheet.com/t/8aab34469dab3575.webp');
}

@media (min-width: 900px) {
  #header {
    background-image: linear-gradient(to bottom,
        rgba(0, 5, 15, 0.3) 0%,
        rgba(0, 5, 15, 0.5) 40%,
        rgba(0, 5, 15, 0.85) 80%,
        rgba(0, 5, 15, 0.98) 100%),
      url('https://unicheatsheet.com/t/15ba1adf152fd142.webp');
  }
}






/* ============================================
   COURSE EXPLORER (Course Hub architecture): the semester pills reveal that semester's courses in place.
   Same pill / revealed-link language as above; the cycle in session leads, the rest stay one tap away.
   ============================================ */
.sem-jump-pills { align-items: flex-end; }
.sem-courses { width: min(560px, 100%); margin: 14px auto 0; text-align: left; scroll-margin-top: 84px; }
/* Menu > Courses lands on the explorer itself (/?sem=N#courses, paid /access/<u>/#courses): its first line sits just below the
   fixed header (.header-right: 20px + 44-47px buttons = 64-67px) with ~20px of room, like the course list above. Arriving as
   the target it skips the 10px entrance rise: the anchor jump measured the still-moving box and left it under the header. */
#courses { scroll-margin-top: 84px; }
#courses:target { animation: none; }
.sem-courses[hidden] { display: none; }
.sem-courses-h { margin: 0 0 8px; font-size: .78rem; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-secondary); text-align: center; }
.sem-courses ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 900px) { .sem-courses { width: min(860px, 100%); } .sem-courses ul { grid-template-columns: 1fr 1fr; } }
.sem-course { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 16px; border-radius: var(--radius-sm);
  font-family: var(--f-ui); font-weight: 600; font-size: .95rem; line-height: 1.35; color: #fff; text-decoration: none;
  background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.22); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: all var(--transition-fast); }
.sem-course svg { flex: 0 0 auto; color: var(--accent); }
.sem-course:hover { border-color: var(--accent); background: var(--accent-dim); }
.sem-course:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sem-course { transition: none; } }
/* Semesters stay in numerical order 1 → 5; the cycle in session is only marked: a small accent dot on the pill, one quiet
   legend line under the row, and ", in session" for screen readers. (The earlier grouped layout's rules above are unused.) */
.sem-pill.is-now { position: relative; border-color: rgba(0, 229, 255, 0.42); }
.sem-pill.is-now::after { content: ""; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .9; }
.sem-now-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sem-now-k { display: block; margin: 0; text-align: center; font-size: .66rem; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-secondary); }
.sem-now-k::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
/* Very narrow phones: all five semesters on one row (each pill stays >= 44px wide and tall) */
@media (max-width: 360px) { .sem-jump-pills { gap: 4px; } .sem-jump .sem-pill { padding-left: 6px; padding-right: 6px; } }

/* ============================================
   STAGE 3 UX CORRECTION (2026-10-07) — final workflow
   ============================================ */
/* Hero background, decoupled from the hero's content. The photo used to be `cover` on #header itself, so anything that
   changed #header's height reframed it: a revealed course list, a paid "Your courses", and on phones the address bar
   collapsing (100dvh). The photo + shade now live on their own first-screen layer: its height is the SMALL viewport height
   (100svh — the screen with the browser bars showing, which no scrolling, toolbar or content changes), framed exactly as
   the original one-screen hero (`cover`, centred). The particle layer is held to the same box. #header keeps only the
   shade's end colour, which carries on below the first screen. */
#header { --hero-v: 100vh; background: rgb(0, 5, 15); }
@supports (height: 100svh) { #header { --hero-v: 100svh; } }
#header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--hero-v);
  pointer-events: none;
  background-image: linear-gradient(to bottom,
      rgba(0, 5, 15, 0.3) 0%,
      rgba(0, 5, 15, 0.5) 40%,
      rgba(0, 5, 15, 0.85) 80%,
      rgba(0, 5, 15, 0.98) 100%),
    url('https://unicheatsheet.com/t/8aab34469dab3575.webp');
  background-position: center;
  background-size: cover;
}
@media (min-width: 900px) {
  #header::before {
    background-image: linear-gradient(to bottom,
        rgba(0, 5, 15, 0.3) 0%,
        rgba(0, 5, 15, 0.5) 40%,
        rgba(0, 5, 15, 0.85) 80%,
        rgba(0, 5, 15, 0.98) 100%),
      url('https://unicheatsheet.com/t/15ba1adf152fd142.webp');
  }
}
.hero-canvas { bottom: auto; height: var(--hero-v); }

/* The course list's heading: "Semester N courses" / "Your courses" */
.sem-courses-h { font-size: clamp(.82rem, 1.6vw, .95rem); }

/* Public rows: a specialisation course carries its track's own name (common courses carry none) */
.sem-course-track { display: inline-block; margin: 2px 0 0 6px; padding: 2px 7px; border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 999px; font-size: .62rem; font-weight: 700; letter-spacing: .9px; line-height: 1.5; text-transform: uppercase;
  color: var(--accent); background: rgba(0, 229, 255, 0.08); vertical-align: 2px; white-space: nowrap; }
.sem-course-n { min-width: 0; overflow-wrap: anywhere; }

/* Paid home: "Your courses" (the account's own, in its exam order), then Continue, then the exam card */
.sem-courses--mine { margin-top: clamp(16px, 3vh, 26px); }
.sem-course-sem { display: inline-block; margin-left: 6px; font-size: .7rem; font-weight: 600; letter-spacing: .6px; color: var(--text-secondary); white-space: nowrap; }
.sem-jump .uc-ecp { align-self: stretch; padding: 0; margin-top: clamp(14px, 3vh, 26px); text-align: left; }

/* "Choose your semester" — a study action needs a semester first: one quiet line + a short accent ring on the pills */
.sem-jump-hint { display: block; min-height: 0; font-size: .82rem; font-weight: 600; color: var(--accent); text-align: center; }
.sem-jump-hint:empty { display: none; }
.sem-jump.is-prompt .sem-jump-pills { border-radius: 14px; animation: semPrompt 1.6s ease-out 2; }
@keyframes semPrompt { 0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.55); } 70% { box-shadow: 0 0 0 12px rgba(0, 229, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .sem-jump.is-prompt .sem-jump-pills { animation: none; box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.55); } }

/* ============================================
   HOMEPAGE R (2026-10): course search, real course counts, "Inside Semester N", the access band, compact footer, paid band.
   Every rule targets the redesigned homepage's own classes (or #header.uc-paid-home, set by the router on that page only),
   except the track badge size below (9.9 -> 11.2 px, audit F-16), which also applies to the explorer on older pages.
   ============================================ */
/* Course rows: one quiet line of real counts under the name (the name stays the row's first thing) */
.sem-course-m { display: block; margin-top: 3px; font-weight: 400; font-size: .8rem; line-height: 1.4; letter-spacing: 0;
  color: rgba(255, 255, 255, 0.7); overflow-wrap: anywhere; }
.sem-course .sem-course-track { font-size: .7rem; letter-spacing: .5px; }           /* 11.2 px: readable, not shrunk */
/* "Not here? Search all N courses": opens the same Search */
.sem-escape { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin: 8px 0 0; padding: 0 12px;
  border: 0; background: none; color: rgba(255, 255, 255, 0.8); font: 500 .88rem/1.3 var(--f-ui); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(0, 229, 255, 0.6); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.sem-escape:hover { color: #fff; }
.sem-escape:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
/* Hero: "Find your course" opens the existing Search; the semester question follows it */
.hero-find { box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: min(460px, 100%); min-height: 52px; margin: 20px auto 0;
  padding: 0 16px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 10, 20, 0.8); color: rgba(255, 255, 255, 0.8);
  font: 500 1rem/1.25 var(--f-ui); text-align: left; cursor: text; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: border-color .2s var(--spring-out); }
.hero-find svg { flex: 0 0 auto; color: var(--accent); }
.hero-find:hover { border-color: var(--accent); }
.hero-find:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.text-box p.hero-or { display: table; margin: 16px auto 4px; padding: 2px 10px; border-radius: 6px; font-size: .88rem; font-weight: 500; line-height: 1.5;
  color: #fff; background: rgba(0, 5, 15, 0.6); }
.hero-or ~ .sem-jump .sem-jump-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .hero-find { transition: none; } }

/* "Inside every course" / "Inside Semester N": real files from a real course (fixed-size panels: nothing moves on a choice) */
.inside { padding: clamp(44px, 7vw, 72px) max(16px, env(safe-area-inset-right, 0px)) clamp(44px, 7vw, 72px) max(16px, env(safe-area-inset-left, 0px)); background: #05080f; }
.inside-in { max-width: 1040px; margin: 0 auto; }
.inside-title { margin: 0; font-family: var(--f-ui); font-weight: 500; letter-spacing: -0.01em; font-size: clamp(1.55rem, 4.6vw, 2.2rem);
  line-height: 1.15; color: #fff; text-wrap: balance; }
.inside-sub { margin: 8px 0 0; max-width: 62ch; font-size: .95rem; line-height: 1.5; color: rgba(255, 255, 255, 0.74); }
.inside-sub a { color: #fff; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.inside-sub a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.inside-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 768px) { .inside-list { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
.inside-a { box-sizing: border-box; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; height: 100%; min-height: 160px;
  padding: 12px 16px 12px 12px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); color: #fff; text-decoration: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: border-color .2s var(--spring-out), background-color .2s var(--spring-out); }
.inside-a:hover { border-color: var(--border-hover); background: rgba(255, 255, 255, 0.08); }
.inside-a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.inside-a img { width: 96px; height: 136px; object-fit: cover; object-position: top; border-radius: 7px; background: #0e1420;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 8px 18px -8px rgba(0, 0, 0, 0.8); }
.inside-b { min-width: 0; }
.inside-h { display: block; font: 700 1.05rem/1.25 var(--f-ui); }
.inside-r { display: block; margin-top: 3px; font-size: .88rem; font-weight: 600; line-height: 1.35; color: #fff; overflow-wrap: anywhere; }
.inside-d { display: block; margin-top: 4px; font-size: .82rem; line-height: 1.45; color: rgba(255, 255, 255, 0.74); }
.inside-n { display: block; margin-top: 10px; font-size: .8rem; font-weight: 600; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .inside-a { transition: none; } }

/* Access band: the first price and purchase action on the homepage; price + contents come from /payment/prices */
.access { padding: clamp(36px, 6vw, 56px) max(16px, env(safe-area-inset-right, 0px)) clamp(44px, 7vw, 64px) max(16px, env(safe-area-inset-left, 0px)); background: #05080f; }
.access-in { box-sizing: border-box; max-width: 760px; margin: 0 auto; display: grid; gap: 14px; padding: 22px 20px; border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -24px rgba(0, 0, 0, 0.9); }
@media (min-width: 768px) { .access-in { padding: 28px 32px; } }
.access .access-h { margin: 0 0 6px; font: 500 clamp(1.35rem, 4vw, 1.75rem)/1.2 var(--f-ui); letter-spacing: -0.01em; color: #fff; }
.access-what { margin: 0; font-size: .95rem; line-height: 1.5; color: #fff; }
.access-buy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 10px 0 14px; }
.access-amt { display: inline-block; min-width: 3.4ch; min-height: 1em; font-family: var(--f-ui); font-weight: 600; font-size: clamp(2rem, 6vw, 2.4rem); line-height: 1; color: #fff; font-variant-numeric: lining-nums; }
/* /paid/'s rule: no number until the checkout's own price arrives (never a stale one); the space is kept, so nothing shifts */
.access-amt[data-uc-price]:not(.uc-priced) { visibility: hidden; }
.access-for { font: 500 1rem/1.4 var(--f-ui); color: rgba(255, 255, 255, 0.86); }
.access-go { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 12px;
  background: var(--accent); color: #001018; font: 700 1rem/1 var(--f-ui); text-decoration: none; touch-action: manipulation;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 18px -10px rgba(0, 0, 0, 0.9); transition: background-color .2s var(--spring-out); }
.access-go:hover { background: #63f0ff; }
.access-go:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 767px) { .access-go { width: 100%; } }
.access-how { margin: 0; max-width: 56ch; font-size: .88rem; line-height: 1.55; color: rgba(255, 255, 255, 0.7); }
@media (prefers-reduced-motion: reduce) { .access-go { transition: none; } }

/* Compact footer: who made it, how to ask for a course, About / Pricing / Gosign */
.footer.home-foot { padding: 32px max(16px, env(safe-area-inset-right, 0px)) 36px max(16px, env(safe-area-inset-left, 0px)); text-align: center;
  background: rgb(0, 5, 15); border-top: 1px solid rgba(255, 255, 255, 0.08); }
.footer.home-foot::before { display: none; }
.footer.home-foot p { margin: 0 0 6px; font-size: .88rem; line-height: 1.5; color: rgba(255, 255, 255, 0.74); }
.footer.home-foot .home-foot-built { color: #fff; font-weight: 500; }
.footer.home-foot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: #fff; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(0, 229, 255, 0.6); }
.footer.home-foot a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.home-foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 6px; margin: 4px 0; }
.footer.home-foot .home-foot-copy { font-size: .78rem; color: rgba(255, 255, 255, 0.62); }

/* Paid home on the redesigned page: a short photo band, the wordmark smaller, then Continue + Your courses */
#header.uc-paid-home { --hero-v: 46vh; min-height: var(--hero-v); align-items: flex-start; }
@supports (height: 100svh) { #header.uc-paid-home { --hero-v: 46svh; } }
#header.uc-paid-home .text-box { padding-top: clamp(84px, 11vh, 104px); padding-bottom: 24px; }
#header.uc-paid-home .text-box h1 { font-size: clamp(24px, 4.2vw, 40px); }

/* ============================================
   ALTERNATIVE C (2026-10, <!-- HOME:V3 -->): Brand-Preserving Study Workspace. Everything below is scoped to
   body.home-v3 (the V3 homepage only): the bookshop photo and logo stay; the public hero is a glass panel sized to its
   content, the course lists sit in their own section, the paid page is a calm study workspace under a short photo band.
   ============================================ */
body.home-v3 {
  --v3-bg: #0B0E14; --v3-surface: #141A25; --v3-surface-h: #1B2230; --v3-line: rgba(255, 255, 255, 0.08);
  --v3-soft: #DDE2EA; --v3-muted: #A3ACBC; --v3-accent-t: #7FE7F7; --v3-on-accent: #04252B;
  --v3-w: 1200px; --v3-w-paid: 1120px;
  --v3-gut-l: max(clamp(20px, 4vw, 40px), env(safe-area-inset-left, 0px));
  --v3-gut-r: max(clamp(20px, 4vw, 40px), env(safe-area-inset-right, 0px));
  background-color: var(--v3-bg);
}
.home-v3 .serif-h, .home-v3 .sem-courses-top .sem-courses-h, .home-v3 .uc-sec-h, .home-v3 .sem-mine-head .sem-courses-h {
  font-family: var(--f-ui); font-weight: 500; letter-spacing: -0.01em; text-transform: none; color: #fff;
}

/* ---- public hero: original photo, glass panel, height = content ---- */
.home-v3 #header { min-height: 0; padding-bottom: 0; align-items: flex-start; background: var(--v3-bg); }
/* the same photo layer and particle canvas as before (#header::before, the phone / desktop derivatives), now as tall as the
   hero itself, fading into the page colour */
.home-v3 #header { --hero-v: 100%; }
.home-v3 #header::before {
  background-image: linear-gradient(180deg, rgba(11, 14, 20, 0.45) 0%, rgba(11, 14, 20, 0.5) 60%, #0B0E14 100%), url('https://unicheatsheet.com/t/8aab34469dab3575.webp');
  background-position: center 32%;
}
@media (min-width: 900px) {
  .home-v3 #header::before { background-image: linear-gradient(180deg, rgba(11, 14, 20, 0.45) 0%, rgba(11, 14, 20, 0.5) 60%, #0B0E14 100%), url('https://unicheatsheet.com/t/15ba1adf152fd142.webp'); }
}
@supports (min-height: 100dvh) { .home-v3 #header { min-height: 0; } }
/* the hero is sized to its content now; the decorative particle canvas (sized to the window) must not draw over what follows */
.home-v3 #header { overflow: hidden; }
@media screen and (max-width: 640px) { .home-v3 #header { padding-bottom: 0; } }
.home-v3 #header:not(.uc-paid-home) .text-box { width: 100%; max-width: none; padding: clamp(92px, 12vw, 128px) var(--v3-gut-r) clamp(40px, 7vw, 104px) var(--v3-gut-l); }
.home-v3 #header:not(.uc-paid-home) .text-box .container {
  /* frosted glass: the bookshop photo stays recognisable through and around the panel; --v3-glass-a = panel opacity */
  --v3-glass-a: 0.60;   /* owner-approved 2026-10-22 */
  box-sizing: border-box; width: 100%; max-width: 720px; margin: 0 auto; padding: clamp(20px, 4vw, 36px); border-radius: 22px;
  background: rgba(11, 14, 20, var(--v3-glass-a)); border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
/* no backdrop blur available: a denser panel keeps the text readable on the sharp photo */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .home-v3 #header:not(.uc-paid-home) .text-box .container { background: rgba(11, 14, 20, 0.86); }
}
.home-v3 #header:not(.uc-paid-home) .text-box h1 { font-size: clamp(30px, 6vw, 64px); margin: 0; }
.home-v3 #header:not(.uc-paid-home) .text-box .container > p { margin: 0; }
.home-v3 #header .text-box p.impact { font-size: .8rem !important;   /* beats the legacy phone rule (.text-box p … !important, Stage F) */
  font-weight: 400; line-height: 1.4; color: rgba(255, 255, 255, 0.6); letter-spacing: 0; text-shadow: none; }
.home-v3 #header .text-box p.impact u { text-decoration: none; }
.home-v3 #header .text-box p.impact a { display: inline-flex; align-items: center; min-height: 44px; color: rgba(255, 255, 255, 0.72); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.35); text-underline-offset: 3px; font-weight: 500; padding: 0 4px; margin: 0 -4px; }   /* 44 px target, same look */
.home-v3 #header .text-box p.impact a:hover { color: #fff; }
.home-v3 .hero-find { width: 100%; max-width: 520px; margin: 4px auto 0; border-radius: 12px; background: var(--v3-bg); border-color: rgba(255, 255, 255, 0.22); }
.home-v3 .text-box p.hero-or { margin: 4px auto 0; }
.home-v3 .sem-jump { margin-top: 0; }
.home-v3 .sem-pill { min-height: 48px; padding: 0 18px; border-radius: 12px; font-size: 1rem; background: rgba(11, 14, 20, 0.85); border-color: rgba(255, 255, 255, 0.22); }
@media (max-width: 640px) {
  .home-v3 .sem-pill { padding: 0 12px; font-size: .94rem; }
  .home-v3 #header:not(.uc-paid-home) .text-box .container { gap: 10px; }
}
/* phones: Sem 1 … 5 stay on one row (as in Homepage R), every pill still >= 44 px */
@media (max-width: 480px) {
  .home-v3 #header:not(.uc-paid-home) .text-box { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .home-v3 #header:not(.uc-paid-home) .text-box .container { padding: 18px 14px; }
  .home-v3 .sem-jump-pills { flex-wrap: nowrap; gap: 5px; }
  .home-v3 .sem-pill { min-width: 44px; min-height: 44px; padding: 0 clamp(5px, 1.6vw, 10px); font-size: clamp(.78rem, 3.4vw, .9rem); white-space: nowrap; }
}

/* ---- public course section (HOME:COURSES), after the hero ---- */
.home-v3 .sem-list { padding: 0 var(--v3-gut-r) 0 var(--v3-gut-l); background: var(--v3-bg); }
.home-v3 .sem-list-in { max-width: var(--v3-w); margin: 0 auto; }
.home-v3 .sem-list .sem-courses { width: 100%; margin: 0; padding: 24px 0 56px; text-align: left; scroll-margin-top: 84px; }
.home-v3 .sem-list .sem-courses[hidden] { display: none; }
/* landing on a list (?sem=N#courses): clear the fixed logo, which reaches 92px from 768px up (84px on phones, as #courses) */
@media (min-width: 768px) { .home-v3 .sem-list .sem-courses { scroll-margin-top: 100px; } }
.home-v3 .sem-courses-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 0 0 18px; }
.home-v3 .sem-courses-top .sem-courses-h { margin: 0; font-size: clamp(1.4rem, 3.4vw, 1.75rem); line-height: 1.2; text-align: left; }
.home-v3 .sem-courses-sub { margin: 0; font-size: .875rem; color: var(--v3-muted); }
.home-v3 .sem-list .sem-courses ul, .home-v3 .uc-study .sem-courses--mine ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.home-v3 .sem-list .sem-course, .home-v3 .uc-study .sem-course {
  min-height: 76px; padding: 14px 20px; border-radius: 14px; background: var(--v3-surface); border: 1px solid var(--v3-line); backdrop-filter: none; -webkit-backdrop-filter: none;
}
.home-v3 .sem-list .sem-course:hover, .home-v3 .uc-study .sem-course:hover { background: var(--v3-surface-h); border-color: rgba(0, 229, 255, 0.45); }
.home-v3 .sem-list .sem-course-n, .home-v3 .uc-study .sem-course-n { font-size: 1.06rem; font-weight: 600; line-height: 1.35; }
.home-v3 .sem-list .sem-course-m, .home-v3 .uc-study .sem-course-m { margin-top: 3px; font-size: .875rem; color: var(--v3-muted); }
.home-v3 .sem-list .sem-escape { justify-content: flex-start; width: auto; margin: 14px 0 0; padding: 0; color: var(--v3-accent-t); text-decoration: underline; text-underline-offset: 3px; font-size: .875rem; }

/* ---- Inside Semester N + access + footer: shared width, calm surfaces ---- */
.home-v3 .inside { background: #0F131B; border-top: 1px solid rgba(255, 255, 255, 0.06); border-bottom: 1px solid rgba(255, 255, 255, 0.06); padding-left: var(--v3-gut-l); padding-right: var(--v3-gut-r); }
.home-v3 .inside-in { max-width: var(--v3-w); }
.home-v3 .inside-a { background: var(--v3-surface); border-color: var(--v3-line); border-radius: 16px; }
.home-v3 .inside-sub { color: #B8C0CD; }
.home-v3 .access { background: var(--v3-bg); padding-left: var(--v3-gut-l); padding-right: var(--v3-gut-r); padding-top: clamp(40px, 6vw, 64px); }
.home-v3 .access-in { max-width: var(--v3-w); display: grid; gap: 28px 40px; padding: clamp(24px, 4vw, 40px); border-radius: 20px; background: var(--v3-surface); border: 1px solid rgba(0, 229, 255, 0.22); }
@media (min-width: 860px) { .home-v3 .access-in { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } }
.home-v3 .access-how-box { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.home-v3 .access-how-h { margin: 0; font: 600 1rem/1.4 var(--f-ui); color: #fff; }
.home-v3 .access-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--v3-soft); font-size: .95rem; line-height: 1.5; }
.home-v3 .access-steps li::marker { color: var(--v3-muted); }
.home-v3 .footer.home-foot { background: var(--v3-bg); border-top: 1px solid var(--v3-line); }

/* ---- paid: short photo band, left-aligned wordmark + the account's own summary ---- */
.home-v3 #header.uc-paid-home { --hero-v: 100%; min-height: 0; align-items: flex-end; }
.home-v3 #header.uc-paid-home .text-box { width: 100%; max-width: calc(var(--v3-w-paid) + 80px); padding: clamp(84px, 11vw, 112px) var(--v3-gut-r) clamp(26px, 4vw, 44px) var(--v3-gut-l); text-align: left; }
.home-v3 #header.uc-paid-home .text-box h1 { font-size: clamp(30px, 4.4vw, 48px); margin: 0; text-align: left; }
.home-v3 .uc-sum { margin: 6px 0 0; font-size: 1rem; line-height: 1.5; color: var(--v3-soft); }

/* ---- paid study workspace ---- */
.home-v3 .uc-study { padding: 8px var(--v3-gut-r) 80px var(--v3-gut-l); background: var(--v3-bg); color: #fff; font-family: var(--f-ui); }
.home-v3 .uc-study-in { max-width: var(--v3-w-paid); margin: 0 auto; display: flex; flex-direction: column; gap: 48px; }
.home-v3 .uc-sec-h { margin: 0 0 16px; font-size: clamp(1.4rem, 3vw, 1.65rem); line-height: 1.2; }
.home-v3 .uc-study .sem-jump { margin: 0; align-items: stretch; animation: none; gap: 0; }
.home-v3 .uc-study .sem-courses--mine { width: 100%; margin: 0; text-align: left; }
.home-v3 .sem-mine-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 0 0 18px; }
.home-v3 .sem-mine-head .sem-courses-h { margin: 0; font-size: clamp(1.4rem, 3vw, 1.65rem); line-height: 1.2; text-align: left; }
.home-v3 .sem-filter { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--v3-surface); }
.home-v3 .sem-filter-b { min-height: 44px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--v3-muted); font: 500 .875rem/1 var(--f-ui); cursor: pointer; }
.home-v3 .sem-filter-b[aria-pressed="true"] { background: #2A3344; color: #fff; font-weight: 600; }
.home-v3 .sem-filter-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-v3 .uc-study li[hidden] { display: none; }
.home-v3 .sem-courses--mine.is-filtered .sem-course-sem { display: none; }   /* one semester shown: its tag says nothing new */
/* Pick up where you left off */
.home-v3 .uc-cont-card { box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 24px 28px; padding: 24px; border-radius: 18px;
  background: var(--v3-surface); border: 1px solid rgba(0, 229, 255, 0.25); color: #fff; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.home-v3 .uc-cont-card:hover { border-color: rgba(0, 229, 255, 0.6); background: var(--v3-surface-h); }
.home-v3 .uc-cont-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.home-v3 .uc-cont-card .uc-pv { flex: 0 0 auto; width: 120px; height: 170px; object-fit: cover; object-position: top; border-radius: 8px; background: #0e1420; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.home-v3 .uc-cont-b { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.home-v3 .uc-cont-card .uc-next-k { font: 600 .875rem/1.4 var(--f-ui); color: var(--v3-accent-t); letter-spacing: 0; text-transform: none; }
.home-v3 .uc-cont-card .uc-next-t { font: 500 clamp(1.35rem, 2.6vw, 1.75rem)/1.2 var(--f-ui); overflow-wrap: anywhere; }
.home-v3 .uc-cont-card .uc-next-m { font-size: .95rem; line-height: 1.45; color: var(--v3-muted); overflow-wrap: anywhere; }
.home-v3 .uc-cont-card .uc-next-go { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px; border-radius: 12px; background: var(--accent); color: var(--v3-on-accent); font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) {
  .home-v3 .uc-study-in { gap: 40px; }
  .home-v3 .uc-cont-card { padding: 20px; gap: 16px 20px; }
  .home-v3 .uc-cont-card .uc-pv { width: 72px; height: 102px; }
  .home-v3 .uc-cont-b { flex-basis: 180px; }
  .home-v3 .uc-cont-card .uc-next-go { width: 100%; }
}
/* Find a resource (same finder and results as before, restyled) */
.home-v3 .uc-find { margin: 0; }
.home-v3 .uc-find-label { display: block; margin: 0 0 8px; font: 500 .875rem/1.4 var(--f-ui); color: var(--v3-muted); }
.home-v3 .uc-find-box { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 18px; border-radius: 14px; background: var(--v3-surface); border: 1px solid rgba(255, 255, 255, 0.14); color: var(--v3-muted); }
.home-v3 .uc-find-box:focus-within { border-color: rgba(127, 231, 247, 0.6); }
.home-v3 .uc-find-box svg { flex: 0 0 auto; }
.home-v3 .uc-find-in { flex: 1 1 auto; min-width: 0; min-height: 52px; padding: 0; background: transparent; border: 0; outline: none; color: #fff; font: 400 1rem/1.4 var(--f-ui); -webkit-appearance: none; appearance: none; }
.home-v3 .uc-find-in::placeholder { color: rgba(255, 255, 255, 0.4); }
.home-v3 .uc-find-hint { margin: 8px 0 0; font-size: .8rem; line-height: 1.5; color: var(--v3-muted); }
.home-v3 .uc-find-out { list-style: none; margin: 8px 0 0; padding: 0; border-radius: 14px; overflow: hidden; background: var(--v3-surface); border: 1px solid var(--v3-line); }
.home-v3 .uc-find-out:empty { display: none; }
.home-v3 .uc-find-out .uc-home-item { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.home-v3 .uc-find-out .uc-home-item:last-child { border-bottom: 0; }
.home-v3 .uc-home-link { display: block; padding: 14px 18px; color: #fff; text-decoration: none; }
.home-v3 .uc-home-link:hover { background: var(--v3-surface-h); }
.home-v3 .uc-home-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.home-v3 .uc-home-t { display: block; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.home-v3 .uc-home-m { display: block; margin-top: 2px; font-size: .875rem; color: var(--v3-muted); }
.home-v3 .uc-find-none { padding: 14px 18px; font-size: .9rem; color: var(--v3-muted); }
/* Recently opened + Saved: preview cards (text-only when a card has no preview) */
.home-v3 .uc-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.home-v3 .uc-card { position: relative; min-width: 0; border-radius: 16px; background: var(--v3-surface); border: 1px solid var(--v3-line); }
.home-v3 .uc-card:hover { background: var(--v3-surface-h); }
.home-v3 .uc-card-a { display: flex; flex-direction: column; gap: 6px; height: 100%; box-sizing: border-box; padding: 14px; color: #fff; text-decoration: none; border-radius: 16px; }
.home-v3 .uc-card-a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.home-v3 .uc-card .uc-pv { display: block; width: 100%; height: 150px; object-fit: cover; object-position: top; border-radius: 8px; background: #0e1420; margin-bottom: 4px; }
.home-v3 .uc-card-k { font-size: .8rem; font-weight: 600; color: var(--v3-accent-t); }
.home-v3 .uc-card-t { font-size: 1rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; padding-right: 36px; }
.home-v3 .uc-card:not(.no-pv) .uc-card-t { padding-right: 0; }
.home-v3 .uc-card-m { font-size: .875rem; line-height: 1.4; color: var(--v3-muted); overflow-wrap: anywhere; }
.home-v3 .uc-card .uc-home-savef { position: absolute; top: 8px; right: 8px; margin: 0; }
.home-v3 .uc-card .uc-home-star { min-width: 44px; min-height: 44px; border: 0; border-radius: 10px; background: rgba(11, 14, 20, 0.72); color: rgba(255, 255, 255, 0.7); font-size: 1.25rem; cursor: pointer; }
.home-v3 .uc-card .uc-home-star.is-on, .home-v3 .uc-card .uc-home-star:hover { color: #ffd93d; }
.home-v3 .uc-card .uc-home-star:focus-visible { outline: 2px solid var(--accent); }
@media (max-width: 640px) {
  .home-v3 .uc-card-a { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-content: start; padding-right: 56px; }
  .home-v3 .uc-card .uc-pv { grid-column: 1; grid-row: 1 / span 3; width: 64px; height: 90px; margin: 0; }
  .home-v3 .uc-card.no-pv .uc-card-a { grid-template-columns: minmax(0, 1fr); }
  .home-v3 .uc-card-t { padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) { .home-v3 .uc-cont-card, .home-v3 .sem-course { transition: none; } }
