/* Homepage — Index-Tab Tour, inside the Lecture Notebook world (DESIGN.md). */
.hm { background: var(--paper); }

/* ---- top bar ------------------------------------------------------------------- */
.hm-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.hm-top .brand { flex: none; }
.hm-top .brand span { display: grid; line-height: 1.25; white-space: nowrap; }
.hm-nav { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.hm-nav > a:not(.btn) { padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); }
.hm-nav > a:not(.btn):hover { color: var(--ink); background: var(--paper-2); }

/* ---- hero: the pitch + the tour on squared paper ---------------------------------- */
.hm-hero {
  display: grid; gap: clamp(28px, 4vw, 56px); align-items: center;
  padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 40px) clamp(32px, 5vw, 72px);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  border-bottom: 1px solid var(--line);
}
.hm-pitch { max-width: 36rem; }
.hm-pitch h1 { font-size: clamp(30px, 1.2rem + 3vw, 54px); line-height: 1.22; font-weight: 700; letter-spacing: -0.01em; }
.hm-pitch h1 span { display: inline; }
.hm-pitch h1 .hl { padding-inline: 2px; }
.hm-lead { margin-block-start: 18px; font-size: var(--fs-lg); line-height: 1.8; color: var(--ink-2); max-width: 34rem; }
.hm-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 26px; }
.hm-note { margin-block-start: 12px; font-size: var(--fs-sm); color: var(--ink-2); }

/* the tour: index tabs on the inline-start edge of the sheet */
.hm-tour { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
.hm-rail { position: relative; z-index: 2; padding-block: 18px; }
.hm-rail .tab { width: 84px; }
.hm-tab-n { font-size: 10.5px; opacity: 0.7; }
.hm-stage { display: grid; gap: 10px; min-width: 0; }
.hm-tab-note { min-height: 3.4em; font-size: var(--fs-sm); line-height: 1.7; color: var(--ink-2); max-width: 34rem; }
.hm-sheet-wrap { position: relative; max-width: 460px; width: 100%; }
.hm-sheet {
  --s: 0.5;
  --highlight: rgba(255, 224, 70, 0.78); /* white paper in both themes */
  position: relative; aspect-ratio: 210 / 297; overflow: hidden;
  background: #fff; border-radius: 2px; outline: 1px solid var(--line); box-shadow: var(--shadow-sheet);
}
.hm-sheet-host { position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 210mm; visibility: hidden; transform-origin: top right; }
[dir="ltr"] .hm-sheet-host { transform-origin: top left; }
.hm-sheet.is-ready .hm-sheet-host { visibility: visible; transform: scale(var(--s)); }
.hm-sheet-host .cv-page ~ .cv-page { display: none; }
.hm-sample { position: absolute; z-index: 3; inset-block-start: -12px; inset-inline-end: 12px; background: var(--paper); font-size: var(--fs-xs); }

/* overlays: what each tab demonstrates on top of the sheet */
.hm-ov { position: absolute; z-index: 2; }
.hm-ov[hidden] { display: none; }
.hm-ov-chat { inset-inline-end: -18px; inset-block-start: 44%; display: grid; gap: 8px; width: min(78%, 300px); }
.hm-bubble { padding: 10px 12px; border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.6; box-shadow: var(--shadow-pop); }
.hm-q { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.hm-a { background: var(--violet); color: var(--violet-ink); margin-inline-start: 24px; }
.hm-ov-chat .hm-bubble { animation: hm-in var(--t-slow) var(--ease-out) both; }
.hm-ov-chat .hm-a { animation-delay: 380ms; }
@keyframes hm-in { from { opacity: 0; transform: translateY(8px); } }

.hm-ov-a4 { inset: 0; pointer-events: none; }
.hm-dim { position: absolute; font-size: 12px; font-weight: 600; color: var(--blue); background: var(--paper); padding: 1px 6px; border-radius: 4px; }
.hm-dim-w { inset-block-start: -11px; inset-inline-start: 50%; transform: translateX(50%); }
[dir="ltr"] .hm-dim-w { transform: translateX(-50%); }
.hm-dim-h { inset-block-start: 50%; inset-inline-end: -14px; writing-mode: vertical-rl; }
.hm-ov-a4::before, .hm-ov-a4::after { content: ""; position: absolute; border: 0 dashed var(--blue); opacity: 0.6; }
.hm-ov-a4::before { inset-inline: 0; inset-block-start: -2px; border-top-width: 1.5px; }
.hm-ov-a4::after { inset-block: 0; inset-inline-end: -4px; border-inline-end-width: 1.5px; }

.hm-ov-ats {
  inset-inline-end: -18px; inset-block-start: 18%;
  margin: 0; padding: 12px 14px; list-style: none; display: grid; gap: 7px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop);
  font-size: var(--fs-sm);
}
.hm-ov-ats li { display: flex; align-items: center; gap: 10px; }
.hm-ov-ats .stamp { animation: stamp-press var(--t-slow) var(--ease-out) both; }
.hm-ov-ats li:nth-child(2) .stamp { animation-delay: 90ms; }
.hm-ov-ats li:nth-child(3) .stamp { animation-delay: 180ms; }
.hm-ov-ats li:nth-child(4) .stamp { animation-delay: 270ms; }
.hm-ov-ats li:nth-child(5) .stamp { animation-delay: 360ms; }
.hm-ov-ats li:nth-child(6) .stamp { animation-delay: 450ms; }

.hm-ov-pdf {
  inset-inline-end: -18px; inset-block-end: 10%;
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop);
  animation: hm-drop var(--t-slow) var(--ease-out) both;
}
.hm-ov-pdf strong { display: block; font-size: var(--fs-sm); }
.hm-ov-pdf small { color: var(--ink-2); font-size: var(--fs-xs); }
.hm-pdf-ic { display: grid; place-items: center; width: 40px; height: 48px; border-radius: 4px; background: var(--coral); color: var(--coral-ink); font-weight: 700; font-size: 12px; }
@keyframes hm-drop { from { opacity: 0; transform: translateY(-16px); } }

