/* ============================================================================
   FRACTIONALKYLE — BRAND STYLESHEET (single source of truth)
   v1.0 · 2026
   Every component used across the site is defined ONCE here. The guidelines
   page and all templates import this file, so styles cannot drift apart.
   ----------------------------------------------------------------------------
   CONTENTS
     1. Design tokens (:root)          5. Wordmark
     2. Base / reset                   6. Notes (ruled baseline grid)
     3. Buttons                        7. Quote treatments
     4. Typography helpers             8. Graph module
   ============================================================================ */

/* ---- 1. DESIGN TOKENS --------------------------------------------------- */
:root{
  /* Green scale — ONE base hue (HSB 158/60/44) modified into variations.
     Darker = lower brightness + higher saturation, hue toward 120.
     Lighter = higher brightness + lower saturation, hue toward 180. */
  --g-900:#0B2919; --g-800:#143D28; --g-700:#1D523B; --g-600:#2D7058;
  --g-500:#3F8F74; --g-400:#60B29D; --g-300:#8AD1C3; --g-200:#B5E8E1;
  --g-100:#D7F5F3; --g-50:#E8FAF9;

  /* Accent — the only accent color. Lives on dark; on light use --lime-deep. */
  --lime:#99DB42; --lime-bright:#B6E86E; --lime-deep:#62992B;

  /* Neutrals — green-undertoned. Never pure black/white, never cream. */
  --ink:#1A1F1C; --ink-700:#59615D; --ink-500:#868F8B; --ink-300:#BDC7C2; --ink-100:#E4F2EB;
  --cool-paper:#F2FCF9;        /* cool off-white, faint green (not yellow)   */
  --rule:#C9D9D2;              /* ruled notebook line                        */
  --margin-rule:#D98A8A;       /* the one warm tone: notebook margin only    */

  /* Note-type colors — graph hierarchy, most→least important */
  --type-topic:#99DB42;   /* Topic Map — entry point (lime)   */
  --type-thought:#7BCB7A; /* Thought   — original conclusion  */
  --type-story:#E8A24C;   /* Story     — personal (only off-green tone) */
  --type-concept:#357E64; /* Concept   — understanding        */
  --type-book:#6FA89B;    /* Book      — source / reference   */

  /* Fonts */
  --type:'JetBrains Mono',ui-monospace,monospace;   /* structure: headings, labels, wordmark, UI */
  --body:'Newsreader',Georgia,serif;                /* reading: body + long-form                 */

  /* Baseline grid — THE unit. Every vertical value is a multiple of this.
     Never use raw px / unitless line-heights for vertical rhythm; use
     calc(var(--line) * n). This is what keeps notes sitting on the rules. */
  --line:34px;

  /* Dark-surface gradients — deep-green zones are NEVER flat fills. The
     gradient is what gives heroes, footers, the graph and the garden depth.
     --grad-hero: 3-stop diagonal from the top-right (use on heroes/footers).
     --grad-zone: 2-stop radial from the top-left (use on graph/garden panels). */
  --grad-hero:radial-gradient(120% 140% at 85% 12%, var(--g-700) 0%, var(--g-800) 44%, var(--g-900) 100%);
  --grad-zone:radial-gradient(120% 130% at 20% 8%, var(--g-800) 0%, var(--g-900) 62%);

  /* Note-link glyph — the index card (the literal Zettelkasten unit). Used as a
     CSS mask so it inherits the link colour via currentColor (green when
     published, ink when draft). Centralised here so the icon is defined ONCE. */
  --ico-card:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='1.7' y='3.1' width='12.6' height='9.8' rx='1.5'/%3E%3Cpath d='M1.7 6.1h12.6'/%3E%3Cpath d='M4 9h6M4 10.9h3.6'/%3E%3C/svg%3E");
}

