/*
Theme Name: Ductus
Description: Independent variable type foundry.
Version: 1.0
*/

/* ============================================================
   Ductus breaks from every prior skeleton in this project: the
   hero is not a passive canvas to scroll past — it is a working
   tool (a live variable-font specimen tester with real sliders).
   Palette is stark print-specimen: true white, true black, one
   saturated indigo accent — no dark background, no warm paper.
   ============================================================ */
:root {
	--paper: #FFFFFF;
	--paper-2: #F4F4F2;
	--ink: #0A0A0A;
	--ink-soft: #4B4B48;
	--ink-faint: #9A9A94;
	--line: rgba(10, 10, 10, 0.12);
	--line-strong: rgba(10, 10, 10, 0.5);
	--indigo: #4433FF;
	--indigo-soft: #EDEBFF;
	--font-display: 'Roboto Flex', sans-serif;
	--font-body: 'Literata', serif;
	--font-mono: 'DM Mono', monospace;
	--wrap: 1280px;
}

* { box-sizing: border-box; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 36px; }
::selection { background: var(--indigo); color: #fff; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.02; margin: 0 0 0.4em; color: var(--ink); letter-spacing: -0.02em; }
h2 { font-size: clamp(30px, 3.6vw, 50px); font-weight: 460; }
h3 { font-size: clamp(19px, 2vw, 24px); font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 1.1em; color: var(--ink-soft); }
.mono { font-family: var(--font-mono); }

/* Structural device: "CUT" marks — the historical term for a
   typeface produced at a specific size — in place of every prior
   theme's field-log / timecode / folio / meltlog device. */
.cutmark { display: flex; align-items: baseline; gap: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 20px; }
.cutmark .cm-no { color: var(--indigo); font-weight: 500; }

.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--indigo); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--indigo); }

.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 26px; border: 1.5px solid var(--ink); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); background: transparent; transition: background 0.2s, color 0.2s; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn.solid:hover { background: var(--ink); border-color: var(--ink); }

/* ============================================================
   Header
   ============================================================ */
.site-head { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 20px 0; border-bottom: 1px solid transparent; transition: border-color 0.3s, background 0.3s; }
.site-head.scrolled { background: rgba(255,255,255,0.9); backdrop-filter: blur(8px); border-color: var(--line); }
.head-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 22px; display: flex; align-items: baseline; gap: 8px; }
.logo .tm { font-family: var(--font-mono); font-size: 10px; color: var(--indigo); vertical-align: super; }
.main-nav ul { list-style: none; display: flex; gap: 30px; margin: 0; padding: 0; }
.main-nav a { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.main-nav a:hover { color: var(--indigo); }
.nav-toggle { display: none; background: none; border: 1px solid var(--ink); color: var(--ink); font-size: 11px; letter-spacing: 0.06em; padding: 7px 14px; cursor: pointer; font-family: var(--font-mono); }
.mobile-nav { position: fixed; inset: 0; z-index: 200; background: var(--paper); transform: translateY(-100%); transition: transform 0.4s cubic-bezier(.7,0,.3,1); display: flex; flex-direction: column; }
.mobile-nav.open { transform: translateY(0); }
.mobile-nav ul { list-style: none; margin: auto 0; padding: 0 40px; }
.mobile-nav li { border-bottom: 1px solid var(--line); }
.mobile-nav a { display: block; padding: 18px 0; font-family: var(--font-display); font-size: 34px; color: var(--ink); }
.mn-close { position: absolute; top: 24px; right: 34px; background: none; border: 1px solid var(--ink); font-size: 20px; padding: 4px 13px; cursor: pointer; }
@media (max-width: 900px) { .main-nav { display: none; } .nav-toggle { display: block; } }

/* ============================================================
   THE TESTER — the hero IS the product, not a canvas to scroll
   past. A live contenteditable specimen rendered in the flagship
   variable font, with real axis sliders. First interactive-tool
   hero in this project.
   ============================================================ */
.tester { padding: 130px 0 0; min-height: 100vh; display: flex; flex-direction: column; }
.tester-top { padding: 0 36px; }
.tester-kicker { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
.tester-stage { flex: 1; display: flex; align-items: center; padding: 20px 36px; }
#specimenText {
	width: 100%; outline: none; border: none; background: transparent; color: var(--ink);
	font-family: var(--font-display); font-weight: 420; font-size: clamp(48px, 9vw, 150px);
	line-height: 1.0; letter-spacing: -0.02em; cursor: text; word-break: break-word;
}
#specimenText:empty::before { content: attr(data-placeholder); color: var(--ink-faint); }
.tester-controls { border-top: 1.5px solid var(--ink); padding: 22px 36px 34px; }
.axis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px 34px; }
.axis-row { display: flex; flex-direction: column; gap: 8px; }
.axis-row .ax-label { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.axis-row .ax-label b { color: var(--indigo); font-weight: 500; }
.axis-row input[type="range"] {
	-webkit-appearance: none; appearance: none; width: 100%; height: 2px; background: var(--line-strong); outline: none; cursor: pointer;
}
.axis-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--indigo); cursor: pointer; }
.axis-row input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--indigo); border: none; cursor: pointer; }
.tester-hint { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); margin-top: 18px; }

