/* =============================================================
   landing.css: home, about, study and guestbook pages.
   Early-2000s library studying on a Win98-era desktop: real study
   photos as section backgrounds, a card-catalogue "idea network" and
   a connecting-points network over them (Vanta waves on the hero), Win98 windows on top.
   Performance: responsive WebPs (768/1280/1920, AI-upscaled from the
   originals); overlays are one canvas (paused off screen) and a couple of
   transformed layers.
   ============================================================= */

body:not(.app) { background: #071512; padding: var(--header-h) 0 0; display: block; }
.landing { color: #efe8d0; overflow-x: hidden; }
.landing h1, .landing h2, .landing h3 { margin: 0; }

/* ---------- Photo backgrounds + overlays ---------- */
.photo-zone { position: relative; isolation: isolate; overflow: hidden; }
.bg-photo {
  position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%;
  object-fit: cover; object-position: center 35%;
}
.bg-scrim {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 21, 18, 0.6) 0%, rgba(7, 21, 18, 0.72) 100%);
}
.hero-scrim {
  background:
    linear-gradient(90deg, rgba(7, 21, 18, 0.88) 0%, rgba(7, 21, 18, 0.66) 40%, rgba(7, 21, 18, 0.28) 100%),
    linear-gradient(0deg, rgba(7, 21, 18, 0.66) 0%, transparent 32%);
}
.idea-net {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none;
}