/* ---- 2. BASE ------------------------------------------------------------ */
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:var(--body); background:var(--cool-paper); color:var(--ink);
  line-height:1.52; -webkit-font-smoothing:antialiased;
  /* Newsreader TUNED to sit with JetBrains Mono: lower optical size (sharper,
     less ornamental serifs at reading size), a touch more weight so the body
     holds up next to the bold mono, tighter rhythm so the two faces read as one
     system. opsz / weight / letter-spacing are inherited, so they reach all
     reading text. line-height:1.52 is for NON-grid body copy only — note-page
     text overrides it back to var(--line) to stay on the 34px baseline. */
  font-variation-settings:'opsz' 18; font-weight:450; letter-spacing:.005em;
}
/* Load fonts so a late swap cannot reflow the baseline grid:
   add to @font-face or the Google Fonts link → &display=optional
   (documented in README; the host page sets it on the <link>). */

a{color:var(--lime-deep);text-decoration:none}

/* ---- 4. TYPOGRAPHY HELPERS --------------------------------------------- */
.t-eyebrow{font-family:var(--type);font-size:.7rem;letter-spacing:.22em;text-transform:uppercase;color:var(--g-600)}
.t-display{font-family:var(--type);font-weight:800;letter-spacing:-.025em;line-height:1.05}
.t-section{font-family:var(--type);font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--g-700)}
.t-label{font-family:var(--type);letter-spacing:.14em;text-transform:uppercase}
.t-body{font-family:var(--body)}
/* lime keyword underline — a recurring signature.
   The "rising dry brush": a medium-heavy tapered brush stroke, angled up,
   trailing into specks like a brush running low on ink. NOT a flat bar.
   Markup: wrap the keyword and inline the brush SVG inside the span, e.g.
     <span class="ul">outcomes<svg class="ul-mark" viewBox="0 0 200 15"
        preserveAspectRatio="none" aria-hidden="true">…path+ellipses…</svg></span>
   Inline the <path>/<ellipse> directly (don't use <use href> to an external
   <defs> — CSS fill won't cross into referenced content, so the mark renders
   black). The full snippet is in the README; wrap it in a component helper. */
/* The brush renders BEHIND the text (z-index:-1) so it can sit at the baseline
   without ever clipping the letters — where they overlap, the glyphs paint on
   top. isolation:isolate gives .ul its own stacking context, so the negative
   z-index stays behind the text but still above the page/section background
   (it won't disappear behind a dark hero). Position is unchanged. */
.ul{position:relative;white-space:nowrap;display:inline-block;isolation:isolate}
.ul .ul-mark{position:absolute;left:-2%;width:104%;bottom:-.32em;height:.58em;overflow:visible;z-index:-1}
.ul .ul-mark path,.ul .ul-mark ellipse{fill:var(--lime)}

