/* wake — wakejournal.app
   Calm, centered serif layout; cream paper with a faint grid; collage art from the app. */

:root {
  --paper: #fafaf8;
  --paper-2: #f2f1ec;
  --card: #ecebe7;
  --ink: #221f2a;
  --ink-soft: #5a596b;
  --navy: #1e2036;
  --rust: #a85c3e;
  --line: rgba(34, 31, 42, 0.14);
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --mono: 'Space Mono', ui-monospace, 'Courier New', monospace;
  --hand: 'Caveat', 'Bradley Hand', cursive;
  --radius: 28px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body::before {
  /* soften the grid so it reads as paper, not graph paper */
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(250, 250, 248, 0.72);
  pointer-events: none;
  z-index: -1;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 32px); margin-inline: auto; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 250, 248, 0.86);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px dashed var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.nav .logo img { height: 52px; width: auto; }
.nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 13px; }
.nav ul a { text-decoration: none; color: var(--ink-soft); }
.nav ul a:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  padding: 13px 22px;
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px dashed var(--ink); }
.btn.small { padding: 9px 16px; font-size: 12px; }
.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  border: 1px dashed var(--ink-soft);
  border-radius: 999px;
  padding: 5px 14px;
  background: var(--paper);
}

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(44px, 7.4vw, 88px); line-height: 1.02; }
h2 { font-size: clamp(34px, 5vw, 58px); line-height: 1.08; }
h3 { font-size: 26px; line-height: 1.2; }
.lede { font-size: clamp(15.5px, 1.6vw, 17.5px); line-height: 1.75; color: var(--ink-soft); max-width: 34em; margin: 22px auto 0; }
.eyebrow { display: block; margin-bottom: 20px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.hand { font-family: var(--hand); color: var(--rust); font-size: 30px; line-height: 1; }
.center { text-align: center; }

section { padding: 112px 0; }

/* ---------- dreamy panels (hero + closing) ---------- */
/* Blurred film-photo glow: drifting teal / peach / coral light under grain. */
.dream {
  position: relative;
  overflow: hidden;
  background: #0b1620;
  color: #f4ece0;
  isolation: isolate;
}
.dream .glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.85; z-index: -2; animation: drift 22s ease-in-out infinite alternate; }
.dream .g1 { width: 56vw; height: 56vw; max-width: 760px; max-height: 760px; background: #1f8a99; left: -14%; top: -20%; }
.dream .g2 { width: 44vw; height: 44vw; max-width: 600px; max-height: 600px; background: #f2a27c; right: -10%; top: 10%; animation-duration: 26s; opacity: 0.7; }
.dream .g3 { width: 38vw; height: 38vw; max-width: 520px; max-height: 520px; background: #d9584a; left: 30%; bottom: -30%; animation-duration: 30s; opacity: 0.55; }
.dream .g4 { width: 30vw; height: 30vw; max-width: 420px; max-height: 420px; background: #7a6fd0; right: 22%; bottom: -10%; animation-duration: 19s; opacity: 0.45; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6%, 8%) scale(1.12); } }
.dream::after {
  /* film grain */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (prefers-reduced-motion: reduce) { .dream .glow { animation: none; } }

/* torn-paper word stickers, like the moodboard's "you are made of stars" */
.stickers { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sticker {
  font-family: var(--hand);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1;
  color: var(--ink);
  background: #f4ece0;
  padding: 8px 14px 10px;
  border-radius: 46% 54% 42% 58% / 58% 44% 56% 42%;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.6);
}
.sticker:nth-child(odd) { transform: rotate(-4deg); }
.sticker:nth-child(even) { transform: rotate(3deg) translateY(6px); }

/* ---------- hero ---------- */
.hero { padding: 0; }
.hero .dream { margin: 16px auto 0; width: min(1240px, 100% - 32px); border-radius: var(--radius); padding: 96px 24px 0; text-align: center; min-height: 760px; }
.hero .pill { margin-bottom: 26px; background: rgba(244, 236, 224, 0.08); color: rgba(244, 236, 224, 0.85); border-color: rgba(244, 236, 224, 0.4); }
.hero h1 { max-width: 12em; margin-inline: auto; }
.hero h1 .accent { color: #f7c8a8; }
.hero .lede { color: rgba(244, 236, 224, 0.78); }
.hero .actions { margin-top: 34px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .btn { background: #f4ece0; color: var(--navy); border-color: #f4ece0; }
.hero .btn.ghost { background: transparent; color: #f4ece0; border-color: rgba(244, 236, 224, 0.6); }
.hero .collage { position: relative; height: 340px; margin-top: 40px; }
.hero .collage .cat { position: absolute; left: 50%; bottom: -10px; width: min(360px, 70%); transform: translateX(-50%); filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.5)); }
.hero .collage .eye { position: absolute; left: 6%; bottom: 120px; width: min(250px, 30%); transform: rotate(-8deg); filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45)); }
.hero .collage .note { position: absolute; right: 7%; bottom: 150px; transform: rotate(5deg); }
.hero .collage .note2 { position: absolute; left: 22%; bottom: 40px; transform: rotate(-3deg); }

/* ---------- why ---------- */
.why p { font-family: var(--serif); font-size: clamp(24px, 3.1vw, 36px); line-height: 1.32; text-align: center; margin: 0; }
.why p em { color: var(--ink-soft); }
.why .hand { display: block; text-align: center; margin-top: 20px; }

/* ---------- pillars ---------- */
.pillars .head { text-align: center; margin-bottom: 56px; }
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 34px 30px 36px;
  position: relative;
}
.pillar .art { height: 190px; display: grid; place-items: center; margin-bottom: 18px; }
.pillar .art img { max-height: 190px; width: auto; }
.pillar .num { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.pillar h3 { margin: 8px 0 10px; }
.pillar p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---------- map (night) ---------- */
.map .panel {
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b0c1a url(img/night.webp) center / cover no-repeat;
  color: #f3ecdd;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  min-height: 520px;
  position: relative;
}
.map .copy { padding: 64px 56px; position: relative; z-index: 1; }
.map .copy p { color: rgba(243, 236, 221, 0.78); font-size: 16px; margin: 20px 0 0; }
.map .eyebrow { color: rgba(243, 236, 221, 0.6); }
.map .sky { position: relative; height: 100%; min-height: 420px; }
.map .sky img { position: absolute; inset: 12% 10%; width: 80%; height: auto; filter: invert(1) drop-shadow(0 0 10px rgba(255, 240, 200, 0.6)); opacity: 0.92; }
.stars { position: absolute; inset: 0; pointer-events: none; }
.stars i {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #fff8e1;
  box-shadow: 0 0 8px 2px rgba(255, 244, 214, 0.55);
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stars i { animation: none; opacity: 0.7; } }

/* ---------- private ---------- */
.private .row { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.private .art { background: var(--card); border-radius: var(--radius); padding: 40px; display: grid; place-items: center; }
.private .art img { max-height: 240px; width: auto; }
.private p { color: var(--ink-soft); font-size: 16px; margin: 18px 0 0; }

/* ---------- features ---------- */
.features .head { text-align: center; margin-bottom: 52px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px dashed var(--line);
  border-left: 1px dashed var(--line);
}
.feature { padding: 26px 26px 28px; border-right: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.feature h3 { font-size: 22px; }
.feature p { margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; }
.feature .plus { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--rust); margin-left: 6px; vertical-align: 3px; }

/* ---------- faq ---------- */
.faq details { border-bottom: 1px dashed var(--line); padding: 20px 4px; }
.faq details:first-of-type { border-top: 1px dashed var(--line); }
.faq summary { cursor: pointer; list-style: none; font-family: var(--serif); font-size: 22px; display: flex; justify-content: space-between; gap: 20px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); color: var(--ink-soft); }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 12px 0 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- about ---------- */
.about .card { padding: 56px; display: grid; grid-template-columns: 1fr 220px; gap: 40px; align-items: center; }
.about p { font-size: 21px; margin: 0 0 16px; }
.about p:last-child { margin-bottom: 0; }
.about img { width: 220px; }

/* ---------- closing ---------- */
.closing { padding: 112px 0 0; }
.closing .dream { width: min(1240px, 100% - 32px); margin: 0 auto; border-radius: var(--radius) var(--radius) 0 0; padding: 104px 24px 120px; text-align: center; }
.closing h2 { max-width: 14em; margin-inline: auto; }
.closing .closing-line { color: rgba(244, 236, 224, 0.85); margin-top: 22px; }
.closing .actions { margin-top: 40px; }
.closing .btn { background: #f4ece0; color: var(--navy); border-color: #f4ece0; }
.closing .icon { width: 96px; margin: 0 auto 28px; border-radius: 22px; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6); }

/* ---------- footer ---------- */
footer { background: var(--navy); color: rgba(255, 255, 255, 0.78); padding: 56px 0 44px; font-family: var(--mono); font-size: 13px; position: relative; z-index: 1; }
footer .wrap { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
footer img { height: 56px; width: auto; margin-bottom: 16px; }
footer a { color: #fff; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
footer .tag { max-width: 20em; line-height: 1.6; }

/* ---------- legal / prose pages ---------- */
.doc { padding: 72px 0 112px; }
.doc h1 { font-size: clamp(40px, 6vw, 64px); }
.doc .updated { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); margin: 14px 0 40px; }
.doc .sheet { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); padding: clamp(24px, 5vw, 56px); }
.doc h2 { font-size: 26px; margin: 36px 0 8px; letter-spacing: -0.01em; }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { font-size: 15px; color: #3a3846; }
.doc ul { padding-left: 22px; }
.doc a { color: var(--navy); }

/* ---------- confirmed ---------- */
.done { min-height: 78vh; display: grid; place-items: center; text-align: center; padding: 48px 0; }
.done img { width: min(280px, 70%); margin: 0 auto 18px; }
.done p { color: var(--ink-soft); font-size: 16px; max-width: 24em; margin: 16px auto 0; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  section { padding: 80px 0; }
  .pillar-grid, .feature-grid { grid-template-columns: 1fr 1fr; }
  .map .panel { grid-template-columns: 1fr; }
  .map .copy { padding: 44px 28px 0; }
  .map .sky { min-height: 300px; }
  .private .row, .about .card { grid-template-columns: 1fr; }
  .about .card { padding: 36px 28px; }
  .about img { width: 160px; margin: 0 auto; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .nav ul { display: none; }
  .hero .dream { padding-top: 64px; min-height: 0; }
  .dream .g1 { width: 130vw; height: 130vw; left: -50%; top: -20%; }
  .dream .g2 { width: 110vw; height: 110vw; right: -50%; top: 25%; }
  .dream .g3 { width: 100vw; height: 100vw; left: -10%; bottom: -25%; }
  .dream .g4 { width: 80vw; height: 80vw; right: -10%; bottom: 5%; }
  .hero .collage { height: 300px; }
  .hero .collage .eye { width: 34%; left: 2%; bottom: 170px; }
  .hero .collage .note { right: 2%; bottom: 210px; }
  .hero .collage .note2 { display: none; }
  .pillar-grid, .feature-grid { grid-template-columns: 1fr; }
}

/* ---------- hero scene (generated night-sky collage; sky on top, ground at the bottom) ---------- */
/* The picture sits full-width at the bottom and fades into a plain sky of its own color above it,
   so the headline always has clear sky. --room = how much sky sits above the picture. */
.hero .dream.scene {
  background-color: var(--sky, #152135);
  min-height: calc((min(1240px, 100vw - 32px)) * 0.5625 + var(--room, 260px));
  padding-bottom: 0;
}
.hero .dream.scene .scene-img {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  z-index: -2;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  pointer-events: none;
}
.hero .dream.scene .glow { display: none; }
.hero .dream.scene::after { opacity: 0.38; mix-blend-mode: overlay; } /* film grain over sky + picture */
@media (max-width: 640px) {
  .hero .dream.scene { min-height: 0; padding-bottom: 320px; }
  .hero .dream.scene .scene-img { width: auto; height: 380px; max-width: none; left: 50%; transform: translateX(-58%); }
}

/* ---------- full-bleed hero variant (preview: ?bleed) ---------- */
/* text block centered in the first screen (below the floating nav), never closer than 150px */
body.bleed .hero .dream { width: 100%; margin: 0; border-radius: 0; padding-top: max(150px, calc(50vh - 180px)); }
body.bleed .hero .dream.scene { min-height: calc(100vw * 0.5625 + var(--room, 260px) * 0.8); }
body.bleed .nav { position: fixed; left: 0; right: 0; background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; transition: background 0.3s ease; }
body.bleed .nav ul a { color: rgba(244, 236, 224, 0.82); }
body.bleed .nav .btn { background: #f4ece0; color: var(--navy); border-color: #f4ece0; }
body.bleed .nav .logo img { filter: invert(1) brightness(1.9); }
body.bleed.scrolled .nav { background: rgba(250, 250, 248, 0.9); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom-color: var(--line); }
body.bleed.scrolled .nav ul a { color: var(--ink-soft); }
body.bleed.scrolled .nav .btn { background: var(--navy); color: #fff; border-color: var(--navy); }
body.bleed.scrolled .nav .logo img { filter: none; }
body.bleed .closing .dream { width: 100%; border-radius: 0; }
@media (max-width: 640px) { body.bleed .hero .dream { padding-top: 120px; } body.bleed .hero .dream.scene { min-height: 0; } }

/* bleed: per-picture framing. --zoom scales the picture, --shift nudges it sideways,
   --crop hides that fraction of the picture's bottom (extra ground), --room = sky above it. */
body.bleed .hero .dream.scene {
  /* the picture moves down by however much the text moved down, so it stays clear */
  min-height: calc(100vw * 0.5625 * var(--zoom, 1) * (1 - var(--crop, 0)) + var(--room, 260px) + max(0px, calc(50vh - 330px)) + max(0px, calc((1200px - 100vw) * 0.4)));
  /* ^ narrower windows shrink the picture but not the text, so give them extra sky */
}
body.bleed .hero .dream.scene .scene-img {
  max-width: none;
  width: calc(100% * var(--zoom, 1));
  left: var(--shift, 0%);
  bottom: calc(-100vw * 0.5625 * var(--zoom, 1) * var(--crop, 0));
}
@media (max-width: 640px) {
  body.bleed .hero .dream.scene { min-height: 0; }
  body.bleed .hero .dream.scene .scene-img { width: auto; left: 50%; bottom: 0; }
}
