@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/fraunces-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/fraunces-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/fraunces-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/fraunces-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --paper: #f6f3ec;
  --card: #fdfbf6;
  --ink: #221e18;
  --muted: #877e6f;
  --line: #e4ddcd;
  --accent: #2c3e63;
  --accent-dark: #24334f;
  --night: #1b2440;
  --night-2: #2a3760;
  --cream: #f2eee1;
  --cream-dim: #c5c2b4;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); }

/* ---------- nav ---------- */

nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 22px 0;
}

.wordmark {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 23px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-links { display: flex; gap: 22px; align-items: baseline; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 15px; }
.nav-links a:hover { text-decoration: underline; }
.nav-links a.btn, .nav-links a.btn-light { text-decoration: none; }
.nav-links a.btn-light:hover { text-decoration: none; }

/* ---------- buttons & inputs ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--cream);
  border: none;
  border-radius: 7px;
  padding: 11px 24px;
  font-family: var(--serif);
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(27, 36, 64, 0.18);
  transition: background 0.15s ease;
}
.btn:hover {
  background: var(--accent-dark);
  color: var(--cream);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(27, 36, 64, 0.28);
}
.btn { transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; }
.btn-big { padding: 13px 30px; font-size: 17px; }
.btn:disabled { background: #a49b8b; cursor: default; box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* reading state: breathing color + trailing dots */
.btn.loading { animation: btn-breathe 1.8s ease-in-out infinite; }
.btn.loading::after {
  content: '';
  display: inline-block;
  width: 1.1em;
  text-align: left;
  animation: dots 1.4s infinite;
}
@keyframes btn-breathe {
  0%, 100% { background: var(--accent); }
  50% { background: #45598b; }
}
@keyframes dots {
  0%, 24% { content: ''; }
  25%, 49% { content: '.'; }
  50%, 74% { content: '..'; }
  75%, 100% { content: '...'; }
}

.nav-links a.btn { color: var(--cream); }

.btn-light {
  display: inline-block;
  background: var(--cream);
  color: var(--night);
  border: none;
  border-radius: 7px;
  padding: 8px 18px;
  font-family: var(--serif);
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}
.btn-light:hover { background: #fffdf4; color: var(--night); }

.btn-quiet {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}
.btn-quiet:hover { background: #efeadf; color: var(--ink); }

textarea, input[type="email"], input[type="password"] {
  width: 100%;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 14px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea:focus, input:focus { outline: none; border-color: #9aa7c4; box-shadow: 0 0 0 3px rgba(44, 62, 99, 0.08); }

label { display: block; font-size: 14px; color: var(--muted); margin: 16px 0 6px; }

.error { color: #8c3b2e; font-size: 15px; margin-top: 10px; min-height: 1.2em; }
.note { color: var(--muted); font-size: 14px; }

/* ---------- cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
}

hr { border: none; border-top: 1px solid var(--line); margin: 56px 0; }

/* ---------- night header (landing) ---------- */

.night {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #161e37 0%, var(--night) 45%, var(--night-2) 100%);
  color: var(--cream);
  padding-bottom: 96px;
}

/* two star layers twinkling out of phase */
.night::before,
.night::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.night::before {
  background:
    radial-gradient(1.5px 1.5px at 18% 28%, rgba(242, 238, 225, 0.9), transparent 100%),
    radial-gradient(1px 1px at 32% 62%, rgba(242, 238, 225, 0.7), transparent 100%),
    radial-gradient(1.5px 1.5px at 74% 25%, rgba(242, 238, 225, 0.85), transparent 100%),
    radial-gradient(1px 1px at 10% 70%, rgba(242, 238, 225, 0.6), transparent 100%),
    radial-gradient(1px 1px at 55% 74%, rgba(242, 238, 225, 0.55), transparent 100%);
  animation: twinkle 4.2s ease-in-out infinite;
}
.night::after {
  background:
    radial-gradient(1.5px 1.5px at 47% 20%, rgba(242, 238, 225, 0.85), transparent 100%),
    radial-gradient(1px 1px at 61% 48%, rgba(242, 238, 225, 0.65), transparent 100%),
    radial-gradient(1px 1px at 85% 58%, rgba(242, 238, 225, 0.7), transparent 100%),
    radial-gradient(1.5px 1.5px at 92% 14%, rgba(242, 238, 225, 0.8), transparent 100%),
    radial-gradient(1px 1px at 26% 12%, rgba(242, 238, 225, 0.6), transparent 100%),
    radial-gradient(1px 1px at 70% 78%, rgba(242, 238, 225, 0.5), transparent 100%);
  animation: twinkle 5.6s ease-in-out 2.1s infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* the occasional shooting star */
.shooting {
  position: absolute;
  top: 16%;
  left: -8%;
  width: 110px;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(242, 238, 225, 0.95));
  transform: rotate(11deg);
  opacity: 0;
  pointer-events: none;
  animation: shoot 11s linear 2.5s infinite;
}
.shooting-2 {
  top: 8%;
  left: 30%;
  width: 80px;
  transform: rotate(17deg);
  animation: shoot 13s linear 8s infinite;
}
@keyframes shoot {
  0% { opacity: 0; translate: 0 0; }
  1% { opacity: 0.9; }
  5% { opacity: 0; translate: 46vw 9vw; }
  100% { opacity: 0; translate: 46vw 9vw; }
}

/* film grain over the night sky */
.night .wrap::before {
  content: '';
  position: absolute;
  inset: -100px -100vw;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
}

.night .wrap { position: relative; z-index: 1; }

/* staggered load-in */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.hero .lamp { animation: rise 0.7s ease 0.05s both; }
.hero h1 { animation: rise 0.7s ease 0.15s both; }
.hero p { animation: rise 0.7s ease 0.3s both; }
.demo { animation: rise 0.7s ease 0.45s both; }

.night .wordmark { color: var(--cream); }
.night .nav-links a { color: var(--cream); }
.night .nav-links a.btn-light { color: var(--night); }

.hero { text-align: center; padding: 52px 0 20px; }

.lamp {
  display: block;
  width: 46px;
  height: auto;
  margin: 0 auto 20px;
  color: var(--cream);
  opacity: 0.94;
  filter: drop-shadow(0 0 18px rgba(250, 228, 175, 0.5));
}

.hero h1 {
  font-family: var(--display);
  font-size: 52px;
  font-weight: 480;
  font-style: italic;
  margin: 0 0 16px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--cream);
  text-shadow: 0 0 40px rgba(242, 238, 225, 0.18);
}
.hero p { font-size: 19px; color: var(--cream-dim); max-width: 540px; margin: 0 auto; }

/* ---------- demo ---------- */

.demo {
  margin-top: -64px;
  box-shadow: 0 14px 40px rgba(22, 30, 55, 0.16);
  border-color: #ded6c3;
}

.demo-actions { margin-top: 14px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.result { margin-top: 20px; display: none; }
.result.show { display: block; }

.reading {
  font-size: 19px;
  line-height: 1.6;
  font-style: italic;
  border-left: 3px solid var(--accent);
  margin: 0;
  padding: 4px 0 4px 18px;
}

.painting {
  position: relative;
  margin-top: 28px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #cfc5ad;
  background: #ece7da;
  aspect-ratio: 1;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  /* gallery frame: matte, thin rail, drop shadow */
  box-shadow:
    0 0 0 8px var(--card),
    0 0 0 9px #d6cdb8,
    0 14px 34px rgba(22, 30, 55, 0.16);
}

.painting-caption {
  text-align: center;
  font-style: italic;
  font-size: 13.5px;
  color: var(--muted);
  margin: 18px 0 0;
  animation: rise 0.7s ease both;
}
.painting img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: unveil 0.9s ease both;
}
@keyframes unveil {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: none; }
}

/* while the painting is underway: wet paint slowly drifting on the canvas */
.painting.loading::before {
  content: '';
  position: absolute;
  inset: -25%;
  background: linear-gradient(115deg, #cdc5ae, #a9b6c9, #c9bda4, #b3c0ae, #b7a9c2, #cdc5ae);
  background-size: 320% 320%;
  filter: blur(26px);
  opacity: 0.55;
  animation: paint-drift 7s ease-in-out infinite;
}
@keyframes paint-drift {
  0%, 100% { background-position: 0% 35%; }
  50% { background-position: 100% 65%; }
}
.painting .placeholder {
  position: relative;
  color: #6a6354;
  font-style: italic;
  font-size: 15px;
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* post-painting call to action */
.keep {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.keep.show .keep-line { animation: rise 0.7s ease 0.1s both; }
.keep.show .keep-sub { animation: rise 0.7s ease 0.3s both; }
.keep.show .btn { animation: rise 0.7s ease 0.5s both; }
.keep.show .note { animation: rise 0.7s ease 0.65s both; }
.keep-line {
  font-family: var(--display);
  font-style: italic;
  font-size: 24px;
  font-weight: 480;
  line-height: 1.3;
  margin: 0 0 10px;
}
.keep-sub {
  color: #55503f;
  max-width: 460px;
  margin: 0 auto 22px;
}

@media (prefers-reduced-motion: reduce) {
  .night::before, .night::after, .btn.loading, .btn.loading::after,
  .painting.loading::before, .painting .placeholder, .painting img,
  .shooting, .shooting-2, .hero .lamp, .hero h1, .hero p, .demo,
  .painting-caption, .keep.show .keep-line, .keep.show .keep-sub,
  .keep.show .btn, .keep.show .note {
    animation: none;
  }
}

/* ---------- landing sections ---------- */

.section-title {
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
  margin: 0 0 28px;
}

.how ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.how li { counter-increment: step; padding: 20px 0; border-top: 1px solid var(--line); display: flex; gap: 20px; }
.how li:last-child { border-bottom: 1px solid var(--line); }
.how li::before {
  content: counter(step) ".";
  color: var(--accent);
  font-style: italic;
  font-size: 20px;
  min-width: 26px;
  line-height: 1.3;
}
.how strong { font-weight: 600; }

.pricing { text-align: center; }
.pricing-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid #ded6c3;
  border-top: 3px solid var(--accent);
  border-radius: 10px;
  padding: 30px 30px;
  box-shadow: 0 10px 34px rgba(22, 30, 55, 0.1);
}
.pricing-lamp {
  display: block;
  width: 32px;
  height: auto;
  margin: 0 auto 12px;
  color: var(--accent);
  opacity: 0.85;
}
.price { font-family: var(--display); font-size: 44px; font-weight: 480; font-style: italic; margin: 0 0 2px; color: var(--ink); }
.trust { text-align: center; font-size: 14px; color: var(--muted); margin-top: 22px; }
.price small { font-size: 17px; color: var(--muted); font-style: normal; }
.pricing ul { list-style: none; padding: 0; margin: 20px 0 26px; color: #55503f; }
.pricing li { padding: 9px 0; border-top: 1px solid #efe9db; }
.pricing li:first-child { border-top: none; }

footer { padding: 40px 0 60px; }
footer .disclaimer { font-size: 14px; color: var(--muted); max-width: 560px; }

/* ---------- auth pages ---------- */

.auth { max-width: 400px; margin: 60px auto; }
.auth h1 { font-family: var(--display); font-size: 28px; font-style: italic; font-weight: 500; margin: 0 0 4px; }
.auth .btn { width: 100%; margin-top: 22px; }
.auth .swap { margin-top: 18px; font-size: 15px; color: var(--muted); }

/* ---------- journal ---------- */

.journal-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.account { font-size: 14px; color: var(--muted); display: flex; gap: 16px; align-items: baseline; }
.account a { color: var(--muted); }

.banner { border-left: 3px solid var(--accent); }

.entry { margin-top: 20px; }
.entry .date { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.entry .dream-text { white-space: pre-wrap; margin: 0 0 14px; }
.entry .reading { font-size: 17px; }
.entry .painting { max-width: 100%; margin-top: 16px; }

.entry-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); text-align: right; }
.forget {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.entry:hover .forget, .forget:focus-visible { opacity: 1; }
.forget:hover { color: #8c3b2e; }
.entry { transition: opacity 0.2s ease; }
.entry.forgetting { opacity: 0.4; pointer-events: none; }
@media (hover: none) { .forget { opacity: 1; } }
@media (min-width: 620px) {
  .entry-body { display: flex; gap: 22px; }
  .entry-main { flex: 1; }
  .entry .painting { width: 200px; min-width: 200px; margin-top: 0; align-self: flex-start; }
}

.weekly { border-left: 3px solid #6b5d8c; }
.weekly .range { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.weekly p { margin: 0; font-size: 18px; line-height: 1.6; }

.empty { text-align: center; color: var(--muted); font-style: italic; padding: 40px 0; }

/* ---------- faq ---------- */

.faq-item { padding: 18px 0; border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.faq-item p { margin: 0; color: #3d382d; }

/* ---------- legal pages ---------- */

.legal { max-width: 620px; margin: 28px auto 60px; }
.legal h1 { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 34px; margin: 0 0 4px; }
.legal .updated { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.legal h2 { font-size: 19px; margin: 34px 0 10px; }
.legal p, .legal li { color: #3d382d; font-size: 16px; line-height: 1.65; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 8px; }

.danger-link { color: #8c3b2e; }

.btn-danger { background: #8c3b2e; color: var(--cream); width: 100%; margin-top: 18px; }
.btn-danger:hover { background: #762f24; color: var(--cream); }
.btn-danger:disabled { background: #c3a59f; }
.auth input[type="text"] { margin-top: 6px; }

/* ---------- lightbox ---------- */

.painting img { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 22, 38, 0.86);
  backdrop-filter: blur(3px);
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lightbox.show { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: min(92vw, 900px);
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 0 0 8px var(--card), 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.97);
  transition: transform 0.2s ease;
}
.lightbox.show img { transform: scale(1); }

/* ---------- small screens ---------- */

@media (max-width: 520px) {
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 17px; }
}
