/* Unsigh site theme. Locked LIGHT: airy pastel, deep-slate text.
   Shape rule: buttons are pill, cards and stage are 16px, inputs 8px.
   Display face: Bricolage Grotesque (self-hosted). Body: system stack. */

@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('../fonts/bricolage-700.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('../fonts/bricolage-600.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

:root {
    --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
    /* dusk-sky theme: the page is an evening sky, tools float in the scene.
       UI chrome is dusk indigo + coral; each toy owns one warm pastel hue. */
    --toy-sigh: #2fbfa8;
    --toy-shred: #f5a54a;
    --toy-scream: #f08a72;
    --toy-breath: #8a93e8;
    --toy-wrap: #b39ae6;
    --toy-balloon: #f48fb1;
    --bg: #f8f0f1;              /* fallback under the sky gradient */
    --bg-raise: #ffffff;
    --line: rgba(59, 58, 84, 0.1);
    --text: #3b3a54;            /* dusk indigo ink */
    --muted: #6d6c86;
    --accent: #4c4a75;          /* interactive dusk indigo, AA on white */
    --coral: #f2917a;           /* the warm edge of the sunset, hovers and highlights */
    --radius-card: 20px;
    --shadow-card: 0 12px 34px rgba(76, 74, 117, 0.1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    /* the dusk sky: peach horizon glow fading up into lavender-blue evening */
    /* no fixed attachment (mobile jank): the gradient spans the whole page,
       so the sky darkens as you scroll and night settles at the footer */
    background:
        radial-gradient(1200px 620px at 24% 0%, rgba(253, 226, 208, 0.75), transparent 65%),
        radial-gradient(1000px 540px at 88% 8%, rgba(242, 145, 122, 0.14), transparent 60%),
        linear-gradient(180deg, #fdf2ec 0%, #f7eef3 26%, #f0f0fa 70%, #e9edfa 100%);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.shell { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0.5em; color: var(--text); }
h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.14rem; font-weight: 600; }
h1 em { font-style: italic; color: var(--coral); line-height: 1.1; padding-bottom: 0.05em; }

/* ---------- Scroll reveal (site-motion.js adds .will-reveal / .is-in) ---------- */

.will-reveal { opacity: 0; transform: translateY(22px); }
.will-reveal.is-in {
    opacity: 1; transform: translateY(0);
    transition:
        opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--reveal-i, 0) * 70ms);
}

/* ---------- Nav ---------- */

.nav {
    position: sticky; top: 0; z-index: 40;
    border-bottom: 1px solid transparent; background: transparent;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.nav--scrolled {
    background: rgba(252, 243, 240, 0.72);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
    border-bottom-color: rgba(59, 58, 84, 0.08);
    box-shadow: 0 8px 30px rgba(76, 74, 117, 0.07);
}
.nav-row {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.brand {
    display: inline-flex; align-items: center; gap: 9px;
    color: var(--text); font-family: var(--display);
    font-weight: 700; font-size: 1.18rem; letter-spacing: -0.01em;
}
.brand svg { display: block; }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; gap: 26px; }
.nav-links a {
    position: relative; color: var(--muted); font-size: 0.94rem;
}
.nav-links a::after {
    content: ''; position: absolute; left: 0; right: 100%; bottom: -4px;
    height: 2px; border-radius: 1px; background: var(--coral);
    transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a:hover::after { right: 0; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-block; padding: 11px 24px; border-radius: 999px;
    font-size: 0.95rem; font-weight: 600; border: 1px solid transparent;
    cursor: pointer; white-space: nowrap;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: #3d3b61; }
.btn-ghost { color: var(--text); border-color: rgba(59, 58, 84, 0.28); background: rgba(255, 255, 255, 0.55); }
.btn-ghost:hover { border-color: var(--coral); color: #c25a41; }

/* ---------- Hero (home) ---------- */

/* compact hero: a slim intro band, tool cards must surface within the first screen */
.hero {
    display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 24px;
    align-items: center; padding-top: 20px; padding-bottom: 16px;
}
.hero h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
.hero-sub { font-size: 1.02rem; margin-bottom: 1.1em; }
.hero-sub { color: var(--muted); font-size: 1.14rem; max-width: 44ch; margin: 0 0 1.6em; }
/* headline block doubles as a shortcut into the tool grid */
.hero-copy-link { display: block; color: inherit; }
.hero-copy-link:hover { text-decoration: none; }
.hero-copy-link:hover em { text-decoration: underline; text-underline-offset: 6px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
/* the bottle floats free in the sky, backed by a slow-breathing sunset glow */
.hero-stage { position: relative; display: block; height: 280px; }
.hero-stage canvas { position: relative; width: 100%; height: 100%; display: block; }
.hero-glow {
    position: absolute; inset: 8% 12%;
    background: radial-gradient(ellipse at 50% 62%, rgba(242, 145, 122, 0.28), transparent 62%);
    filter: blur(4px);
    animation: breathe-glow 9s ease-in-out infinite;
    pointer-events: none;
}

/* sky furniture: soft clouds drifting through the hero, a balloon far away */
.hero { position: relative; }
.cloud {
    position: absolute; pointer-events: none;
    background: rgba(255, 255, 255, 0.78);
    border-radius: 999px; filter: blur(9px);
}
/* two puffs riding on the pill make it read as a cloud, not a blurred capsule */
.cloud::before, .cloud::after {
    content: ''; position: absolute; border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
}
.cloud::before { width: 46%; height: 130%; left: 16%; top: -62%; }
.cloud::after { width: 34%; height: 96%; right: 18%; top: -38%; }
.cloud-a { width: 240px; height: 58px; top: 10%; left: 44%; animation: drift 34s linear infinite; }
.cloud-b { width: 160px; height: 42px; top: 66%; left: 6%; opacity: 0.7; animation: drift 46s linear infinite reverse; }
.cloud-c { width: 120px; height: 34px; top: 26%; left: 2%; opacity: 0.55; animation: drift 58s linear infinite; }
@keyframes drift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(46px); }
}
.sky-balloon {
    position: absolute; top: 6%; right: 4%; width: 26px; height: 34px;
    pointer-events: none; opacity: 0.75;
    animation: bob 7s ease-in-out infinite;
}
.sky-balloon::before {
    content: ''; position: absolute; inset: 0 2px 8px;
    border-radius: 50% 50% 48% 48%;
    background: radial-gradient(circle at 36% 30%, color-mix(in srgb, var(--toy-balloon) 45%, white), var(--toy-balloon) 80%);
}
.sky-balloon::after {
    content: ''; position: absolute; left: 50%; bottom: -12px;
    width: 1px; height: 18px; background: rgba(59, 58, 84, 0.3);
}
.hero-copy > * { animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.hero-copy > *:nth-child(2) { animation-delay: 0.08s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.16s; }
.hero-stage { animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards; }

@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes breathe-glow {
    0%, 100% { opacity: 0.6; transform: scale(0.96); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* ---------- Tool grid ---------- */

.tools-section { padding: 20px 20px 24px; }
.tool-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
    margin-top: 22px;
}
.tool-card {
    --toy: var(--toy-sigh);
    position: relative; border-radius: var(--radius-card); padding: 18px 22px 22px;
    border: 1px solid color-mix(in srgb, var(--toy) 22%, transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--toy) 9%, #ffffff), #ffffff 62%);
    color: var(--text); display: block;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}
.tool-card:hover {
    text-decoration: none; transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--toy) 60%, transparent);
    box-shadow: 0 22px 46px color-mix(in srgb, var(--toy) 22%, rgba(31, 45, 61, 0.08));
}
/* corner arrow: slides in on hover as the "open me" affordance */
.tool-card::after {
    content: '\2192'; position: absolute; right: 18px; bottom: 16px;
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 0.95rem; color: #ffffff;
    background: color-mix(in srgb, var(--toy) 82%, #3b3a54);
    opacity: 0; transform: translateX(-8px);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.tool-card:hover::after { opacity: 1; transform: translateX(0); }
.toy-sigh { --toy: var(--toy-sigh); }
.toy-shred { --toy: var(--toy-shred); }
.toy-scream { --toy: var(--toy-scream); }
.toy-breath { --toy: var(--toy-breath); }
.toy-wrap { --toy: var(--toy-wrap); }
.toy-balloon { --toy: var(--toy-balloon); }
.tool-card:active { transform: translateY(-1px) scale(0.99); }
.tool-card p { color: var(--muted); font-size: 0.93rem; margin: 0; padding-right: 32px; }
.tool-card h3 { margin: 0 0 6px; }
.tool-card-wide { grid-column: span 2; }

/* ad row inside the tool grid spans the full width */
.ad-row { grid-column: 1 / -1; }

/* each card opens with a live miniature of the toy itself */
.tc-preview {
    position: relative; height: 138px; margin: -4px -8px 16px;
    border-radius: 12px; overflow: hidden;
    display: grid; place-items: center;
    background: linear-gradient(to top, color-mix(in srgb, var(--toy) 16%, transparent), color-mix(in srgb, var(--toy) 5%, transparent) 82%);
}
.tool-card-wide .tc-preview { height: 148px; }

/* sigh bottle: real canvas, ambient mode.
   Absolute so height:100% resolves against the preview box, not the grid track. */
.tc-sigh { height: 158px; }
.tc-sigh canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* worry shredder: slot + strips that fall on hover */
.tc-shred-slot {
    width: 64%; height: 12px; border-radius: 6px;
    background: rgba(31, 45, 61, 0.1);
    border: 1px solid rgba(31, 45, 61, 0.18);
    position: relative; z-index: 1; margin-top: -34px;
}
/* a sheet waiting above the slot, with faint text lines */
.tc-shred-paper {
    position: absolute; left: 50%; transform: translateX(-50%);
    top: 16px; width: 44%; height: 34px; border-radius: 4px 4px 0 0;
    background: #ffffff;
    border: 1px solid rgba(31, 45, 61, 0.12); border-bottom: 0;
}
.tc-shred-paper::before, .tc-shred-paper::after {
    content: ''; position: absolute; left: 14%; right: 14%; height: 3px;
    border-radius: 2px; background: rgba(31, 45, 61, 0.28);
}
.tc-shred-paper::before { top: 9px; }
.tc-shred-paper::after { top: 19px; right: 34%; }
.tool-card:hover .tc-shred-paper { animation: paper-feed 1.4s ease-in infinite; }
@keyframes paper-feed {
    0% { transform: translateX(-50%) translateY(0); }
    100% { transform: translateX(-50%) translateY(22px); }
}
.tc-strip {
    position: absolute; top: 50%; width: 3px; height: 26px; border-radius: 2px;
    background: #9fb0c2; opacity: 0;
}
.tool-card:hover .tc-strip { animation: strip-fall 1.1s ease-in infinite; }
.tc-strip:nth-child(3) { left: 34%; animation-delay: 0s !important; }
.tc-strip:nth-child(4) { left: 44%; animation-delay: 0.25s !important; }
.tc-strip:nth-child(5) { left: 55%; animation-delay: 0.12s !important; }
.tc-strip:nth-child(6) { left: 65%; animation-delay: 0.38s !important; }
@keyframes strip-fall {
    0% { opacity: 0; transform: translateY(-6px) rotate(0deg); }
    25% { opacity: 0.9; }
    100% { opacity: 0; transform: translateY(46px) rotate(24deg); }
}

/* scream jar: shakes and glows on hover */
.tc-jar {
    width: 52px; height: 66px; border-radius: 12px;
    border: 2px solid rgba(31, 45, 61, 0.35);
    background: rgba(255, 255, 255, 0.5);
    position: relative;
}
.tc-jar::before {
    content: ''; position: absolute; left: -6px; right: -6px; top: -10px;
    height: 8px; border-radius: 4px; background: #94a3b8;
}
.tool-card:hover .tc-jar {
    animation: jar-shake 0.35s linear infinite;
    box-shadow: inset 0 -18px 22px color-mix(in srgb, var(--toy) 45%, transparent);
}
@keyframes jar-shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-2px, 1px) rotate(-1.4deg); }
    50% { transform: translate(2px, -1px) rotate(1.2deg); }
    75% { transform: translate(-1px, -1px) rotate(-0.8deg); }
}

/* breathing bubble: it demos itself, slow pulse */
.tc-breath {
    width: 74px; height: 74px; border-radius: 50%;
    background: radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--toy) 55%, white), color-mix(in srgb, var(--toy) 85%, white) 78%);
    border: 1px solid color-mix(in srgb, var(--toy) 55%, transparent);
    box-shadow: 0 10px 26px color-mix(in srgb, var(--toy) 30%, transparent);
    animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe {
    0%, 100% { transform: scale(0.72); }
    45%, 60% { transform: scale(1.06); }
}

/* mini bubble wrap: actually poppable, pops persist via delayed transition */
.tc-bubbles {
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px;
    width: 82%;
}
.mini-bubble {
    aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle at 36% 32%, color-mix(in srgb, var(--toy) 26%, white), color-mix(in srgb, var(--toy) 55%, white) 72%);
    box-shadow: inset -1px -2px 4px color-mix(in srgb, var(--toy) 38%, rgba(31, 45, 61, 0.14)), inset 1px 2px 4px rgba(255, 255, 255, 0.85);
    transition: all 0.12s ease 9999s;   /* pops stick until the pointer leaves for a long time */
}
.mini-bubble:hover {
    transition-delay: 0s;
    transform: scale(0.86);
    background: color-mix(in srgb, var(--toy) 12%, #eef1f6);
    box-shadow: inset 0 2px 5px rgba(31, 45, 61, 0.22);
}

/* thought balloon: bobs gently, escapes upward on hover */
.tc-balloon { position: relative; width: 46px; height: 58px; animation: bob 5.5s ease-in-out infinite; transition: transform 1.6s ease; }
.tc-balloon::before {
    content: ''; position: absolute; inset: 0 3px 12px;
    border-radius: 50% 50% 48% 48%;
    background: radial-gradient(circle at 36% 30%, color-mix(in srgb, var(--toy) 45%, white), var(--toy) 78%);
}
.tc-balloon::after {
    content: ''; position: absolute; left: 50%; bottom: -16px;
    width: 1px; height: 26px; background: rgba(31, 45, 61, 0.35);
}
.tool-card:hover .tc-balloon { transform: translateY(-34px); }
@keyframes bob {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -7px; }
}