/* ---- live counts: written on ruled paper ------------------------------------------- */
.hm-stats {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 12px 40px;
  padding: 26px clamp(16px, 4vw, 40px);
  background-image: linear-gradient(transparent calc(100% - 1px), var(--rule) calc(100% - 1px));
  background-size: 100% 34px; background-position: 0 -1px;
  border-bottom: 1px solid var(--line);
}
.hm-stats p { display: flex; align-items: baseline; gap: 10px; }
.hm-stats strong { font-size: clamp(28px, 1rem + 2vw, 40px); color: var(--violet); line-height: 1; }
.hm-stats span { color: var(--ink-2); }
.hm-stats .hm-stats-note { flex-basis: 100%; justify-content: center; font-size: var(--fs-xs); color: var(--ink-3); }

/* ---- sections ------------------------------------------------------------------------ */
.hm-sec { max-width: 1080px; margin-inline: auto; padding: clamp(40px, 6vw, 72px) clamp(16px, 4vw, 40px) 0; }
.hm-sec h2 { font-size: var(--fs-2xl); margin-block-end: 22px; }
.hm-how ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; counter-reset: step; }
.hm-how li { position: relative; padding-inline-start: 56px; counter-increment: step; }
.hm-how li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; inset-block-start: 0;
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--violet); color: var(--violet); font-weight: 600;
}
.hm-how strong { font-size: var(--fs-lg); }
.hm-how p { margin-block-start: 4px; color: var(--ink-2); line-height: 1.75; max-width: 46ch; }

.hm-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.hm-guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.hm-guide-list a { display: grid; gap: 4px; padding: 16px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.hm-guide-list a:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.hm-guide-list span { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.7; }
.hm-guide-list time { color: var(--ink-3); font-size: var(--fs-xs); }

.hm-faq details { border-bottom: 1px solid var(--rule); }
.hm-faq summary { padding: 16px 4px; cursor: pointer; font-weight: 600; list-style-position: inside; }
.hm-faq details p { padding: 0 4px 18px; color: var(--ink-2); line-height: 1.8; max-width: 62ch; }

.hm-end { display: grid; justify-items: center; gap: 18px; text-align: center; padding: clamp(48px, 7vw, 88px) 16px; }
.hm-end h2 { font-size: clamp(22px, 1rem + 1.6vw, 32px); max-width: 24ch; }

.hm-foot { display: grid; justify-items: center; gap: 8px; padding: 22px 16px 30px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-3); }
.hm-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; }
.hm-foot a { color: var(--ink-2); display: inline-flex; min-height: 40px; align-items: center; }

/* ---- layout ------------------------------------------------------------------------------ */
@media (min-width: 980px) {
  .hm-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .hm-how ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hm-nav > a:not(.btn):not(.hm-lang) { display: none; }
  .hm-top { gap: 8px; }
  .hm-top .brand small { display: none; }
  .hm-top .brand img { width: 28px; height: 28px; }
  .hm-nav { gap: 0; }
  .hm-nav > a:not(.btn) { padding-inline: 7px; }
  .hm-nav .btn { padding-inline: 12px; }
  .hm-tour { grid-template-columns: minmax(0, 1fr); }
  .hm-rail { flex-direction: row; overflow-x: auto; padding-block: 0 10px; gap: 6px; }
  .hm-rail .tab { width: auto; flex: none; padding: 8px 12px; border-radius: var(--r-md) !important; transform: none !important; }
  .hm-rail .tab::before { inset-block: auto 0; inset-inline: 10px; width: auto; height: 3px; }
  .hm-ov-chat, .hm-ov-ats, .hm-ov-pdf { inset-inline-end: 8px; }
  .hm-sheet-wrap { margin-inline: auto; }
  .hm-ctas .btn { flex: 1 1 100%; }
}
@media (max-width: 400px) {
  .hm-top .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
