/* The school's landing (promt.engineer): its own look, not the course page.
   Metaphor: a course is a folded paper guide; scrolling unfolds it into its lessons (landing.js).
   Paper and ink; the only colour is the featured course's accent and its illustrations. */

/* the panel size: a fallback here, landing.js sets the real one inline on <html> (a value on body would override it) */
html { --S: min(220px, calc((100vw - 32px) / 3)); }
body.ld { --paper: #ECE9E3; --sheet: #FBFAF7; --sheet-back: #F1EEE8;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #F6F4F0 0%, var(--paper) 70%) fixed, var(--paper);
  color: var(--ink); font-family: var(--sans); }
.ld a { color: inherit; }
.ld-label { font-size: 12px; line-height: 18px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* the marker: the logo's swash under a word, in the course colour */
.ld-mark { position: relative; z-index: 0; background: none; color: inherit; white-space: nowrap; }
.ld-mark::before { content: ""; position: absolute; z-index: -1; left: -.06em; right: -.08em; top: 52%; bottom: 2%; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M1 5C18 3 35 4.5 52 3.6C68 2.8 84 4 99 2.6L99.4 17C83 18.2 66 16.6 49 17.6C32 18.6 16 17 1.2 18.4Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M1 5C18 3 35 4.5 52 3.6C68 2.8 84 4 99 2.6L99.4 17C83 18.2 66 16.6 49 17.6C32 18.6 16 17 1.2 18.4Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }

/* ---------- header: brand, the brochure's state, start ---------- */
.ld-top { position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: 64px; display: flex; align-items: center; gap: var(--s-4); padding: 0 var(--s-6);
  border-bottom: 1px solid rgba(28, 26, 25, .14); background: rgba(236, 233, 227, .72); backdrop-filter: blur(10px); }
.ld-top .brand { font-size: var(--t-sm); }
.ld-states { display: flex; gap: var(--s-1); margin: 0 auto; }
.ld-states a { height: 30px; display: inline-flex; align-items: center; padding: 0 var(--s-3); border-radius: var(--r-pill); text-decoration: none;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); transition: background .25s, color .25s; }
.ld-states a.on { background: var(--ink); color: #fff; }
.ld-start { height: 36px; display: inline-flex; align-items: center; padding: 0 var(--s-4); border-radius: var(--r-pill); border: var(--stroke) solid var(--ink);
  font-size: var(--t-sm); font-weight: 600; text-decoration: none; white-space: nowrap; }
.ld-start:hover { background: var(--ink); color: #fff; }

/* ---------- the stage ---------- */
.ld-stage { position: relative; }
.ld-sticky { position: relative; padding: 120px var(--s-6) var(--s-8); }
.ld-hero { max-width: 640px; }
.ld-hero .ld-label { margin-bottom: var(--s-5); }
.ld-hero h1 { font-size: clamp(44px, 6.2vw, 92px); line-height: .98; letter-spacing: -.045em; font-weight: 700; margin: 0; }
.ld-hero p { margin: var(--s-6) 0 0; max-width: 30em; font-size: var(--t-body); line-height: var(--lh-body); color: var(--ink-2); }
.ld-hints { display: none; }

/* flat sheet: no JS or reduced motion */
.ld-sheet-wrap { margin-top: var(--s-8); }
.ld-sheet { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(3, var(--S)); width: max-content;
  box-shadow: 0 30px 60px -30px rgba(28, 26, 25, .35); }

/* ---------- a panel (cover or lesson) ---------- */
.ld-panel { width: var(--S); height: var(--S); background: var(--sheet); container-type: inline-size; box-shadow: inset 0 0 0 .5px rgba(28, 26, 25, .12); }
.ld-panel > a { height: 100%; display: flex; flex-direction: column; padding: 8cqi; text-decoration: none; color: var(--ink); }
.ld-pn { font-size: max(9px, 4.6cqi); line-height: 1.3; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ld-panel img { display: block; width: 58%; margin: auto; aspect-ratio: 1; object-fit: contain; }
.ld-pt { font-size: max(10px, 7.4cqi); line-height: 1.08; font-weight: 700; letter-spacing: -.02em; }
.ld-panel > a:hover .ld-pt { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.ld-cover { background: var(--accent); }
.ld-cv-top, .ld-cv-bot { display: flex; justify-content: space-between; gap: 6px; font-size: max(8px, 4.4cqi); line-height: 1.3; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.ld-cv-top { padding-bottom: 4cqi; border-bottom: 1px solid var(--ink); }
.ld-cv-bot { margin-top: auto; padding-top: 4cqi; border-top: 1px solid var(--ink); }
.ld-cv-title { margin-top: 9cqi; font-size: max(14px, 13.5cqi); line-height: .96; letter-spacing: -.04em; font-weight: 700; }
.ld-cv-sub { margin-top: 5cqi; font-size: max(9px, 5.4cqi); line-height: 1.25; }

/* ---------- 3D brochure (landing.js adds .ld-3d and builds the folds) ---------- */
.ld-3d .ld-stage { height: 180vh; }   /* a short scroll: the guide unfolds within about one screen */
.ld-3d .ld-sticky { position: sticky; top: 0; height: 100vh; padding: 0; overflow: hidden; }
.ld-3d .ld-hero { position: absolute; z-index: 2; left: var(--s-6); top: max(120px, 20vh); max-width: min(640px, 46vw); }
.ld-3d .ld-hints { display: flex; justify-content: space-between; position: absolute; left: var(--s-6); right: var(--s-6); bottom: var(--s-5);
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ld-3d .ld-sheet-wrap { position: absolute; inset: 64px 0 0; margin: 0; perspective: 1900px; perspective-origin: 50% 40%; }
.ld-3d .ld-sheet { display: none; }
.ld-fold { position: absolute; left: 50%; top: 50%; width: var(--S); height: var(--S); transform-style: preserve-3d; will-change: transform; }
.ld-colx { position: absolute; left: 0; top: 0; width: var(--S); height: var(--S); transform-style: preserve-3d; }
.ld-vf { position: absolute; left: 0; top: var(--S); width: var(--S); height: var(--S); transform-origin: 50% 0; transform-style: preserve-3d; }
.ld-hf { position: absolute; left: var(--S); top: 0; width: var(--S); height: var(--S); transform-origin: 0 50%; transform-style: preserve-3d; }
.ld-leaf { position: absolute; left: 0; top: 0; width: var(--S); height: var(--S); transform-style: preserve-3d; }
.ld-leaf > .ld-panel { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ld-back { position: absolute; inset: 0; background: var(--sheet-back); transform: rotateY(180deg); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: inset 0 0 0 .5px rgba(28, 26, 25, .14); }
/* light on a turning leaf: darker as it turns away */
.ld-leaf::after { content: ""; position: absolute; inset: 0; background: #1C1A19; opacity: var(--sh, 0); pointer-events: none; backface-visibility: hidden; }
.ld-shadow { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: rgba(28, 26, 25, .32); filter: blur(28px); pointer-events: none; }

/* ---------- lessons as a list (phones; desktop keeps it for keyboard and screen readers) ---------- */
.ld-list ol { list-style: none; margin: 0 auto; padding: 0 var(--s-5); max-width: 720px; counter-reset: none; }
.ld-list li + li { border-top: 1px solid rgba(28, 26, 25, .14); }
.ld-list a { display: flex; gap: var(--s-4); padding: var(--s-4) 0; text-decoration: none; }
.ld-list b { font-size: var(--t-sm); color: var(--muted); font-weight: 600; min-width: 2ch; }
.ld-list span { font-weight: 600; font-size: var(--t-lg); line-height: var(--lh-lg); letter-spacing: -.01em; }
.ld-list small { display: block; margin-top: 2px; font-weight: 400; font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); letter-spacing: 0; }
@media (min-width: 761px) {
  .ld-list { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ld-list:focus-within { position: static; width: auto; height: auto; clip: auto; white-space: normal; padding: var(--s-6) 0; }
}

/* ---------- sections ---------- */
.ld-sec { max-width: 1120px; margin: 0 auto; padding: 140px var(--s-6) 0; }
.ld-sec h2, .ld-final h2 { margin: var(--s-4) 0 0; font-size: clamp(34px, 4vw, 56px); line-height: 1.02; letter-spacing: -.04em; font-weight: 700; max-width: 16em; }
.ld-lead { margin: var(--s-5) 0 0; max-width: 40em; font-size: var(--t-body); line-height: var(--lh-body); color: var(--ink-2); }
.ld-cards { list-style: none; margin: var(--s-7) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.ld-cards li { background: var(--sheet); border-radius: var(--r-xl); padding: var(--s-6); box-shadow: inset 0 0 0 1px rgba(28, 26, 25, .08); }
.ld-cards img { width: 104px; height: 104px; object-fit: contain; display: block; margin: 0 0 var(--s-4) -6px; }
.ld-cards h3, .ld-how h3 { margin: 0; font-size: var(--t-lg); line-height: var(--lh-lg); letter-spacing: -.01em; font-weight: 700; }
.ld-cards p, .ld-how p { margin: var(--s-2) 0 0; font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); }
.ld-how { list-style: none; margin: var(--s-7) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-7); }
.ld-how li { display: flex; gap: var(--s-5); align-items: flex-start; }
.ld-how img { width: 88px; height: 88px; object-fit: contain; flex: none; }
.ld-note { margin: var(--s-7) 0 0; padding-top: var(--s-4); border-top: 1px solid rgba(28, 26, 25, .14); font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); }

.ld-shelf { margin-top: var(--s-7); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.ld-book { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: var(--s-5); align-items: center; padding: var(--s-5); border-radius: var(--r-xl);
  background: var(--sheet); box-shadow: inset 0 0 0 1px rgba(28, 26, 25, .08); text-decoration: none; }
.ld-book-cover { width: 168px; aspect-ratio: 1; display: flex; flex-direction: column; padding: 14px; background: var(--accent); container-type: inline-size;
  box-shadow: 6px 8px 0 -2px var(--sheet-back), 6px 8px 0 -1px rgba(28, 26, 25, .18), 0 18px 30px -18px rgba(28, 26, 25, .5); transform: rotate(-2deg); transition: transform .25s; }
.ld-book-cover .ld-cv-title { font-size: 15cqi; margin-top: 10cqi; }
.ld-book-text { display: grid; gap: var(--s-2); font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); }
.ld-book-text b { font-size: var(--t-lg); line-height: var(--lh-lg); color: var(--ink); }
.ld-book-go { margin-top: var(--s-2); font-weight: 600; color: var(--ink); }
.ld-book.is-open:hover .ld-book-cover { transform: rotate(0) translateY(-4px); }
.ld-book.is-next .ld-book-cover { background: #AFC3F4; opacity: .55; }
.ld-book.is-next { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(28, 26, 25, .16); }

.ld-final { margin: 160px var(--s-6) 0; padding: var(--s-9) var(--s-7); border-radius: var(--r-xl); background: var(--ink); color: #fff; }
.ld-final p { margin: var(--s-4) 0 0; max-width: 34em; font-size: var(--t-body); line-height: var(--lh-body); color: var(--on-ink-2); }
.ld-final-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.ld-btn-light, .ld-btn-ghost { height: 48px; display: inline-flex; align-items: center; padding: 0 var(--s-5); border-radius: var(--r-md); font-weight: 600; text-decoration: none; }
.ld-btn-light { background: #fff; color: var(--ink) !important; }
.ld-btn-ghost { border: var(--stroke) solid rgba(255, 255, 255, .45); color: #fff !important; }
.ld-btn-ghost:hover { border-color: #fff; }
.ld-foot { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-7) var(--s-6);
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .ld-top { padding: 0 var(--s-4); height: 56px; }
  .ld-states { display: none; }
  .ld-top .brand { margin-right: auto; }
  .ld-3d .ld-hero { top: 84px; left: var(--s-4); right: var(--s-4); max-width: none; }
  .ld-hero h1 { font-size: 40px; line-height: 1.02; }
  .ld-hero p { margin-top: var(--s-4); font-size: var(--t-sm); line-height: var(--lh-sm); }
    .ld-3d .ld-hints { left: var(--s-4); right: var(--s-4); flex-direction: column; gap: 2px; font-size: 10px; }
  .ld-3d .ld-sheet-wrap { inset: 56px 0 0; }
  .ld-sec { padding: 96px var(--s-4) 0; }
  .ld-cards, .ld-how, .ld-shelf { grid-template-columns: 1fr; }
  .ld-book { grid-template-columns: 112px minmax(0, 1fr); }
  .ld-book-cover { width: 112px; padding: 10px; }
  .ld-final { margin: 96px var(--s-4) 0; padding: var(--s-7) var(--s-5); }
  .ld-list { padding-top: var(--s-6); }
}
@media (prefers-reduced-motion: reduce) { .ld-states a, .ld-book-cover { transition: none; } }
/* a small panel (phones): keep the cover to its title and the number */
@container (max-width: 170px) {
  .ld-cv-sub, .ld-cv-bot span:last-child, .ld-cv-top span:first-child { display: none; }
  .ld-cv-top { justify-content: flex-end; }
  .ld-cv-title { margin-top: 6cqi; font-size: 15cqi; }
}
@media (max-width: 760px) { .ld-3d .ld-hints span:last-child { display: none; } }
