/* ============================================================
   To Aahana — standalone stylesheet
   Self-contained: includes the base design tokens this page
   needs (colors, type, grid background) plus every component
   style for the lock screen, welcome overlay, and main board.
   ============================================================ */

:root {
  --max-width: 900px;
  --border-radius: 10px;
  /* surfaces */
  --bg: #0a0e14;
  --bg-panel: #10151d;
  --bg-panel-raised: #161d28;
  /* ink */
  --ink: #edeff3;
  --ink-muted: #8b93a3;
  --ink-faint: #545d6e;
  /* brass accent (inherited mood from the parent site) */
  --brass: #d4a24e;
  --brass-dim: #9c7a3c;
  --brass-wash: rgba(212, 162, 78, 0.12);
  /* lines */
  --rule: rgba(237, 239, 243, 0.1);
  --rule-strong: rgba(237, 239, 243, 0.18);
  --grid-line: rgba(94, 200, 224, 0.055);
  /* type */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;
  /* bespoke accent for this page only */
  --rose: #e8879f;
  --rose-soft: #f6c9d4;
  --rose-dim: #a85f74;
  --rose-wash: rgba(232, 135, 159, 0.14);
  --warn: #cf7a63;
  --ink-on-rose: #2a0f18;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --bg-panel: #ffffff;
    --bg-panel-raised: #eef0f4;
    --ink: #12151b;
    --ink-muted: #565e6d;
    --ink-faint: #88909c;
    --brass: #a1741f;
    --brass-dim: #c2954a;
    --brass-wash: rgba(161, 116, 31, 0.1);
    --rule: rgba(18, 21, 27, 0.08);
    --rule-strong: rgba(18, 21, 27, 0.16);
    --grid-line: rgba(26, 137, 163, 0.06);
    --rose: #c85f78;
    --rose-soft: #e8a3b5;
    --rose-dim: #9c4a60;
    --rose-wash: rgba(200, 95, 120, 0.1);
    --warn: #b25d45;
    --ink-on-rose: #ffffff;
  }
}

/* ---------------- reset & base ---------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body {
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center top;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
p { line-height: 1.75; color: var(--ink-muted); }
button { font: inherit; }
::selection { background: var(--rose-dim); color: #ffffff; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
[hidden] { display: none !important; }

/* base look for every inline icon in this page */
.wrapper svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wrapper {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(620px circle at 12% 8%, var(--rose-wash), transparent 60%),
    radial-gradient(520px circle at 88% 92%, var(--brass-wash), transparent 55%);
}

/* ---------------- shared corner ticks (drawing-sheet motif) ---------------- */
.corner { position: absolute; width: 14px; height: 14px; opacity: 0.55; border-color: var(--brass-dim); }
.corner-tl { top: 12px; left: 12px; border-top: 1px solid; border-left: 1px solid; }
.corner-tr { top: 12px; right: 12px; border-top: 1px solid; border-right: 1px solid; }
.corner-bl { bottom: 12px; left: 12px; border-bottom: 1px solid; border-left: 1px solid; }
.corner-br { bottom: 12px; right: 12px; border-bottom: 1px solid; border-right: 1px solid; }

/* =========================================================
   LOCK SCREEN
   ========================================================= */
.lock-screen { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 18px; }

.lock-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--bg-panel);
  border: 1px solid var(--rule-strong);
  border-radius: var(--border-radius);
  padding: clamp(34px, 6vw, 50px) clamp(24px, 5vw, 40px);
  text-align: center;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
}

.lock-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 20px;
}
.lock-label .tick { color: var(--rose-dim); }

.lock-title { font-family: var(--font-display); font-size: clamp(1.9rem, 6vw, 2.6rem); margin-bottom: 12px; }
.rose-text { color: var(--rose); }
.lock-sub { color: var(--ink-muted); font-size: 14.5px; max-width: 36ch; margin: 0 auto 30px; }

.hearts-row { display: flex; justify-content: center; gap: 12px; margin-bottom: 10px; }
.heart { width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-faint); transition: color 0.25s ease, transform 0.25s ease; }
.heart svg { fill: none; }
.heart-filled { color: var(--rose); }
.heart-filled svg { fill: currentColor; }
.heart-pulse { animation: heartPop 0.6s ease; }
@keyframes heartPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.4); filter: drop-shadow(0 0 10px var(--rose-wash)); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.clearance-readout { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 24px; }

.guess-form { display: flex; gap: 10px; margin-bottom: 8px; }
.guess-input {
  flex: 1; min-width: 0; background: var(--bg-panel-raised); border: 1px solid var(--rule-strong);
  border-radius: 8px; padding: 13px 15px; color: var(--ink); font-family: var(--font-body); font-size: 15px;
  outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.guess-input::placeholder { color: var(--ink-faint); }
.guess-input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-wash); }
.guess-input:disabled { opacity: 0.5; }
.shake { animation: shakeX 0.4s ease; border-color: var(--warn) !important; }
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

