/* =========================================================================
   neron.foundation — page styles
   Editorial layout, on top of the NeronApp card UI imported via cards-ui.css.
   colors_and_type.css ships --surface-bg, --info, --success, etc.; this file
   adds editorial tokens that the page chrome needs and never collide with .ec-*.
   ========================================================================= */

/* ---------- 1. RESET + BASE ---------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

:root {
    /* editorial palette (independent of card UI tokens) */
    --bg:        #0a0a0a;
    --ink:       #f4f1ea;
    --ink-soft:  #c9c2b4;
    --ink-muted: #9b958a;
    --ink-faint: #5e5a52;
    --ink-ghost: #3a3833;
    --rule:      #1f1d1a;
    --rule-soft: #161412;
    --inset:     #07060a;

    --serif: 'Sorts Mill Goudy', 'EB Garamond', Georgia, 'Times New Roman', serif;
    --mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    --container: 720px;
    --container-wide: 980px;
    --gutter:    clamp(20px, 5vw, 48px);
    --section-y: clamp(96px, 14vh, 180px);
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.7;
    font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; transition: opacity 0.25s ease, border-color 0.25s ease; }
a:hover { opacity: 0.6; }

img, svg { display: block; max-width: 100%; }

::selection { background: var(--ink); color: var(--bg); }

.sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; top: -100px; left: 16px;
    background: var(--ink); color: var(--bg);
    padding: 8px 12px; font-family: var(--mono); font-size: 12px;
    z-index: 100;
}
.skip-link:focus { top: 16px; }

/* ---------- 2. MASTHEAD ---------- */

.masthead {
    position: fixed; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px var(--gutter);
    z-index: 50;
    pointer-events: none;
    background: linear-gradient(to bottom, var(--bg) 70%, rgba(10,10,10,0));
}
.masthead > * { pointer-events: auto; }
.wordmark {
    font-family: var(--serif);
    font-size: 22px;
    color: var(--ink);
    line-height: 1;
}
.status-badge {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-muted);
    letter-spacing: 0.06em;
    text-transform: lowercase;
}

/* ---------- 3. STICKY TOC (≥ 1024px) ---------- */

.toc {
    position: fixed;
    right: var(--gutter); top: 50%; transform: translateY(-50%);
    z-index: 40;
    display: none;
}
.toc ol {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 10px;
}
.toc a {
    display: flex; align-items: baseline; gap: 14px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
    line-height: 1;
}
.toc .num { color: var(--ink-ghost); }
.toc .lbl { opacity: 0; transform: translateX(-6px); transition: opacity 0.3s ease, transform 0.3s ease, color 0.25s ease; }
.toc:hover .lbl,
.toc a.active .lbl { opacity: 1; transform: translateX(0); }
.toc a.active { color: var(--ink); }
.toc a.active .num { color: var(--ink); }
.toc a:hover { opacity: 1; color: var(--ink); }
.toc a:hover .num { color: var(--ink); }

@media (min-width: 1100px) { .toc { display: block; } }

/* ---------- 4. LAYOUT ---------- */

main { display: flex; flex-direction: column; align-items: center; }

.section, .hero {
    width: 100%;
    max-width: var(--container);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

/* The "How it works" section is allowed to be wider so the cards breathe. */
#how { max-width: var(--container-wide); }

.section { padding-top: var(--section-y); padding-bottom: 0; }

/* ---------- 5. HERO ---------- */

.hero {
    min-height: 92vh;
    display: flex; flex-direction: column; justify-content: center;
    padding-top: clamp(140px, 18vh, 200px);
    padding-bottom: clamp(80px, 10vh, 120px);
}
.hero-inner > * { opacity: 0; transform: translateY(8px); animation: rise 1s ease forwards; }
.hero-inner > *:nth-child(1) { animation-delay: 0.05s; }
.hero-inner > *:nth-child(2) { animation-delay: 0.18s; }
.hero-inner > *:nth-child(3) { animation-delay: 0.32s; }
.hero-inner > *:nth-child(4) { animation-delay: 0.48s; }

@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.hero-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(48px, 9vw, 92px);
    line-height: 1.02;
    letter-spacing: -0.012em;
    margin: 0 0 28px;
    color: var(--ink);
}
.hero-sub {
    font-style: italic;
    font-size: clamp(20px, 2.4vw, 24px);
    color: var(--ink-soft);
    line-height: 1.45;
    margin: 0 0 56px;
    max-width: 580px;
}
.hero-cta { margin: 0 0 18px; }
.cta {
    font-family: var(--serif);
    font-size: 19px;
    color: var(--ink);
    border-bottom: 1px solid var(--ink-faint);
    padding-bottom: 4px;
    transition: border-color 0.25s ease;
}
.cta .arrow {
    font-family: var(--mono);
    font-size: 13px;
    margin-left: 8px;
}
.cta:hover { opacity: 1; border-bottom-color: var(--ink); }