/* ---- 5. WORDMARK -------------------------------------------------------- */
/* "Fractional" + "Kyle" as one closed word. Designed for dark backgrounds. */
.wm{font-family:var(--type);font-weight:800;letter-spacing:-.03em;line-height:1}
.wm .frac{color:#fff}              /* on dark */
.wm .kyle{color:var(--lime)}
.on-light .wm .frac{color:var(--ink)}        /* on light: Fractional → ink */
.on-light .wm .kyle{color:var(--lime-deep)}  /* Kyle → deep lime for contrast */

/* ---- 3. BUTTONS --------------------------------------------------------- */
.btn{font-family:var(--type);font-weight:700;font-size:.85rem;padding:13px 22px;border-radius:11px;cursor:pointer;border:none;transition:.18s;display:inline-block}
.btn-primary{background:var(--lime);color:var(--g-900)}
.btn-primary:hover{background:var(--lime-bright)}
.btn-ghost{background:transparent;color:var(--lime);border:1.5px solid var(--g-600)}
.btn-ghost:hover{background:rgba(255,255,255,.06);border-color:var(--g-400)}
/* On light backgrounds use green, not lime, for the primary action: */
.on-light .btn-primary{background:var(--g-700);color:var(--cool-paper)}
.on-light .btn-primary:hover{background:var(--g-800)}
.on-light .btn-ghost{color:var(--g-700);border-color:var(--g-300)}
.on-light .btn-ghost:hover{background:var(--g-50)}

/* ---- 6. NOTES — RULED BASELINE GRID ------------------------------------ */
/* RULE: page lines start at top:0; content begins exactly one --line down, so
   the first baseline lands on the first rule. Every vertical value below is a
   multiple of --line. Opaque blocks (quotes) are locked to whole --line heights
   so they never push following text off the grid. */
.note-reader{background:#fff;border:1px solid var(--ink-100);border-radius:16px;overflow:hidden;
  display:grid;grid-template-columns:1fr 250px}
.note-reader .reader-top{grid-column:1/-1;background:var(--g-900);padding:15px 26px;display:flex;align-items:center;gap:12px}
.note-reader .reader-top nav{margin-left:auto;display:flex;gap:16px;font-family:var(--type);font-size:.68rem;color:var(--g-200)}
.note-reader .reader-top nav a{color:var(--g-200)}
.note-backlink{grid-column:1/-1;font-family:var(--type);font-size:.7rem;color:var(--g-700);padding:12px 26px;border-bottom:1px solid var(--ink-100);background:var(--g-50)}

.note-page{position:relative;padding:var(--line) 48px var(--line) 92px;
  background-image:repeating-linear-gradient(transparent,transparent calc(var(--line) - 1px),var(--rule) calc(var(--line) - 1px),var(--rule) var(--line));
  background-position:0 0;background-size:100% var(--line)}
.note-page::before{content:"";position:absolute;top:0;bottom:0;left:68px;width:1px;background:var(--margin-rule);opacity:.5}

.note-page .ntype{font-family:var(--type);font-size:.66rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--lime-deep);height:var(--line);line-height:var(--line)}
.note-page .ntype .tagcode{color:var(--ink-300);font-weight:400}
.note-page .ndate{font-family:var(--type);font-size:.66rem;letter-spacing:.12em;color:var(--ink-500);height:var(--line);line-height:var(--line)}
.note-page h1{font-family:var(--type);font-weight:800;font-size:1.5rem;letter-spacing:-.02em;line-height:var(--line);margin:0;color:var(--ink)}
/* Note body: keep line-height on the grid (var(--line)); apply only the
   opsz/weight/letter-spacing tuning so the serif sharpens without drifting off
   the rules. NEVER set line-height:1.52 here — it would break the baseline. */
.note-page p{font-family:var(--body);font-size:1.06rem;line-height:var(--line);margin:0 0 var(--line);font-variation-settings:'opsz' 18;font-weight:450;letter-spacing:.005em}
/* Note links — TWO states, one grammar. The index-card glyph + the link text
   carry the state colour; the dotted underline (on the inner .lt span) stays a
   quiet ink so dense notes read calm. Lime = the live thing = PUBLISHED; an
   unpublished stub gets NO lime (ink-grey), by the one-accent rule.
   Markup: <a class="link is-published"><span class="lt">title</span></a>
           <a class="link is-draft"><span class="lt">title</span></a>
   Underline lives on .lt so the leading glyph isn't underlined. Icon and
   underline add no vertical height, so the 34px baseline grid is untouched. */
.note-page a.link{font-family:var(--body);font-weight:500;text-decoration:none}
.note-page a.link::before{content:"";display:inline-block;width:.95em;height:.95em;margin-right:.34em;vertical-align:-.13em;
  background:currentColor;-webkit-mask:var(--ico-card) center/contain no-repeat;mask:var(--ico-card) center/contain no-repeat}
.note-page a.link .lt{text-decoration:underline;text-decoration-style:dotted;text-decoration-thickness:1.5px;text-underline-offset:3px;text-decoration-color:var(--ink-300)}
.note-page a.link.is-published{color:var(--lime-deep)}                       /* green glyph + text = live */
.note-page a.link.is-draft{color:var(--ink-700)}                             /* ink glyph + text = not yet published */
.note-page a.link.is-published:hover .lt{text-decoration-color:var(--lime-deep)}
.note-page a.link.is-draft:hover{color:var(--g-700)}