.guess-submit {
  width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--rose); color: var(--ink-on-rose); border: none; border-radius: 8px; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.guess-submit:hover { transform: translateY(-2px); background: var(--rose-soft); }
.guess-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.feedback-line { min-height: 20px; font-family: var(--font-mono); font-size: 12.5px; margin-bottom: 18px; }
.feedback-ok { color: var(--rose); }
.feedback-err { color: var(--warn); }
.feedback-dup { color: var(--ink-faint); }

.found-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; }
.chip { font-family: var(--font-mono); font-size: 11px; padding: 5px 11px; border-radius: 999px; background: var(--brass-wash); color: var(--brass); border: 1px solid var(--rule); }

.hint-toggle {
  background: none; border: none; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint);
  text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; padding: 6px;
}
.hint-toggle:hover { color: var(--ink-muted); }
.hint-list {
  text-align: left; list-style: none; margin-top: 14px; padding: 14px 18px; background: var(--bg-panel-raised);
  border: 1px solid var(--rule); border-radius: 8px; font-size: 13px; color: var(--ink-muted); line-height: 1.85;
}
.hint-done { color: var(--ink-faint); text-decoration: line-through; }

/* heart burst */
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.burst-heart { position: absolute; bottom: -30px; color: var(--rose); animation-name: floatUp; animation-timing-function: ease-out; animation-fill-mode: forwards; }
.burst-heart svg { fill: currentColor; }
@keyframes floatUp {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(-108vh) translateX(var(--drift, 20px)) rotate(24deg); opacity: 0; }
}

/* =========================================================
   WELCOME OVERLAY
   ========================================================= */
.welcome-screen { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 18px; }
.welcome-card {
  position: relative; width: 100%; max-width: 520px; background: var(--bg-panel); border: 1px solid var(--rule-strong);
  border-radius: calc(var(--border-radius) + 4px); padding: clamp(38px, 7vw, 58px) clamp(28px, 6vw, 48px);
  text-align: center; box-shadow: 0 40px 110px -40px rgba(0, 0, 0, 0.7); animation: cardIn 0.7s ease;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.welcome-eyebrow { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rose); margin-bottom: 20px; }
.welcome-line1 { font-family: var(--font-display); font-size: clamp(1.7rem, 5vw, 2.35rem); margin-bottom: 16px; }
.welcome-line2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.05rem, 2.6vw, 1.25rem); color: var(--ink); line-height: 1.55; max-width: 40ch; margin: 0 auto 20px; }
.welcome-body { color: var(--ink-muted); font-size: 14.5px; line-height: 1.85; max-width: 42ch; margin: 0 auto 34px; }
.welcome-button {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em; padding: 14px 30px; border-radius: 999px;
  border: none; background: var(--rose); color: var(--ink-on-rose); font-weight: 600; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.welcome-button:hover { transform: translateY(-2px); background: var(--rose-soft); }

/* =========================================================
   MAIN BOARD
   ========================================================= */
.board { position: relative; z-index: 1; max-width: var(--max-width); margin: 0 auto; padding: clamp(50px, 8vw, 90px) clamp(20px, 5vw, 48px) 110px; }

.board-hero { margin-bottom: 64px; padding-bottom: 36px; border-bottom: 1px solid var(--rule); }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rose); margin-bottom: 16px; }
.hero-eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--rose-dim); }
.hero-title { font-family: var(--font-display); font-size: clamp(2.1rem, 6vw, 3.2rem); margin-bottom: 14px; }
.hero-sub { color: var(--ink-muted); max-width: 58ch; font-size: 15.5px; }

.section { margin-bottom: 72px; }
.section-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rose); margin-bottom: 18px; }
.section-eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--rose-dim); }
.section-intro { color: var(--ink-muted); font-size: 14.5px; max-width: 60ch; margin-bottom: 26px; }

/* ---- memories grid ---- */
.memory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.memory-card {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--border-radius); overflow: hidden; border: 1px solid var(--rule);
  background: var(--bg-panel); cursor: pointer; padding: 0; transition: transform 0.2s ease, border-color 0.2s ease;
}
.memory-card:hover { transform: translateY(-4px); border-color: var(--rule-strong); }
.memory-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.memory-card:hover img { transform: scale(1.06); }
.memory-caption {
  position: absolute; inset: auto 0 0 0; padding: 22px 12px 10px; font-family: var(--font-mono); font-size: 11px;
  color: #f4f2ee; background: linear-gradient(transparent, rgba(6, 8, 12, 0.82)); text-align: left;
}
.memory-fallback { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-faint); background: var(--bg-panel-raised); padding: 14px; text-align: center; }
.memory-fallback span { font-family: var(--font-mono); font-size: 10.5px; line-height: 1.5; }