/* ---------- Night band: dusk finishes setting, house rules live in the night sky ---------- */

.night-band {
    position: relative; overflow: hidden; margin-top: 70px;
    padding: 110px 0 90px;
    /* fades up from transparent so the evening page melts into night */
    background: linear-gradient(180deg,
        rgba(86, 80, 128, 0) 0%,
        rgba(86, 80, 128, 0.55) 18%,
        #565080 40%,
        #494370 100%);
}
.night-band::before {
    /* star field, two densities via one repeating tile */
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image:
        radial-gradient(1.6px 1.6px at 22px 34px, rgba(255, 255, 255, 0.9), transparent 100%),
        radial-gradient(1px 1px at 120px 90px, rgba(255, 255, 255, 0.7), transparent 100%),
        radial-gradient(1.3px 1.3px at 200px 40px, rgba(255, 235, 220, 0.8), transparent 100%),
        radial-gradient(1px 1px at 70px 150px, rgba(255, 255, 255, 0.55), transparent 100%),
        radial-gradient(1.4px 1.4px at 250px 130px, rgba(255, 255, 255, 0.75), transparent 100%);
    background-size: 290px 190px;
    opacity: 0; animation: stars-out 3s ease 0.2s forwards;
    mask-image: linear-gradient(180deg, transparent 0%, #000 42%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 42%);
}
@keyframes stars-out { to { opacity: 1; } }
.night-band-inner { text-align: center; max-width: 860px; }
.night-band h2 { color: #f4f2fb; }
.night-band-inner > p { color: rgba(228, 225, 244, 0.78); max-width: 58ch; margin: 0 auto; }
.rule-pills { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 0 0 26px; padding: 0; list-style: none; }
.rule-pills li {
    padding: 13px 26px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    color: #f4f2fb; font-weight: 600; font-size: 0.95rem;
}

/* ---------- About strip / prose ---------- */

.about-strip { padding-top: 40px; padding-bottom: 72px; max-width: 820px; }
.about-strip p { color: var(--muted); max-width: 65ch; }

.prose { max-width: 760px; padding-top: 40px; padding-bottom: 80px; }
.prose h2 { margin-top: 1.8em; }
.prose p { color: var(--muted); }
.prose kbd, .stage-hint kbd {
    background: var(--bg-raise); border: 1px solid rgba(31, 45, 61, 0.2);
    border-radius: 8px; padding: 1px 7px; font-size: 0.85em;
}
.prose details {
    border-top: 1px solid var(--line); padding: 14px 4px;
}
.prose details:last-of-type { border-bottom: 1px solid var(--line); }
.prose summary {
    cursor: pointer; font-weight: 600; color: var(--text);
    list-style-position: outside;
}
.prose details p { margin: 10px 0 2px; }

/* ---------- Tool stage ---------- */

.tool-hero { padding-top: 52px; text-align: center; }
.tool-hero .hero-sub { margin-left: auto; margin-right: auto; }

.stage-wrap { padding-top: 10px; }
.stage {
    --toy: var(--toy-sigh);
    position: relative; height: min(72dvh, 620px);
    border-radius: var(--radius-card); border: 1px solid var(--line);
    background:
        radial-gradient(700px 380px at 50% 105%, color-mix(in srgb, var(--toy) 14%, transparent), transparent 70%),
        var(--bg-raise);
    box-shadow: var(--shadow-card);
    overflow: hidden; touch-action: none;
    user-select: none; -webkit-user-select: none;
}
.stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stage canvas { width: 100%; height: 100%; display: block; cursor: pointer; }

/* Dusk deep-space stage — only the Sigh Collector opts in via .stage--deep.
   Site background stays light; this one container goes deep so glow has somewhere to live. */
.stage--deep {
    border-color: rgba(76, 74, 117, 0.55);
    background:
        radial-gradient(120% 90% at 50% 8%, #3a2f52 0%, #241d3a 42%, #14101f 100%);
    box-shadow: 0 24px 60px rgba(20, 16, 31, 0.45), inset 0 0 120px rgba(0, 0, 0, 0.35);
}
.stage--deep::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(38% 46% at 28% 30%, rgba(120, 96, 190, 0.30), transparent 70%),
        radial-gradient(42% 50% at 74% 66%, rgba(64, 150, 175, 0.22), transparent 72%),
        radial-gradient(30% 38% at 60% 18%, rgba(150, 110, 200, 0.16), transparent 70%);
    animation: nebula-drift 34s ease-in-out infinite alternate;
    mix-blend-mode: screen;
}
.stage--deep::after {
    content: ''; position: absolute; inset: -2px; pointer-events: none;
    background:
        radial-gradient(60% 50% at 50% 108%, color-mix(in srgb, var(--toy-sigh) 22%, transparent), transparent 72%);
    mix-blend-mode: screen;
}
@keyframes nebula-drift {
    0%   { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
    50%  { transform: translate3d(2%, -1.5%, 0) scale(1.08); opacity: 1; }
    100% { transform: translate3d(-1.5%, 1.5%, 0) scale(1.04); opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
    .stage--deep::before { animation: none; }
}
.stage:fullscreen { height: 100%; width: 100%; border-radius: 0; border: 0; }
.stage:fullscreen canvas { cursor: none; }

.stage--deep .stage-hint { color: rgba(226, 224, 240, 0.7); }
.stage--deep .stage-hint kbd { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); color: #e2e0f0; }

.stage-hint {
    position: absolute; left: 0; right: 0; bottom: 14px; margin: 0;
    text-align: center; color: var(--muted); font-size: 0.92rem;
    pointer-events: none; transition: opacity 0.4s ease;
}
.stage-hint.is-hidden { opacity: 0; }

/* ---------- Result card (shared by all tools) ---------- */

.result-card {
    position: absolute; inset: 0; margin: auto;
    width: min(420px, calc(100% - 40px)); height: fit-content;
    max-height: calc(100% - 40px); overflow-y: auto;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid color-mix(in srgb, var(--toy, var(--accent)) 45%, transparent);
    border-radius: var(--radius-card); padding: 26px 28px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 24px 70px rgba(31, 45, 61, 0.22);
}
.card-title {
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--accent); margin: 0 0 14px;
}
.card-big { font-size: 3rem; font-weight: 700; letter-spacing: -0.03em; margin: 0; line-height: 1; color: var(--text); }
.card-mood { color: var(--muted); margin: 8px 0 18px; }
.card-rows { list-style: none; margin: 0 0 18px; padding: 0; }
.card-rows li {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 7px 0; border-top: 1px solid var(--line);
    font-size: 0.92rem; color: var(--text);
}
.card-rows li span:last-child { color: var(--accent); font-variant-numeric: tabular-nums; }
.card-seal {
    font-family: ui-monospace, "Space Mono", monospace;
    font-size: 0.72rem; letter-spacing: 0.14em;
    color: color-mix(in srgb, var(--toy, var(--accent)) 70%, var(--muted));
    margin: 0 0 12px;
}
.card-footer { font-size: 0.8rem; color: var(--muted); margin: 0 0 18px; }
.card-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Tool inputs (shredder, balloon) ---------- */

.tool-form {
    position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 12px; width: min(680px, calc(100% - 40px));
    z-index: 2; transition: opacity 0.3s ease;
}
.tool-form.is-hidden { opacity: 0; pointer-events: none; }
.tool-form input {
    flex: 1; min-width: 0; padding: 18px 22px; border-radius: 14px;
    border: 1px solid rgba(31, 45, 61, 0.22);
    background: #ffffff; color: var(--text);
    font-size: 1.15rem; font-family: inherit;
    box-shadow: 0 10px 30px rgba(31, 45, 61, 0.10);
}
.tool-form input::placeholder { color: var(--muted); opacity: 1; }
.tool-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.tool-form .btn { padding-left: 26px; padding-right: 26px; border-radius: 14px; font-size: 1.02rem; }
.tool-form input.nudge {
    animation: input-nudge 0.4s ease;
    border-color: color-mix(in srgb, var(--toy, var(--accent)) 70%, transparent);
}
@keyframes input-nudge {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-7px); }
    40%, 80% { transform: translateX(7px); }
}
@media (prefers-reduced-motion: reduce) { .tool-form input.nudge { animation: none; } }

/* ---------- Breathing Bubble ---------- */

.breath-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.breath-circle {
    width: min(300px, 52vw); height: min(300px, 52vw); border-radius: 50%;
    background: radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--toy) 40%, white), color-mix(in srgb, var(--toy) 75%, white) 78%);
    border: 1px solid color-mix(in srgb, var(--toy) 45%, transparent);
    box-shadow: 0 18px 60px color-mix(in srgb, var(--toy) 28%, transparent), inset 0 0 40px rgba(255, 255, 255, 0.4);
    transform: scale(0.6); will-change: transform;
}
.breath-cue {
    position: absolute; top: 26px; left: 0; right: 0; text-align: center;
    font-size: 1.15rem; color: var(--text); margin: 0;
}
.breath-count {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-size: 2.6rem; font-weight: 700; color: var(--text);
    pointer-events: none;
}
.breath-controls {
    position: absolute; bottom: 22px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.chip {
    padding: 8px 18px; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
    border: 1px solid rgba(31, 45, 61, 0.22); background: rgba(255, 255, 255, 0.7);
    color: var(--muted); cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.is-active { border-color: var(--accent); color: var(--accent); }

/* ---------- Bubble Wrap ---------- */

.wrap-stage { height: auto; min-height: 0; padding: 26px 22px 60px; }
.bubble-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
}
.bubble {
    aspect-ratio: 1; border-radius: 50%; cursor: pointer; border: 0; padding: 0;
    background: radial-gradient(circle at 36% 32%, color-mix(in srgb, var(--toy) 22%, white), color-mix(in srgb, var(--toy) 50%, white) 72%);
    box-shadow: inset -2px -3px 6px color-mix(in srgb, var(--toy) 40%, rgba(31, 45, 61, 0.12)), inset 2px 3px 6px rgba(255, 255, 255, 0.9);
    transition: transform 0.08s ease;
}
.bubble:hover { transform: scale(1.05); }
.bubble.is-popped {
    background: color-mix(in srgb, var(--toy) 10%, #eef1f6);
    box-shadow: inset 0 2px 8px rgba(31, 45, 61, 0.22);
    transform: scale(0.94); cursor: default;
}
.wrap-meta {
    position: sticky; bottom: 12px; display: flex; justify-content: center; gap: 8px;
    width: fit-content; margin: 14px auto 0; padding: 8px 20px;
    color: var(--muted); font-size: 0.92rem;
    background: rgba(255, 255, 255, 0.88); border: 1px solid var(--line);
    border-radius: 999px;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.wrap-meta strong { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- Home: latest writing rows (editorial list) ---------- */

.writing-section { max-width: 860px; padding-top: 30px; padding-bottom: 10px; }
.writing-rows { border-top: 1px solid rgba(59, 58, 84, 0.14); }
.writing-row {
    display: grid; grid-template-columns: 88px 1fr auto; gap: 18px;
    align-items: center; padding: 20px 10px;
    border-bottom: 1px solid rgba(59, 58, 84, 0.14);
    color: var(--text); border-radius: 4px;
    transition: background 0.2s ease, padding-left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.writing-row:hover { text-decoration: none; background: rgba(255, 255, 255, 0.65); padding-left: 18px; }
.writing-row time { color: #c25a41; font-weight: 600; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.writing-row h3 { margin: 0 0 4px; font-size: 1.18rem; }
.writing-row p { color: var(--muted); font-size: 0.92rem; margin: 0; }
.writing-arrow {
    color: var(--accent); font-size: 1.2rem;
    opacity: 0; transform: translateX(-8px);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.writing-row:hover .writing-arrow { opacity: 1; transform: translateX(0); }

/* ---------- Blog ---------- */

.blog-list { max-width: 760px; padding-top: 20px; padding-bottom: 80px; display: grid; gap: 16px; }
.blog-card {
    display: block; border: 1px solid var(--line); border-radius: var(--radius-card);
    background: var(--bg-raise); padding: 22px 26px; color: var(--text);
    box-shadow: var(--shadow-card);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}
.blog-card:hover { text-decoration: none; transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.blog-card time { color: var(--muted); font-size: 0.85rem; }
.blog-card h2 { font-size: 1.25rem; margin: 6px 0 8px; }
.blog-card p { color: var(--muted); font-size: 0.94rem; margin: 0; }
.blog-empty { color: var(--muted); }
.pager { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
.pager .is-disabled { opacity: 0.35; pointer-events: none; }

.blog-article h1 { margin-bottom: 0.8em; }
.blog-article h2 { color: var(--text); }
.blog-article ul, .blog-article ol { color: var(--muted); padding-left: 1.3em; }
.blog-article li { margin: 0.35em 0; }
.blog-article blockquote {
    margin: 1.4em 0; padding: 4px 20px; border-left: 3px solid var(--accent);
    color: var(--text);
}
.blog-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 6px; }

/* ---------- More tools cross-links ---------- */

.more-tools { margin-top: 3em; }
.more-tools ul {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: 12px; flex-wrap: wrap;
}
.more-tools li a {
    display: inline-block; padding: 9px 20px; border-radius: 999px;
    border: 1px solid rgba(31, 45, 61, 0.22); color: var(--text);
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.92rem; font-weight: 600;
}
.more-tools li a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Footer: night has settled ---------- */

.footer {
    position: relative; overflow: hidden; margin-top: 0;
    /* faint coral horizon line: the last sliver of sunset */
    border-top: 1px solid rgba(242, 145, 122, 0.28);
    background: linear-gradient(180deg, #494370 0%, #322b52 46%, #1e1834 100%);
    color: rgba(228, 225, 244, 0.82);
}
.footer .brand { color: #f4f2fb; }
.footer-stars {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        radial-gradient(1.6px 1.6px at 40px 50px, rgba(255, 255, 255, 0.85), transparent 100%),
        radial-gradient(1px 1px at 150px 110px, rgba(255, 255, 255, 0.6), transparent 100%),
        radial-gradient(1.3px 1.3px at 230px 30px, rgba(255, 235, 220, 0.7), transparent 100%),
        radial-gradient(1px 1px at 90px 170px, rgba(255, 255, 255, 0.5), transparent 100%);
    background-size: 300px 200px;
}
.footer-grid {
    position: relative;
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px;
    padding-top: 46px; padding-bottom: 28px;
}
.footer-note { color: rgba(203, 199, 228, 0.75); font-size: 0.88rem; max-width: 42ch; }
.footer-links { display: grid; gap: 9px; align-content: start; }
.footer-links a { color: rgba(203, 199, 228, 0.8); font-size: 0.92rem; }
.footer-links a:hover { color: #ffffff; }
.footer-bottom {
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 18px; padding-bottom: 26px;
}
.footer-bottom p { color: rgba(203, 199, 228, 0.6); font-size: 0.85rem; margin: 0; }

/* ---------- Static pages (nova-admin contract) ---------- */

.page-prose { max-width: 72ch; padding-top: 44px; padding-bottom: 80px; }
.page-prose h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.page-prose, .page-prose p, .page-prose li { color: var(--muted); }
.page-prose h2, .page-prose h3, .page-prose strong { color: var(--text); }
.page-prose img { max-width: 100%; height: auto; border-radius: var(--radius-card); }

/* ---------- Reduced motion: everything ambient goes still ---------- */

@media (prefers-reduced-motion: reduce) {
    .hero-copy > *, .hero-stage { animation: none; }
    .hero-glow, .tc-breath, .tc-balloon { animation: none; }
    .tc-breath { transform: scale(0.9); }
    .tool-card:hover .tc-jar, .tool-card:hover .tc-strip { animation: none; }
    .tool-card:hover .tc-balloon { transform: none; }
    .tool-card, .tool-card:hover { transition: none; transform: none; }
    .cloud { animation: none; }
    .night-band::before { animation: none; opacity: 1; }
    .nav { transition: none; }
    .writing-row, .writing-arrow, .tool-card::after { transition: none; }
}

/* ---------- Mobile ---------- */

@media (max-width: 900px) {
    .tool-grid { grid-template-columns: 1fr 1fr; }
    .tool-card-wide { grid-column: span 1; }
    .tool-grid .tool-card:last-child { grid-column: span 2; }
}

/* re-declared LAST so .toy-* beats the .stage default (equal specificity,
   source order wins); keep this block at the end of the file */
.toy-sigh { --toy: var(--toy-sigh); }
.toy-shred { --toy: var(--toy-shred); }
.toy-scream { --toy: var(--toy-scream); }
.toy-breath { --toy: var(--toy-breath); }
.toy-wrap { --toy: var(--toy-wrap); }
.toy-balloon { --toy: var(--toy-balloon); }

@media (max-width: 768px) {
    /* no hero on mobile: nav -> banner -> tool cards, plain document flow */
    .hero { display: none; }
    .tools-section { padding-top: 12px; }
    .tool-grid { grid-template-columns: 1fr; }
    .tool-grid .tool-card, .tool-grid .tool-card:last-child { grid-column: auto; }
    .footer-grid { grid-template-columns: 1fr; gap: 22px; }
    .nav-links { gap: 18px; }
    .stage { height: min(64dvh, 540px); }
    /* mobile copy diet: hide supplementary sentences and decorative sky bits */
    .m-hide { display: none; }
    .night-band-inner > p { display: none; }
    .cloud, .sky-balloon { display: none; }
    .writing-row { grid-template-columns: 1fr; gap: 4px; padding: 16px 6px; }
    .writing-row:hover { padding-left: 6px; }
    .writing-arrow { display: none; }
    .night-band { padding: 80px 0 64px; margin-top: 48px; }
}