.note-page .stems{margin-top:var(--line);padding-left:14px;border-left:2px solid var(--g-300)}
.note-page .stems .lbl{font-family:var(--type);font-size:.62rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--g-600);line-height:var(--line)}
.note-page .stems a{display:block;font-family:var(--body);font-size:1rem;line-height:var(--line);color:var(--lime-deep);font-weight:500}
.note-page .stems a::before{content:"↑ ";color:var(--g-400)}

.note-page .section-h{font-family:var(--type);font-weight:700;font-size:.76rem;letter-spacing:.1em;text-transform:uppercase;color:var(--g-700);line-height:var(--line);margin-top:var(--line)}

/* Divider occupies a FULL line-row (not 1px) so the grid continues after it. */
.note-page .divider{border:none;height:var(--line);margin:0;background:none;position:relative}
.note-page .divider::after{content:"";position:absolute;left:0;right:0;top:calc(var(--line)/2);border-top:1px dashed var(--ink-300)}

.note-page .refs{margin-top:var(--line)}
.note-page .refs .lbl{font-family:var(--type);font-size:.68rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--g-700);line-height:var(--line)}
.note-page .refs a{display:block;font-family:var(--body);font-size:.98rem;line-height:var(--line);color:var(--lime-deep)}
.note-page .refs a::before{content:"📚 "}

/* right rail */
.note-rail{border-left:1px solid var(--ink-100);padding:22px 18px;background:#fff}
.note-rail .lbl{font-family:var(--type);font-size:.62rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--g-600);margin-bottom:14px}
.note-rail .rel a{display:block;font-family:var(--body);font-size:.92rem;line-height:1.45;color:var(--ink);padding:7px 0;border-bottom:1px solid var(--ink-100)}
.note-rail .rel a small{display:block;font-family:var(--type);font-size:.56rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-500)}

/* ---- 7. QUOTE TREATMENTS ----------------------------------------------- */
/* Both are OPAQUE boxes — page rules do NOT show through. Outer height locked
   to whole --line units; interior centered, reads naturally (not snapped).
   For longer quotes raise min-height by whole --line steps (4→5→6 …). */

/* C · Source slip — DEFAULT, everyday sourced excerpts.
   Inner whitespace is driven by padding (consistent regardless of quote length),
   and every inner element sits on a var(--line) row so the box height — and
   therefore everything below it — stays on the ruled grid. */
.q-source{margin:var(--line) 0;background:var(--cool-paper);border:1px solid var(--ink-300);border-radius:6px;
  padding:calc(var(--line) * 0.5) 22px;position:relative;box-shadow:3px 3px 0 var(--g-100)}
.q-source .slip{font-family:var(--type);font-size:.58rem;letter-spacing:.16em;text-transform:uppercase;color:var(--lime-deep);line-height:var(--line)}
.q-source .qt{font-family:var(--body);font-size:1.02rem;line-height:var(--line);color:var(--g-900);font-variation-settings:'opsz' 18;font-weight:450;letter-spacing:.005em}
.q-source .attr{font-family:var(--type);font-size:.64rem;letter-spacing:.04em;color:var(--ink-700);line-height:var(--line);display:flex;justify-content:space-between;gap:14px}
.q-source .attr .title{color:var(--g-700);font-weight:600}
.q-source .attr .pg{color:var(--lime-deep);white-space:nowrap}

/* E · Central plate — the ONE anchor quote per note (dark epigraph).
   Same grid-aligned padding model as .q-source. */