.hero-quiet {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-muted);
    letter-spacing: 0.05em;
    margin: 0;
}

/* ---------- 6. SECTION CHROME ---------- */

/* Sections render immediately — no JS-gated visibility (was causing offscreen
 * sections to be hidden in headless screenshots and to bots that don't run JS). */

.kicker {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-faint);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 32px;
}

.section-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.1;
    letter-spacing: -0.005em;
    margin: 0 0 32px;
    color: var(--ink);
}
.section-sub {
    font-style: italic;
    font-size: 20px;
    color: var(--ink-soft);
    line-height: 1.45;
    margin: -16px 0 40px;
    max-width: 560px;
}

.prose p {
    margin: 0 0 22px;
    color: var(--ink-soft);
    font-size: 18px;
    line-height: 1.75;
}
.prose p:last-child { margin-bottom: 0; }
.prose .closing,
.prose.closing,
p.closing {
    color: var(--ink-muted);
    font-style: italic;
    margin-top: 40px;
}

.subhead {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 26px;
    line-height: 1.2;
    margin: 72px 0 20px;
    color: var(--ink);
}

.vision-flag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    background: rgba(168, 85, 247, 0.14);
    border: 1px solid rgba(168, 85, 247, 0.32);
    padding: 6px 12px;
    margin: 0 0 24px;
}

/* ---------- 7. HOW IT WORKS ---------- */

.how-step {
    margin: 56px 0 0;
    padding-top: 32px;
    border-top: 1px solid var(--rule);
}
.how-step-label {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-faint);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 18px;
}
.note-sample {
    margin: 0 0 18px;
    padding: 24px 28px;
    background: var(--inset);
    border: 1px solid var(--rule);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 19px;
    font-style: italic;
    line-height: 1.55;
    quotes: "\201C" "\201D";
}
.how-step-meta {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-muted);
    letter-spacing: 0.04em;
    margin: 0 0 24px;
}

.demo-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 24px 0 0;
    /* Kill the squircle clip-path inheritance (we don't ship squircle.js) so
       the .ec-* cards fall back cleanly to plain CSS border-radius. */
    --apple-clip: none;
    --apple-border: none;
}
.demo-cards > * {
    flex: 0 0 auto;
}
/* iOS continuous corners are the default in Safari, so add fallback rounding */
.demo-cards .ec-card-shell { border-radius: 24px; }
.demo-cards .ec-body-row,
.demo-cards .ec-activity-row,
.demo-cards .ec-task-row,
.demo-cards .ec-person-row,
.demo-cards .ec-mood-matrix,
.demo-cards .ec-reflection-wrap,
.demo-cards .ec-subcard { border-radius: 14px; }
/* Hide the SVG-border ::after that needs squircle.js — it'd otherwise paint a
   black rectangle over each card. */
.demo-cards .ec-card-shell::after,
.demo-cards .ec-body-row::after,
.demo-cards .ec-activity-row::after,
.demo-cards .ec-task-row::after,
.demo-cards .ec-person-row::after,
.demo-cards .ec-mood-matrix::after,
.demo-cards .ec-reflection-wrap::after,
.demo-cards .ec-subcard::after { display: none; }

/* The cards assume Inter; nothing in the page chrome does. */
.demo-cards { font-family: 'Inter', system-ui, sans-serif; }

/* ---------- 8. ONTOLOGY LIST ---------- */