/* ============================================================
   Section rhythm
   ============================================================ */
.section { padding: 120px 0; }
.section-head { max-width: 680px; margin-bottom: 54px; }
.section-head p { font-size: 17px; max-width: 540px; }

/* ============================================================
   Particle headline — a Canvas2D section where a headline is
   sampled into a particle field and shatters/reforms on scroll.
   ============================================================ */
.shatter-section { padding: 0; position: relative; height: 78vh; min-height: 480px; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); overflow: hidden; background: var(--paper-2); }
#shatterCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.shatter-caption { position: absolute; left: 36px; bottom: 26px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }

/* ============================================================
   Specimen waterfall — the classic type-specimen convention: the
   same word set stacked in descending point sizes. Used for the
   homepage showcase and the archive/single templates, NOT a card
   grid, NOT a spread, NOT a flat-lay.
   ============================================================ */
.waterfall { border-top: 1.5px solid var(--ink); }
.wf-row { border-bottom: 1px solid var(--line); padding: 0 36px; display: flex; align-items: baseline; justify-content: space-between; gap: 24px; overflow: hidden; transition: background 0.25s; }
.wf-row:hover { background: var(--indigo-soft); }
.wf-row a { display: flex; align-items: baseline; justify-content: space-between; width: 100%; gap: 24px; padding: 18px 0; }
.wf-word { font-family: var(--font-display); white-space: nowrap; color: var(--ink); }
.wf-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); flex-shrink: 0; text-align: right; }
.wf-meta .wf-classification { color: var(--indigo); }
/* descending sizes, applied inline per row via style attr from PHP */

/* ============================================================
   Glyph wall — cursor-proximity magnetism drives each glyph's
   variable weight/size live. Pure DOM + JS, no WebGL.
   ============================================================ */
.glyphwall { display: flex; flex-wrap: wrap; gap: 2px; border: 1.5px solid var(--ink); }
.glyph-cell {
	flex: 1 1 64px; min-width: 64px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
	font-family: var(--font-display); font-size: 34px; border: 1px solid var(--line); color: var(--ink);
	transition: color 0.2s; will-change: font-variation-settings, transform;
}
.glyph-cell:hover { color: var(--indigo); }

/* ============================================================
   Foundry stats — inline, not a bordered 4-cell band
   ============================================================ */
.glance { display: flex; flex-wrap: wrap; gap: 50px; padding: 44px 0; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.glance .g-num { font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 3.6vw, 48px); color: var(--indigo); }
.glance .g-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }

/* Designer notes — pull quotes with hairline rules */
.notes-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px; }
.note-card { padding-top: 20px; border-top: 1.5px solid var(--ink); }
.note-card .nc-role { font-family: var(--font-mono); font-size: 10px; color: var(--indigo); text-transform: uppercase; letter-spacing: 0.08em; }
.note-card blockquote { font-family: var(--font-body); font-style: italic; font-size: 19px; margin: 14px 0; line-height: 1.35; color: var(--ink); }
.note-card cite { font-style: normal; font-size: 13px; color: var(--ink-faint); }
@media (max-width: 900px) { .notes-band { grid-template-columns: minmax(0, 1fr); } }