/* ---- timeline ---- */
.timeline { position: relative; }
.timeline-item { position: relative; padding-left: 32px; padding-bottom: 30px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: 5px; top: 18px; bottom: -14px; width: 1px; background: var(--rule); }
.timeline-item:last-child::before { display: none; }
.timeline-node { position: absolute; left: 0; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg-panel); border: 2px solid var(--rose); box-shadow: 0 0 0 4px var(--rose-wash); }
.timeline-date { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rose); }
.timeline-label { margin: 5px 0 6px; font-size: 1.05rem; }
.timeline-note { color: var(--ink-muted); font-size: 14px; max-width: 62ch; }

/* ---- thoughts board ---- */
.composer { background: var(--bg-panel); border: 1px solid var(--rule); border-radius: var(--border-radius); padding: 20px; margin-bottom: 30px; }
.author-toggle { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.author-pill { font-family: var(--font-mono); font-size: 12px; padding: 7px 15px; border-radius: 999px; border: 1px solid var(--rule-strong); background: transparent; color: var(--ink-muted); cursor: pointer; transition: all 0.15s ease; }
.author-active { background: var(--rose-wash); border-color: var(--rose-dim); color: var(--rose); }

.composer-input {
  width: 100%; min-height: 92px; resize: vertical; background: var(--bg-panel-raised); border: 1px solid var(--rule);
  border-radius: 8px; padding: 13px 15px; color: var(--ink); font-family: var(--font-body); font-size: 14.5px;
  line-height: 1.6; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer-input::placeholder { color: var(--ink-faint); }
.composer-input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px var(--rose-wash); }

.composer-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 12px; flex-wrap: wrap; }
.char-count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.pin-button {
  font-family: var(--font-mono); font-size: 13px; padding: 11px 22px; border-radius: 999px; background: var(--rose);
  color: var(--ink-on-rose); font-weight: 600; border: none; cursor: pointer; transition: transform 0.15s ease, background 0.15s ease;
}
.pin-button:hover { transform: translateY(-2px); background: var(--rose-soft); }
.pin-button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.board-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.thought-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); }
.clear-all-btn { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); background: none; border: 1px solid var(--rule-strong); padding: 7px 13px; border-radius: 6px; cursor: pointer; transition: all 0.15s ease; }
.clear-all-btn:hover { color: var(--warn); border-color: var(--warn); }
.confirm-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-muted); font-family: var(--font-mono); flex-wrap: wrap; }
.confirm-yes { background: var(--warn); color: #2a0f0f; border: none; padding: 6px 13px; border-radius: 6px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; cursor: pointer; }
.confirm-no { background: none; border: 1px solid var(--rule-strong); color: var(--ink-muted); padding: 6px 13px; border-radius: 6px; font-family: var(--font-mono); font-size: 12px; cursor: pointer; }

.thoughts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 44px 20px; color: var(--ink-faint); font-size: 14px; border: 1px dashed var(--rule-strong); border-radius: var(--border-radius); }
.thought-card { background: var(--bg-panel); border: 1px solid var(--rule); border-radius: var(--border-radius); padding: 17px 19px; display: flex; flex-direction: column; gap: 12px; transition: border-color 0.15s ease; animation: thoughtIn 0.3s ease; }
.thought-card:hover { border-color: var(--rule-strong); }
@keyframes thoughtIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.thought-text { color: var(--ink); font-size: 14.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.thought-meta { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.thought-author { color: var(--rose); }
.thought-time { flex: 1; }
.delete-btn { background: none; border: none; color: var(--ink-faint); cursor: pointer; padding: 2px; display: flex; transition: color 0.15s ease; }
.delete-btn:hover { color: var(--warn); }
.confirm-delete-btn { background: var(--warn); color: #2a0f0f; border: none; padding: 4px 10px; border-radius: 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }

/* ---- footer ---- */
.board-footer { margin-top: 86px; padding-top: 28px; border-top: 1px solid var(--rule); text-align: center; }
.footer-note { color: var(--ink-faint); font-size: 12.5px; font-family: var(--font-mono); margin-bottom: 12px; max-width: 50ch; margin-left: auto; margin-right: auto; line-height: 1.7; }
.relock-link { background: none; border: none; color: var(--ink-faint); font-family: var(--font-mono); font-size: 11.5px; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.relock-link:hover { color: var(--ink-muted); }
.relock-confirm { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-muted); flex-wrap: wrap; justify-content: center; }

/* ---- lightbox ---- */
.lightbox { position: fixed; inset: 0; z-index: 20; background: rgba(6, 8, 12, 0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; cursor: zoom-out; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img { max-width: min(90vw, 720px); max-height: 70vh; object-fit: contain; border-radius: 8px; border: 1px solid var(--rule-strong); cursor: default; }
.lightbox-caption { color: var(--ink-muted); font-family: var(--font-mono); font-size: 13px; text-align: center; }
.lightbox-close { position: absolute; top: 22px; right: 24px; background: none; border: 1px solid var(--rule-strong); color: var(--ink-muted); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 640px) {
  .guess-form { flex-direction: column; }
  .guess-submit { width: 100%; }
  .thoughts-grid { grid-template-columns: 1fr; }
  .memory-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .hearts-row { gap: 8px; }
  .heart { width: 27px; height: 27px; }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}