.ontology {
    list-style: none; margin: 48px 0 32px; padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
.ontology > li {
    display: grid;
    grid-template-columns: 56px 1fr;
    column-gap: 20px;
    padding: 22px 0;
    border-top: 1px solid var(--rule);
}
.ontology > li:last-child { border-bottom: 1px solid var(--rule); }
.o-glyph {
    font-family: var(--mono);
    font-size: 22px;
    line-height: 1;
    color: var(--ink-faint);
    align-self: start;
    padding-top: 6px;
}
.o-glyph[data-ontology="mood"]       { color: #22c55e; }
.o-glyph[data-ontology="body"]       { color: #60a5fa; }
.o-glyph[data-ontology="food"]       { color: #f59e0b; }
.o-glyph[data-ontology="activity"]   { color: #9ca3af; }
.o-glyph[data-ontology="reflection"] { color: #a855f7; }
.o-glyph[data-ontology="tasks"]      { color: #3b82f6; }
.o-glyph[data-ontology="people"]     { color: #06b6d4; }

.o-name {
    grid-column: 2;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 24px;
    line-height: 1.2;
    margin: 0 0 4px;
    color: var(--ink);
}
.o-desc {
    grid-column: 2;
    font-size: 16px;
    color: var(--ink-soft);
    line-height: 1.65;
    margin: 0 0 8px;
}
.o-fields {
    grid-column: 2;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.02em;
    margin: 0;
}

/* ---------- 9. CODE BLOCK ---------- */

.code {
    background: var(--inset);
    border: 1px solid var(--rule);
    padding: 22px 24px;
    margin: 24px 0 32px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.65;
    color: var(--ink-soft);
    letter-spacing: 0.005em;
}
.code code { font-family: inherit; }

/* ---------- 10. STACK LIST ---------- */

.stack {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
}
.stack li {
    border-top: 1px solid var(--rule);
    padding: 18px 0;
    color: var(--ink-soft);
    font-size: 17px;
    line-height: 1.65;
}
.stack li:last-child { border-bottom: 1px solid var(--rule); }
.stack b {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    font-size: 19px;
    color: var(--ink);
    margin-right: 6px;
}

/* ---------- 11. MCP USES ---------- */

.mcp-uses {
    list-style: none; margin: 48px 0 32px; padding: 0;
    display: flex; flex-direction: column;
}
.mcp-uses > li {
    border-top: 1px solid var(--rule);
    padding: 28px 0;
}
.mcp-uses > li:last-child { border-bottom: 1px solid var(--rule); }
.mcp-prompt {
    font-family: var(--serif);
    font-style: italic;
    font-size: 22px;
    line-height: 1.35;
    color: var(--ink);
    margin: 0 0 12px;
}
.mcp-flow {
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-soft);
    margin: 0;
    max-width: 580px;
}

/* ---------- 12. NUMBERED BLOCKS ---------- */

.numbered {
    list-style: none; margin: 48px 0 32px; padding: 0;
}
.numbered > li {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 24px;
    padding: 32px 0;
    border-top: 1px solid var(--rule);
}
.numbered > li:last-child { border-bottom: 1px solid var(--rule); }
.numeral {
    font-family: var(--serif);
    font-style: italic;
    font-size: 56px;
    line-height: 1;
    color: var(--ink-faint);
    align-self: start;
}
.numbered h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 22px;
    line-height: 1.25;
    margin: 8px 0 10px;
    color: var(--ink);
}
.numbered p {
    color: var(--ink-soft);
    font-size: 17px;
    line-height: 1.7;
    margin: 0;
}
@media (max-width: 560px) {
    .numbered > li { grid-template-columns: 48px 1fr; gap: 16px; padding: 24px 0; }
    .numeral { font-size: 36px; }
}

.dashlist { list-style: none; margin: 12px 0 0; padding: 0; }
.dashlist li {
    color: var(--ink-soft);
    padding-left: 22px;
    position: relative;
    margin-bottom: 8px;
    font-size: 17px;
    line-height: 1.6;
}
.dashlist li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--ink-faint);
}
.dashlist b { font-weight: 400; color: var(--ink); font-style: italic; }

/* ---------- 13. FINDINGS ---------- */

.findings {
    display: flex; flex-direction: column;
    margin: 48px 0 32px;
}
.finding {
    border-top: 1px solid var(--rule);
    padding: 32px 0;
}
.finding:last-child { border-bottom: 1px solid var(--rule); }
.finding-label {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-faint);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 12px;
}
.finding h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 22px;
    line-height: 1.25;
    margin: 0 0 10px;
    color: var(--ink);
}
.finding p {
    color: var(--ink-soft);
    font-size: 17px;
    line-height: 1.7;
    margin: 0;
}

/* ---------- 14. WHAT'S NEXT ---------- */

.next-list {
    list-style: none; margin: 48px 0 0; padding: 0;
}
.next-list > li {
    border-top: 1px solid var(--rule);
    padding: 28px 0;
}
.next-list > li:last-child { border-bottom: 1px solid var(--rule); }
.next-list h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 22px;
    line-height: 1.2;
    margin: 0 0 10px;
    color: var(--ink);
}
.next-list p {
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1.65;
    margin: 0;
    max-width: 580px;
}

/* ---------- 15. CONTACT FORM ---------- */

.contact {
    margin: 56px 0 0;
    padding: 32px 0 0;
    border-top: 1px solid var(--rule);
}
.form-kicker {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-faint);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 20px;
}
.form-row { display: flex; flex-direction: column; margin-bottom: 24px; }
.form-row label {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-muted);
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    text-transform: lowercase;
}
.form-row input,
.form-row textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 18px;
    padding: 8px 0;
    line-height: 1.5;
    transition: border-color 0.3s ease;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
    resize: vertical;
}
.form-row input:focus,
.form-row textarea:focus { outline: none; border-bottom-color: var(--ink); }
.form-row textarea { min-height: 100px; }