/* Journal list */
.notes-list { border-top: 1.5px solid var(--ink); }
.note-row { display: grid; grid-template-columns: 130px 1fr; gap: 28px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.note-row .nr-date { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); }
.note-row h3 { margin: 0 0 8px; }
.note-row p { font-size: 15px; margin: 0; }
@media (max-width: 640px) { .note-row { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

/* CTA */
.cta-band { padding: 130px 0; text-align: center; border-top: 1.5px solid var(--ink); }
.cta-band h2 { max-width: 740px; margin: 0 auto 20px; }
.cta-band p { max-width: 540px; margin: 0 auto 30px; }

/* Footer */
.site-foot { padding: 70px 0 38px; background: var(--ink); color: var(--paper); }
.site-foot .eyebrow { color: var(--indigo); }
.site-foot .eyebrow::before { background: var(--indigo); }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 44px; padding-bottom: 46px; border-bottom: 1px solid rgba(255,255,255,0.16); }
.foot-brand .logo { color: var(--paper); margin-bottom: 14px; }
.foot-brand p { max-width: 340px; font-size: 15px; color: rgba(255,255,255,0.62); }
.foot-col h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin: 0 0 16px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin: 0; }
.foot-col a { display: block; padding: 5px 0; color: rgba(255,255,255,0.78); font-size: 15px; }
.foot-col a:hover { color: var(--indigo); }
.foot-bottom { display: flex; justify-content: space-between; padding-top: 26px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: rgba(255,255,255,0.4); flex-wrap: wrap; gap: 12px; }
@media (max-width: 780px) { .foot-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .foot-brand { grid-column: 1 / -1; } }

/* ============================================================
   Inner pages / single typeface
   ============================================================ */
.page-hero { padding: 180px 0 54px; border-bottom: 1.5px solid var(--ink); }
.typeface-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; padding: 70px 36px; max-width: var(--wrap); margin: 0 auto; align-items: start; }
.typeface-facts { position: sticky; top: 110px; }
.typeface-facts dl { display: grid; grid-template-columns: auto 1fr; gap: 12px 20px; margin: 22px 0 0; border-top: 1px solid var(--line); padding-top: 20px; }
.typeface-facts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); }
.typeface-facts dd { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--indigo); text-align: right; }
.typeface-body p { font-size: 17px; }
@media (max-width: 900px) { .typeface-layout { grid-template-columns: minmax(0, 1fr); } .typeface-facts { position: static; } }

.classification-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 26px; }
.classification-filter a { padding: 7px 15px; border: 1px solid var(--line-strong); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.classification-filter a.active, .classification-filter a:hover { border-color: var(--indigo); color: var(--indigo); }

.simple-page { padding: 180px 0 120px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; }
.contact-form { display: grid; gap: 18px; max-width: 540px; margin-top: 28px; }
.contact-form label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 7px; }
.contact-form input, .contact-form textarea { width: 100%; background: var(--paper-2); border: 1px solid var(--line-strong); color: var(--ink); padding: 12px 14px; font-family: var(--font-body); font-size: 15px; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--indigo); }

.notfound { padding: 210px 36px; text-align: center; }
.notfound .nf-code { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--indigo); }

[data-reveal] { opacity: 0; transform: translateY(20px); }
[data-reveal].shown { opacity: 1; transform: none; transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.7,.3,1); }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1 !important; transform: none !important; } }

#pre { position: fixed; inset: 0; z-index: 999; background: var(--paper); display: flex; align-items: center; justify-content: center; transition: opacity 0.5s, visibility 0.5s; }
#pre .pre-mark { font-family: var(--font-display); font-size: 24px; color: var(--indigo); font-weight: 500; }
#pre.done { opacity: 0; visibility: hidden; }
.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--indigo); z-index: 300; width: 0%; }
