/* Ridgeline Build Co. · concept by Tensaloom. Chaptered-editorial grammar in
   a technical-drawing world: paper, ink, one blueprint blue for "proposed". */
@font-face { font-family: "Newsreader"; font-weight: 400; font-display: swap; src: url(fonts/newsreader-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/newsreader-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 500; font-display: swap; src: url(fonts/newsreader-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 600; font-display: swap; src: url(fonts/newsreader-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 400; font-display: swap; src: url(/assets/fonts/geist-mono-latin-400-normal.woff2) format("woff2"); }

:root {
  --sc-canvas: #f1ece2;  --sc-surface: #f7f3eb;
  --sc-ink: #1e1b16;     --sc-ink-soft: #5b544a;
  --sc-accent: #2447a8;  --sc-accent-ink: #ffffff;
  --sc-font-display: "Newsreader", Georgia, serif;
  --sc-font-text: "Newsreader", Georgia, serif;
  --sc-font-mono: "Geist Mono", ui-monospace, monospace;
  --paper-2: #e8e1d3;
  --line: rgb(30 27 22 / .16);
  --folio-w: 11rem;
  --measure: 34rem;
}
html { scroll-padding-top: 3rem; }
body { background: var(--sc-canvas); color: var(--sc-ink); font-size: 1.14rem; line-height: 1.62; letter-spacing: 0; font-feature-settings: "onum" 1; }
h1, h2, p, dl, dd, figure, ol { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; }
.skip { position: fixed; left: 1rem; top: -4rem; z-index: 100; background: var(--sc-ink); color: var(--sc-canvas); padding: .5rem 1rem; }
.skip:focus { top: 1rem; }
.k, .concept, .folio, .ch__num, .toc span, .spec dt, .sched span, .plate__cap, .title__kicker, .colophon__small, .try {
  font-family: var(--sc-font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
}

/* honesty strip */
.concept { padding: .55rem var(--folio-w); padding-left: calc(var(--folio-w) + 2rem); color: var(--sc-ink-soft); border-bottom: 1px solid var(--line); }
.concept a { color: var(--sc-accent); }

/* folio: the navigation, in the margin */
.folio {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--folio-w); z-index: 20;
  display: flex; flex-direction: column; gap: .6rem; padding: 2.25rem 1.5rem;
  border-right: 1px solid var(--line); color: var(--sc-ink-soft); background: var(--sc-canvas);
}
.folio__mark { font-family: var(--sc-font-display); font-size: 1.05rem; letter-spacing: 0; text-transform: none; color: var(--sc-ink); font-style: italic; }
.folio__num { margin-top: auto; font-family: var(--sc-font-display); font-size: 3.2rem; line-height: 1; letter-spacing: -.02em; text-transform: none; color: var(--sc-ink); }
.folio__title { line-height: 1.5; min-height: 3em; }
.folio__rule { display: block; height: 2px; background: var(--line); }
.folio__rule span { display: block; height: 100%; width: 0; background: var(--sc-accent); transition: width 200ms linear; }

main { margin-left: var(--folio-w); }

/* title page */
.title { min-height: calc(100svh - 2.4rem); display: grid; align-content: center; gap: 1.6rem; padding: 4rem clamp(1.5rem, 7vw, 7rem); border-bottom: 1px solid var(--line); }
.title__kicker { color: var(--sc-ink-soft); }
.title__name { font-family: var(--sc-font-display); font-weight: 500; font-size: clamp(3.4rem, 1.5rem + 7vw, 8rem); line-height: .92; letter-spacing: -.035em; }
.title__name em { font-weight: 400; color: var(--sc-ink-soft); }
.title__lede { max-width: 30rem; font-size: 1.3rem; line-height: 1.5; }
.toc ol { list-style: none; padding: 0; display: grid; gap: 0; max-width: 30rem; border-top: 1px solid var(--line); }
.toc a { display: flex; gap: 1.25rem; align-items: baseline; padding: .7rem 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 1.15rem; }
.toc a:hover { color: var(--sc-accent); }
.toc span { width: 2.5rem; color: var(--sc-ink-soft); }

/* the book: text chapters beside one sticky plate */
.book { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.chapters { grid-column: 1; grid-row: 1; }
.plate { grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100svh; display: grid; align-content: center; gap: .9rem; padding: 2rem clamp(1rem, 3vw, 3rem); border-left: 1px solid var(--line); }
.plate__paper { background: var(--sc-surface); border: 1px solid var(--line); box-shadow: 0 1px 0 rgb(255 255 255 / .6) inset, 0 18px 40px -24px rgb(60 45 20 / .35); padding: 1rem; }
.plate__cap { color: var(--sc-ink-soft); }
.plate__cap span:first-child { color: var(--sc-ink); }

.ch { min-height: 100svh; padding: 18vh clamp(1.5rem, 5vw, 5rem) 12vh; border-bottom: 1px solid var(--line); background: var(--sc-canvas); }
.ch--alt { background: var(--paper-2); }  /* hard cut between chapters: a change of paper, not a gradient */
.ch__num { color: var(--sc-accent); margin-bottom: 1rem; }
.ch__title { font-family: var(--sc-font-display); font-weight: 500; font-size: clamp(2.4rem, 1.4rem + 3vw, 4rem); line-height: 1; letter-spacing: -.03em; margin-bottom: 2rem; }
.ch p { max-width: var(--measure); }
.ch p + p { margin-top: 1rem; }
.drop::first-letter { float: left; font-family: var(--sc-font-display); font-size: 4.1em; line-height: .78; font-weight: 500; padding: .08em .1em 0 0; color: var(--sc-accent); }
.aside { font-size: .98rem; font-style: italic; color: var(--sc-ink-soft); border-left: 2px solid var(--sc-accent); padding-left: 1rem; margin-top: 1.5rem !important; }
.spec { margin-top: 2rem; max-width: var(--measure); border-top: 1px solid var(--line); }
.spec div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.spec dt { color: var(--sc-ink-soft); padding-top: .25rem; }
.sched { list-style: none; padding: 0; margin-top: 1rem; max-width: var(--measure); border-top: 1px solid var(--ink, var(--sc-ink)); }
.sched li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .8rem .25rem; border-bottom: 1px solid var(--line); cursor: default; transition: background-color 160ms var(--sc-ease-out); }
.sched li:hover, .sched li.is-on { background: rgb(36 71 168 / .07); }
.sched span { color: var(--sc-accent); padding-top: .3rem; }
.try { margin-top: 1.75rem; padding: .7rem 1rem; border: 1px solid var(--sc-accent); background: transparent; color: var(--sc-accent); cursor: pointer; }
.try:hover { background: var(--sc-accent); color: #fff; }

/* the drawing */
.dwg { display: block; width: 100%; height: auto; color: var(--sc-ink); overflow: visible; }
.earth { color: var(--sc-ink); }
.ln { fill: none; stroke: var(--sc-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ln--thin { stroke-width: 1.1; }
.ln--ground { stroke-width: 2.2; }
.ln--leader { stroke-width: .9; stroke-dasharray: 3 3; }
.ln--sun { stroke: #b7791f; stroke-width: 1.4; stroke-dasharray: 2 5; }
.lbl { font: italic 13px var(--sc-font-display); fill: var(--sc-ink-soft); }
.lbl--prop { fill: var(--sc-accent); font-style: normal; font-weight: 500; }
.dim { fill: none; stroke: var(--sc-ink-soft); stroke-width: 1; color: var(--sc-ink-soft); }
.dim--prop { stroke: var(--sc-accent); color: var(--sc-accent); }
.dimtxt { font: 11px var(--sc-font-mono); fill: var(--sc-ink-soft); letter-spacing: .04em; }
.dimtxt--prop { fill: var(--sc-accent); font-size: 12px; }
.note { font: 11px var(--sc-font-mono); fill: var(--sc-ink); }
.note-dot { fill: var(--sc-accent); }
.prop { fill: rgb(36 71 168 / .06); stroke: var(--sc-accent); stroke-width: 2.2; stroke-linejoin: round; }
.prop--thin { fill: none; stroke-width: 1.3; }
.handle { cursor: ew-resize; outline: none; }
.handle__hit { stroke: transparent; stroke-width: 28; }
.handle__knob { fill: var(--sc-accent); stroke: var(--sc-surface); stroke-width: 3; transition: r 150ms var(--sc-ease-out); }
.handle:hover .handle__knob, .handle:focus-visible .handle__knob, .handle.is-dragging .handle__knob { r: 16; }
.handle:focus-visible .handle__knob { stroke: var(--sc-ink); }
.handle__arrows { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }

/* layers appear by stage; lines draw themselves */
.lay { opacity: 0; transition: opacity 500ms var(--sc-ease-out); }
.dwg[data-stage] .lay--house { opacity: 1; }
.dwg[data-stage="2"] .lay--survey, .dwg[data-stage="3"] .lay--survey { opacity: 1; }
.dwg[data-stage="3"] .lay--prop, .dwg[data-stage="4"] .lay--prop, .dwg[data-stage="5"] .lay--prop { opacity: 1; }
.dwg[data-stage="5"] .lay--live { opacity: 1; }
.lay .ln, .lay .dim { stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1400ms var(--sc-ease-out); }
.dwg[data-stage] .lay--house .ln,
.dwg[data-stage="2"] .lay--survey .ln, .dwg[data-stage="2"] .lay--survey .dim,
.dwg[data-stage="3"] .lay--survey .ln, .dwg[data-stage="3"] .lay--survey .dim,
.dwg[data-stage="5"] .lay--live .ln { stroke-dashoffset: 0; }
.ln--ground { stroke-dasharray: none; }
.ln--leader { stroke-dasharray: 3 3 !important; stroke-dashoffset: 0 !important; }
.ln--sun { stroke-dasharray: 2 5 !important; stroke-dashoffset: 0 !important; }
/* build stage: the part being built is highlighted */
.dwg[data-part] .lay--prop .prop { stroke-dasharray: 6 5; }
.dwg[data-part="walls"] [data-ext-outline], .dwg[data-part="roof"] [data-ext-light], .dwg[data-part="glazing"] [data-ext-door] { stroke-dasharray: none; stroke-width: 3.2; }
.dwg[data-part="ground"] .earth { opacity: .9; }
.dwg[data-part="finish"] .lay--prop .prop { stroke-dasharray: none; fill: rgb(36 71 168 / .12); }

.readout { display: flex; flex-wrap: wrap; gap: .4rem 1.75rem; align-items: baseline; padding: .8rem 1rem; border: 1px solid var(--sc-accent); background: rgb(36 71 168 / .05); }
.readout[hidden] { display: none; }
.readout p { display: flex; gap: .6rem; align-items: baseline; }
.readout b { font-family: var(--sc-font-display); font-size: 1.5rem; font-weight: 500; color: var(--sc-accent); font-variant-numeric: tabular-nums lining-nums; }
.readout .k { color: var(--sc-ink-soft); }
.readout__rule { flex-basis: 100%; font-size: .95rem; font-style: italic; }

/* colophon: the quietest type on the page */
.colophon { margin-left: 0; padding: 18vh clamp(1.5rem, 7vw, 7rem) 12vh; display: grid; gap: 1.4rem; max-width: 46rem; }
.colophon__mark { font-family: var(--sc-font-display); font-style: italic; font-size: 1.4rem; }
.colophon__cta { font-size: 1.3rem; line-height: 1.55; }
.colophon__cta a { color: var(--sc-accent); }
.colophon__small { color: var(--sc-ink-soft); line-height: 1.8; }
.colophon__concept { font-size: .95rem; color: var(--sc-ink-soft); border-top: 1px solid var(--line); padding-top: 1.2rem; }
.colophon__concept a { color: var(--sc-accent); }

@media (prefers-reduced-motion: reduce) {
  .lay, .lay .ln, .lay .dim { transition: none; }
}

/* phones and narrow tablets: folio becomes a top line; plate sticks above the text */
@media (max-width: 900px) {
  :root { --folio-w: 0px; }
  .concept { padding: .55rem 1rem; }
  .folio { top: 0; bottom: auto; left: 0; right: 0; width: auto; height: 2.6rem; flex-direction: row; align-items: center; gap: .75rem; padding: 0 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .folio__num { margin-top: 0; font-size: 1.1rem; }
  .folio__title { min-height: 0; }
  .folio__rule { position: absolute; left: 0; right: 0; bottom: -1px; }
  body { padding-top: 2.6rem; }
  .title { min-height: calc(100svh - 5rem); }
  .book { display: block; }
  .plate { position: sticky; top: 2.6rem; z-index: 10; height: auto; padding: .6rem .75rem; background: var(--sc-canvas); border-left: 0; border-bottom: 1px solid var(--line); gap: .4rem; }
  .plate__paper { padding: .4rem; }
  .plate__cap { display: none; }
  .readout { padding: .4rem .6rem; gap: .2rem 1rem; }
  .readout b { font-size: 1.1rem; }
  .readout__rule { font-size: .82rem; }
  .ch { min-height: 70svh; padding: 3rem 1.25rem 4rem; }
  .sched li { grid-template-columns: 6rem 1fr; }
}

/* once the extension is drawn, the survey notes step aside so they never cross it */
.dwg[data-stage="3"] .lay--survey .note, .dwg[data-stage="3"] .lay--survey .note-dot, .dwg[data-stage="3"] .lay--survey .ln--leader { opacity: 0; transition: opacity 300ms var(--sc-ease-out); }