button.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink-faint);
    padding: 14px 32px;
    font-family: var(--serif);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    margin-top: 8px;
}
button.ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
button.ghost .arrow { font-family: var(--mono); font-size: 13px; margin-left: 8px; }
button.ghost[disabled] { opacity: 0.4; cursor: not-allowed; }

.form-status {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-muted);
    margin: 16px 0 0;
    min-height: 1.4em;
}
.form-status.error { color: #c87a72; }
.form-status.success { color: var(--ink); }

/* ---------- 16. FAQ ---------- */

.faq { margin: 48px 0 0; }
.faq details { border-top: 1px solid var(--rule); padding: 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
    list-style: none;
    cursor: pointer;
    display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
    padding: 22px 0;
    font-family: var(--serif);
    font-size: 18px;
    color: var(--ink);
    line-height: 1.4;
    transition: opacity 0.25s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { opacity: 0.7; }
.faq summary .ind {
    flex: 0 0 auto;
    width: 14px; height: 14px;
    position: relative;
    margin-top: 8px;
    transition: transform 0.3s ease;
}
.faq summary .ind::before,
.faq summary .ind::after {
    content: ""; position: absolute; background: var(--ink-faint);
    transition: background 0.3s ease, transform 0.3s ease;
}
.faq summary .ind::before { left: 0; right: 0; top: 50%; height: 1px; transform: translateY(-50%); }
.faq summary .ind::after  { top: 0; bottom: 0; left: 50%; width: 1px; transform: translateX(-50%); }
.faq details[open] summary .ind::after { transform: translateX(-50%) scaleY(0); }
.faq details > div { padding: 0 0 24px; max-width: 580px; }
.faq details > div p {
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1.7;
    margin: 0;
}
.faq details > div a {
    color: var(--ink);
    border-bottom: 1px solid var(--ink-ghost);
    padding-bottom: 1px;
}
.faq details[open] > div { animation: fadeIn 0.4s ease both; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 17. FOOTER ---------- */

.footer {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: clamp(96px, 12vh, 140px) var(--gutter) 56px;
    border-top: 1px solid var(--rule);
    margin-top: clamp(96px, 14vh, 180px);
    display: flex; flex-direction: column; gap: 24px;
}
.footer-links {
    list-style: none; margin: 0; padding: 24px 0 0;
    display: flex; flex-wrap: wrap; gap: 28px;
}
.footer-links a {
    font-family: var(--serif);
    font-size: 17px;
    color: var(--ink-soft);
}
.footer-links a:hover { color: var(--ink); opacity: 1; }
.footer-mark {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-muted);
    letter-spacing: 0.04em;
    margin: 0;
}

/* ---------- 18. PRINT ---------- */

@media print {
    :root { --bg: #fff; --ink: #000; --ink-soft: #1f1f1f; --ink-muted: #5a5a5a; --ink-faint: #888; --ink-ghost: #aaa; --rule: #d6d6d6; --inset: #fafafa; }
    body { background: #fff; color: #000; }
    .masthead { position: static; padding: 24px var(--gutter) 0; background: none; }
    .toc { display: none !important; }
    .hero { min-height: auto; padding-top: 32px; }
    .section { page-break-inside: avoid; }
    a { color: inherit; }
    button.ghost { display: none; }
    .demo-cards { filter: invert(1) hue-rotate(180deg); }
}

/* ---------- 19. MOBILE TWEAKS ---------- */

@media (max-width: 600px) {
    body { font-size: 17px; }
    .masthead { padding: 16px var(--gutter); }
    .wordmark { font-size: 19px; }
    .status-badge { font-size: 9.5px; }
    .hero-title { font-size: 44px; line-height: 1.04; }
    .hero-sub { font-size: 18px; margin-bottom: 40px; }
    .section-title { font-size: 30px; }
    .subhead { font-size: 22px; margin-top: 56px; }
    .note-sample { font-size: 17px; padding: 18px 20px; }
    .demo-cards { gap: 14px; }
    .demo-cards > * { width: 100%; max-width: 100%; }
    .footer-links { gap: 18px; }
}

/* ---------- 20. REDUCED MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .hero-inner > * { opacity: 1 !important; transform: none !important; }
}