.q-central{margin:var(--line) 0;background:var(--g-900);border-radius:10px;padding:calc(var(--line) * 0.5) 30px;position:relative;overflow:hidden}
.q-central::after{content:"";position:absolute;inset:0;background-image:radial-gradient(rgba(255,255,255,.045) 1px,transparent 1px);background-size:18px 18px}
.q-central .mark{position:absolute;top:14px;left:16px;font-family:var(--body);font-size:2.4rem;color:var(--g-600);line-height:1;z-index:2}
.q-central .qt{position:relative;z-index:2;font-family:var(--body);font-style:italic;font-size:1.14rem;line-height:var(--line);color:var(--g-100);padding-left:22px;font-variation-settings:'opsz' 18;font-weight:450;letter-spacing:.005em}
.q-central .attr{position:relative;z-index:2;font-family:var(--type);font-size:.64rem;letter-spacing:.1em;text-transform:uppercase;color:var(--g-300);line-height:var(--line);padding-left:22px}
.q-central .attr .title{color:#fff}
.q-central .attr .pg{color:var(--lime)}

/* ---- 8. GRAPH MODULE ---------------------------------------------------- */
/* Dark canvas; node color = note type; lime = entry points + focus only.
   See README §Graph for the D3 force settings (this CSS is presentation only). */
.graph-module{border-radius:18px;overflow:hidden;border:1px solid var(--ink-100)}
.graph-bar{background:var(--g-900);padding:16px 22px;display:flex;align-items:center;gap:14px}
.graph-bar .title{font-family:var(--type);font-size:.74rem;letter-spacing:.12em;text-transform:uppercase;color:var(--g-300)}
.graph-canvas{position:relative;background:var(--grad-zone)}
.graph-canvas::after{content:"";position:absolute;inset:0;pointer-events:none;background-image:radial-gradient(rgba(255,255,255,.045) 1px,transparent 1px);background-size:26px 26px}
.graph-canvas svg{display:block;width:100%;height:560px;position:relative;z-index:2}
.graph .link{fill:none;stroke:var(--g-600);stroke-opacity:.5;transition:stroke .15s,stroke-opacity .15s}
.graph .link.hot{stroke:var(--lime);stroke-opacity:.85}
.graph .link.dim{stroke-opacity:.08}
.graph .node circle{stroke:var(--g-900);stroke-width:2px;cursor:pointer;transition:r .15s,stroke .15s}
.graph .node.focus circle{stroke:#fff;stroke-width:2.5px}
.graph .node.dim{opacity:.18}
.graph .node text{font-family:var(--type);fill:var(--g-200);pointer-events:none;opacity:0;transition:opacity .15s}
.graph .node.topic text{opacity:.92;fill:#fff;font-weight:700}
.graph .node:hover text,.graph .node.focus text,.graph .node.near text{opacity:1;fill:#fff}
.graph .glow{filter:drop-shadow(0 0 6px rgba(153,219,66,.7))}

/* ---- 9. SIGNATURE FLOURISHES -------------------------------------------
   Deliberate accent devices. Use SPARINGLY — one or two per section, never
   stacked. See the guidelines "Signature Flourishes" section for the rule on
   WHEN to use each. The lime underline (.ul) is defined in §4 Typography. */

/* solid offset shadow — confident, tactile. Cards & secondary buttons on light. */
.fx-offset{box-shadow:3px 3px 0 var(--g-700)}
.fx-offset-soft{box-shadow:3px 3px 0 var(--g-100)}   /* quieter, e.g. source slips */

/* XL background wordmark/word — oversized, near-invisible. Heroes & big empty areas only. */
.fx-bgword{position:absolute;font-family:var(--type);font-weight:800;line-height:.8;
  letter-spacing:-.05em;color:#fff;opacity:.04;user-select:none;pointer-events:none;z-index:0}

/* dot-grid texture — adds quiet texture to large dark areas. Apply to a positioned parent. */
.fx-dotgrid{position:relative}
.fx-dotgrid::after{content:"";position:absolute;inset:0;pointer-events:none;
  background-image:radial-gradient(rgba(255,255,255,.05) 1px,transparent 1px);background-size:24px 24px}
.fx-dotgrid-ink::after{background-image:radial-gradient(var(--ink-100) 1px,transparent 1px)} /* for light areas */

/* lime status dot — "available", live indicators, the wordmark bullet. Tiny only. */
.fx-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--lime)}

/* lime hover signal — nav links / interactive text turn lime on hover (interaction = lime). */
.fx-hover-lime{transition:color .15s}
.fx-hover-lime:hover{color:var(--lime)}