/* ---------- Shared bits ---------- */
.zone-title {
  font: 700 clamp(2rem, 4vw, 3.1rem)/1.1 var(--font-display); font-optical-sizing: auto;
  letter-spacing: -0.015em; color: #fdf9ec;
  text-shadow: 0 2px 18px rgba(7, 21, 18, 0.45);
}
.zone-title.dark { color: #12302b; text-shadow: none; }
.zone-sub { color: #d8d0b2; font-size: 1.08rem; margin: 10px 0 0; max-width: 56ch; }

.boot-line { font: 400 1.3rem/1 var(--font-crt); color: #cfc6a2; margin: 0 0 14px; letter-spacing: 0.04em; }
.caret { display: inline-block; width: 0.55em; height: 1em; margin-left: 4px; background: #cfc6a2; vertical-align: -0.12em; animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.cta-start {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 26px; border-radius: 6px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #e4dcba, #c9bf96); color: #12302b;
  font: 700 1.05rem/1 var(--font-ui); letter-spacing: 0.06em; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 4px 0 #6b6548, 0 0 0 1px #4d4630;
  transition: transform 0.12s, box-shadow 0.12s, filter var(--dur);
}
.cta-start:hover { filter: brightness(1.05); }
.cta-start:active { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 0 #6b6548, 0 0 0 1px #4d4630; }
.cta-start .cta-arrow { height: 18px; transition: transform var(--dur) var(--ease); }
.cta-start:hover .cta-arrow { transform: translateX(4px); }
.cta-start.sm { padding: 12px 20px; font-size: 0.98rem; }
.cta-ghost {
  display: inline-flex; align-items: center; padding: 14px 22px; border-radius: 6px; cursor: pointer;
  background: rgba(253, 249, 236, 0.06); color: #fdf9ec; border: 1px solid rgba(207, 198, 162, 0.55);
  font: 600 1rem/1 var(--font-ui); letter-spacing: 0.02em; text-decoration: none;
  transition: background var(--dur), border-color var(--dur);
}
.cta-ghost:hover { background: rgba(253, 249, 236, 0.14); border-color: #e2dcc2; }
.cta-ghost.sm { padding: 11px 18px; font-size: 0.95rem; }
.cta-ghost.on-paper { color: #12302b; background: #fffdf6; border-color: rgba(18, 48, 43, 0.35); }
.cta-ghost.on-paper:hover { background: #f1f6f3; border-color: #12302b; }

/* ---------- Hero ---------- */
.desk-hero {
  min-height: min(820px, calc(100vh - var(--header-h)));
  display: grid; grid-template-columns: 120px minmax(0, 760px); align-content: center;
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 48px);
}
.desk-icons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 26px; align-self: start; padding-top: 8px; }
.desk-icon {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 104px; padding: 6px 4px; border-radius: 4px;
  color: #fdf9ec; text-decoration: none; text-align: center; font: 500 0.86rem/1.2 var(--font-pixel);
  border: 1px dotted transparent;
}
.desk-icon img.px {
  height: 48px; transition: transform 0.15s var(--ease);
  /* a 1px cream outline so dark-lined icons (the paperclip) read on the dark photo */
  filter: drop-shadow(1px 0 0 #fdf9ec) drop-shadow(-1px 0 0 #fdf9ec) drop-shadow(0 1px 0 #fdf9ec) drop-shadow(0 -1px 0 #fdf9ec) drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.45));
}
.desk-icon span { padding: 1px 4px; text-shadow: 1px 1px 0 #000; }
.desk-icon:hover span, .desk-icon:focus-visible span { background: #2f6559; text-shadow: none; }
.desk-icon:hover img.px, .desk-icon:focus-visible img.px { transform: translateY(-3px); }
.desk-icon:focus-visible { outline: none; border-color: #fdf9ec; }

.hero-copy { position: relative; z-index: 2; }
.hero-title {
  font: 700 clamp(2.5rem, 6.2vw, 5rem)/0.98 var(--font-pixel) !important;
  letter-spacing: -0.015em; color: #fdf9ec;
  text-shadow: 4px 4px 0 rgba(159, 151, 115, 0.55);
}
.hero-title .word { display: inline-block; white-space: nowrap; }
.hero-title .ch { display: inline-block; }
.hero-sub { max-width: 48ch; margin: 18px 0 26px; color: #e2dcc2; font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.6; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---------- Hero waves (Vanta WAVES on three.js) ----------
   A see-through layer over the library photo: the WebGL canvas is injected into
   .waves-bg after the page has loaded. Without WebGL (or with reduced motion)
   only the photo shows. */
.waves-bg { position: absolute; inset: 0; z-index: -3; overflow: hidden; pointer-events: none; }
.waves-zone .bg-photo { z-index: -4; }
.waves-bg canvas { display: block; opacity: 0; transition: opacity 1.4s ease; }
.waves-bg.is-on canvas { opacity: 0.5; }
.waves-zone .hero-scrim {
  background: linear-gradient(90deg, rgba(7, 21, 18, 0.84) 0%, rgba(7, 21, 18, 0.58) 42%, rgba(7, 21, 18, 0.2) 100%),
    linear-gradient(0deg, rgba(7, 21, 18, 0.62) 0%, transparent 32%);
}

/* ---------- How it works ---------- */
.how { padding: clamp(56px, 8vw, 96px) clamp(16px, 4vw, 48px); }
.how-inner { max-width: 1180px; margin: 0 auto; }
.how-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 32px; }
.landing .win { --surface: #fdf9ec; --line-strong: rgba(18, 48, 43, 0.3); color: #1b2a25; box-shadow: inset 1px 1px 0 #fff, 4px 4px 0 rgba(0, 0, 0, 0.4); }
.how-step .win-body { padding: 18px 18px 20px; }
.how-icon { height: 44px; margin-bottom: 10px; }
.how-step h3 { font: 700 1.25rem/1.25 var(--font-display); color: #12302b; margin-bottom: 6px; }
.how-step p { font-size: 0.93rem; line-height: 1.55; color: #44544c; margin: 0; }
.method-strip { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 34px auto 0; padding: 0; max-width: 960px; }
.method-strip li {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 4px;
  background: rgba(7, 21, 18, 0.82); border: 1px solid rgba(207, 198, 162, 0.32); color: #e2dcc2;
  font: 600 0.88rem/1 var(--font-ui);
}
.method-strip ion-icon { color: #cfc6a2; font-size: 1.05rem; }
.zone-ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ---------- Paper (light) sections ---------- */
.paper-zone {
  position: relative; isolation: isolate; overflow: hidden;
  background:
    radial-gradient(rgba(107, 101, 72, 0.16) 1px, transparent 1.3px) 0 0 / 22px 22px,
    #f3edd7;
  color: #1b2a25; padding: clamp(52px, 7vw, 84px) clamp(16px, 4vw, 48px);
}
.paper-zone.alt { background: repeating-linear-gradient(180deg, #faf6e8 0 31px, rgba(61, 106, 134, 0.16) 31px 32px), #faf6e8; }
.paper-inner { position: relative; max-width: 1100px; margin: 0 auto; }
.zone-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.paper-zone .zone-title { margin-bottom: 22px; }
.zone-head .zone-title { margin-bottom: 0; }

.hit-counter { display: inline-flex; align-items: center; gap: 10px; }
.hits {
  font: 400 1.9rem/1 var(--font-crt); letter-spacing: 0.18em; padding: 4px 6px 4px 10px;
  background: #0b1d19; color: #e9c46a; border: 2px solid; border-color: #4d4630 #fff #fff #4d4630;
}
.hits-label { font: 500 0.85rem/1.2 var(--font-pixel); color: #44544c; max-width: 12ch; }

.guestbook { max-width: 860px; }
.gb-entries { padding: 6px 22px 18px; max-height: 760px; overflow: auto; }
.gb-entry { padding: 18px 0; border-bottom: 1px dashed rgba(18, 48, 43, 0.25); }
.gb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 4px; }
.gb-num { font: 400 1.05rem/1 var(--font-crt); color: #2f6559; }
.gb-name { font: 700 1.02rem/1.2 var(--font-ui); color: #12302b; }
.gb-stars { color: #b8901c; letter-spacing: 0.08em; font-size: 1rem; }
.gb-date { font-size: 0.82rem; color: #6e7461; }
.gb-entry h3 { font: 700 1.12rem/1.3 var(--font-display); color: #1b2a25; margin: 6px 0 4px; }
.gb-entry p { font-size: 0.95rem; line-height: 1.6; color: #44544c; margin: 6px 0; max-width: 72ch; }
.gb-entry details summary { cursor: pointer; font: 600 0.88rem/1.4 var(--font-ui); color: #2f6559; width: max-content; }
.gb-entry details summary:hover { text-decoration: underline; }
.gb-sign { padding-top: 16px; margin: 0; }
.gb-sign a { display: inline-flex; align-items: center; gap: 8px; font: 600 0.98rem/1.2 var(--font-ui); color: #12302b; }
.gb-sign-ico { height: 14px; }

.profiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.profile-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 18px; align-items: start; }
.profile-pic { width: 150px; height: 150px; object-fit: cover; display: block; border: 2px solid; border-color: #4d4630 #fff #fff #4d4630; }
.profile-pic.missing {
  display: grid; place-items: center; align-content: center; gap: 8px; background: #fffdf6;
  font: 400 1rem/1 var(--font-crt); color: #6e7461;
}
.profile-pic.missing img.px { height: 54px; }
.profile h3 { font: 700 1.35rem/1.2 var(--font-display); color: #12302b; margin-bottom: 6px; }
.profile p { font-size: 0.94rem; line-height: 1.6; color: #44544c; margin: 0; }

.help-topics { display: grid; gap: 14px; }
.topic {
  display: flex; gap: 18px; align-items: flex-start; padding: 18px 20px; background: #fffdf6;
  border: 1px solid rgba(18, 48, 43, 0.25); border-radius: 6px; box-shadow: inset 1px 1px 0 #fff, 3px 3px 0 rgba(18, 48, 43, 0.12);
}
.topic:nth-child(even) { flex-direction: row-reverse; }
.topic p { margin: 0; font-size: 0.98rem; line-height: 1.65; color: #44544c; }
.topic-icon {
  flex-shrink: 0; width: 64px; height: 64px; display: grid; place-items: center;
  background: linear-gradient(135deg, #12302b, #3d6e5f); color: #fdf9ec; border-radius: 4px;
  border: 1px solid; border-color: #7fa697 #0b1d19 #0b1d19 #7fa697; font-size: 2rem;
}

/* ---------- About band + study / guestbook dialogs ---------- */
.page-band { padding: clamp(60px, 9vw, 110px) clamp(16px, 4vw, 48px); }
.band-inner { max-width: 1100px; margin: 0 auto; }
.study-zone { min-height: calc(100vh - var(--header-h) - 44px); display: grid; place-items: center; padding: 40px 16px; }
.study-dialog { width: min(560px, 100%); }
.study-dialog .win-body { padding: 22px 24px 20px; }
.study-dialog-copy { display: flex; gap: 16px; align-items: flex-start; }
.study-dialog-icon { height: 60px; flex-shrink: 0; }
.study-dialog-copy p { margin: 0; color: #44544c; line-height: 1.6; }
.study-dialog-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 12px; }
.study-login { margin: 0; font-size: 0.92rem; color: #44544c; }
.study-login a { color: #2f6559; font-weight: 600; }
.review-title { font: 700 1.6rem/1.2 var(--font-display); color: #12302b; }
.review-count { font: 500 0.85rem/1 var(--font-ui); font-variant-numeric: tabular-nums; color: #6e7461; text-align: right; margin-top: -6px; }
.review-dialog .textarea, .review-dialog .select { color: #1b2a25; background: #fffdf6; }
.review-done { width: min(420px, 100%); }
.gb-stack { display: grid; gap: 20px; justify-items: center; width: 100%; }
.review-note { margin: 0; color: #44544c; font-size: 0.92rem; line-height: 1.55; }
.review-dialog .label { color: #1b2a25; }
.review-dialog .input { color: #1b2a25; background: #fffdf6; }
.review-count.over { color: #a5432f; font-weight: 700; }
.gb-rate { border: 0; padding: 0; margin: 0; }
.gb-star-row { display: inline-flex; gap: 4px; }
.gb-star { position: relative; cursor: pointer; }
.gb-star input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gb-star span[aria-hidden] { display: block; font-size: 2rem; line-height: 1; color: #d6cfb3; transition: color 0.12s, transform 0.12s; }
.gb-star:hover span[aria-hidden] { transform: translateY(-2px); }
.gb-star input:focus-visible + span { outline: 2px solid #2f6559; outline-offset: 2px; border-radius: 4px; }
.gb-star-row:has(input[value="1"]:checked) .gb-star:nth-child(-n+1) span[aria-hidden],
.gb-star-row:has(input[value="2"]:checked) .gb-star:nth-child(-n+2) span[aria-hidden],
.gb-star-row:has(input[value="3"]:checked) .gb-star:nth-child(-n+3) span[aria-hidden],
.gb-star-row:has(input[value="4"]:checked) .gb-star:nth-child(-n+4) span[aria-hidden],
.gb-star-row:has(input[value="5"]:checked) .gb-star:nth-child(-n+5) span[aria-hidden] { color: #c9a227; }
.gb-result { display: flex; flex-direction: column; gap: 10px; color: #1b2a25; }
.gb-preview { margin: 0; padding: 10px 12px; background: #fffdf6; border: 1px dashed #c9bf96; border-radius: 4px; line-height: 1.6; white-space: pre-wrap; }
.gb-preview mark { background: rgba(165, 67, 47, 0.18); color: #7d2a22; text-decoration: underline wavy #a5432f; text-underline-offset: 3px; padding: 0 2px; border-radius: 2px; }
.gb-flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.gb-flags li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.gb-flags q { font-weight: 600; color: #7d2a22; }
.gb-done { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; color: #1b2a25; }
.gb-done img.px { height: 48px; }
.gb-admin { width: min(560px, 100%); }
.gb-queue-item { padding: 10px 0; border-bottom: 1px dotted #c9bf96; color: #1b2a25; }
.gb-queue-item p { margin: 6px 0 8px; }
.gb-empty { padding: 18px; color: #44544c; }
.paper-zone .win { box-shadow: inset 1px 1px 0 #fff, 4px 4px 0 rgba(18, 48, 43, 0.16); }

/* ---------- Reveal (anime.js sets the final state; this is the no-JS fallback) ---------- */
.js-anim [data-reveal], .js-anim .desk-icon { opacity: 0; }
.js-anim .hero-title:not(.split), .js-anim .boot-text:not(.typing) { opacity: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .how-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body:not(.app) { padding-top: 0; } /* the header becomes sticky (theme.css) */
}
@media (max-width: 760px) {
  .desk-hero { grid-template-columns: 1fr; min-height: 0; }
  .desk-icons { order: 3; flex-direction: row; justify-content: center; gap: 10px; padding-top: 0; }
  .desk-icon { width: 92px; }
  .hero-scrim { background: linear-gradient(180deg, rgba(7, 21, 18, 0.84), rgba(7, 21, 18, 0.9)); }
  .profiles { grid-template-columns: 1fr; }
  .profile-body { grid-template-columns: 96px minmax(0, 1fr); }
  .profile-pic { width: 96px; height: 96px; }
  .topic, .topic:nth-child(even) { flex-direction: column; }
}
@media (max-width: 560px) {
  .how-grid { grid-template-columns: 1fr; }
  .gb-entries { max-height: none; overflow: visible; padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
}
