/* Layout: one editorial column; a full-bleed loom band of six coloured threads; the work as a ledger that re-sorts when a thread is pulled. */
:root {
  --paper: #eef0ea; --surface: #e3e7df; --ink: #16181f; --muted: #545a68; --rule: #c9cec4;
  --t-action: #b8402c; --t-decisions: #2f4fa8; --t-perception: #9a6a00; --t-learning: #2b7a57; --t-work: #7445a0; --t-culture: #0c7480;
  --active: var(--ink);
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --measure: 62ch;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #111318; --surface: #191c23; --ink: #e8eae3; --muted: #9ba1ad; --rule: #2b2f38;
  --t-action: #f0765f; --t-decisions: #8099f2; --t-perception: #e3b13c; --t-learning: #5cc18f; --t-work: #b68ce2; --t-culture: #3fc2cc;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #111318; --surface: #191c23; --ink: #e8eae3; --muted: #9ba1ad; --rule: #2b2f38;
  --t-action: #f0765f; --t-decisions: #8099f2; --t-perception: #e3b13c; --t-learning: #5cc18f; --t-work: #b68ce2; --t-culture: #3fc2cc;
  color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { top: 12px; }
.wrap { max-width: 1120px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

[data-t="action"] { --c: var(--t-action); } [data-t="decisions"] { --c: var(--t-decisions); }
[data-t="perception"] { --c: var(--t-perception); } [data-t="learning"] { --c: var(--t-learning); }
[data-t="work"] { --c: var(--t-work); } [data-t="culture"] { --c: var(--t-culture); }

/* Masthead */
.masthead-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-block: 20px; }
.mark { font: 500 0.875rem/1 var(--f-mono); text-decoration: none; letter-spacing: 0.02em; }
.masthead nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font: 500 0.8125rem/1.4 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.masthead nav a { text-decoration: none; color: var(--muted); }
.masthead nav a:hover { color: var(--ink); }

/* Hero */
.hero { padding-block: clamp(32px, 8vw, 96px) 24px; }
.eyebrow, .label, .meta, .gauge { font: 500 0.75rem/1.5 var(--f-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0; }
h1 { font: 800 clamp(3.25rem, 12vw, 8.5rem)/0.88 var(--f-display); font-variation-settings: "opsz" 96; letter-spacing: -0.045em; margin: 16px 0 0; text-wrap: balance; }
.tagline { font: italic 400 clamp(1.5rem, 3.6vw, 2.5rem)/1.15 var(--f-body); margin: 12px 0 0; color: var(--active); transition: color .5s; }
.lede { max-width: var(--measure); font-size: clamp(1.0625rem, 1.5vw, 1.2rem); margin: 28px 0 0; }

/* Loom */
.loom-band { border-block: 1px solid var(--rule); background: var(--surface); }
.loom-band .wrap { padding-block: 24px 28px; }
.loom-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.loom-frame { position: relative; margin-top: 8px; }
#loom { display: block; width: 100%; height: clamp(168px, 26vw, 256px); touch-action: none; cursor: grab; overflow: visible; }
#loom:active { cursor: grabbing; }
.thread { fill: none; stroke: var(--c); stroke-width: 2.25; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: opacity .4s, stroke-width .3s; }
.thread.is-dim { opacity: 0.22; }
.thread.is-hot { stroke-width: 4; }
.thread.is-taut { stroke-width: 3.5; }
.gauge { position: absolute; right: 0; bottom: -4px; font-size: 0.6875rem; font-variant-numeric: tabular-nums; }
.gauge output { color: var(--ink); }
.threads { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); color: var(--ink); font: 500 0.875rem/1 var(--f-mono); cursor: pointer; transition: border-color .2s, background .2s; }
.chip:hover { border-color: var(--c); }
.chip[aria-pressed="true"] { border-color: var(--c); background: var(--c); color: var(--paper); }
.chip[aria-pressed="true"] .knot { background: var(--paper); }
.thread-note { max-width: var(--measure); margin: 14px 0 0; color: var(--muted); font-size: 0.975rem; min-height: 3.2em; }
.ghost { background: none; border: 1px solid var(--rule); color: var(--ink); border-radius: 999px; padding: 6px 14px; min-height: 36px; font: 500 0.75rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; }
.ghost:hover { border-color: var(--ink); }
.ghost[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Sections */
.block { padding-block: clamp(40px, 7vw, 80px) 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.section-head h2 { font: 600 clamp(1.5rem, 3vw, 2rem)/1.1 var(--f-display); letter-spacing: -0.02em; margin: 0; }
.section-head .ghost { margin-left: auto; }

/* Ledger */
.knot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; transition: transform .3s; }
.ledger { list-style: none; margin: 0; padding: 0; }
.work-item { border-bottom: 1px solid var(--rule); transition: opacity .4s; }
.work-link { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: baseline; gap: 4px 16px; padding: 16px 8px; text-decoration: none; }
.work-link:hover { background: var(--surface); }
.knots { display: flex; gap: 5px; align-self: center; }
.work-body { display: flex; flex-direction: column; min-width: 0; }
.work-title { font: 600 clamp(1.15rem, 2.3vw, 1.55rem)/1.2 var(--f-display); letter-spacing: -0.015em; }
.work-link:hover .work-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.work-sub { color: var(--muted); font-size: 0.975rem; margin-top: 2px; }
.work-path { font: 400 0.8125rem/1.4 var(--f-mono); color: var(--muted); }
.ledger.is-pulled .work-item.slack { opacity: 0.36; }
.ledger.is-pulled .work-item.on .knot.match { transform: scale(1.5); }
.more { margin: 20px 0 0; font: 500 0.875rem/1.5 var(--f-mono); }

/* Writing */
.links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); column-gap: 32px; }
.links li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.links a { font-size: 1.0625rem; min-width: 0; }
.links span { font: 400 0.75rem/1.4 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; flex: none; }

/* Studio */
.studio { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 32px; padding-top: 20px; }
.studio-item h3 { font: 600 1.25rem/1.25 var(--f-display); margin: 0; }
.studio-item p { margin: 8px 0 12px; max-width: var(--measure); }
.cta { font: 500 0.875rem/1.4 var(--f-mono); }

/* Contact */
.contact { padding-top: 20px; }
.email { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
#email-text { font: 600 clamp(1.4rem, 4.5vw, 2.6rem)/1.1 var(--f-display); letter-spacing: -0.02em; overflow-wrap: anywhere; user-select: all; }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 16px 0 0; font: 500 0.875rem/1.5 var(--f-mono); }

/* Footer */
.foot { margin-top: clamp(56px, 9vw, 112px); border-top: 1px solid var(--rule); }
.foot-inner { padding-block: 24px 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; color: var(--muted); font-size: 0.875rem; }
.foot-inner p { margin: 0; }

/* Entrance */
.entrance { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--paper); padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); transition: opacity .45s ease; }
.entrance.out { opacity: 0; pointer-events: none; }
.entrance-inner { width: min(560px, 100%); text-align: center; }
.entrance svg { width: 100%; height: 56px; overflow: visible; }
.entrance path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.6s cubic-bezier(.6,.05,.3,1) forwards; }
.entrance path:nth-child(2) { animation-delay: .25s; } .entrance path:nth-child(3) { animation-delay: .5s; }
.entrance p { font: 500 0.875rem/1.5 var(--f-mono); letter-spacing: 0.06em; margin: 20px 0 0; opacity: 0; animation: rise .8s .9s ease forwards; }
.entrance-skip { margin-top: 28px; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { to { opacity: 1; } }
html.is-entering { overflow: hidden; }

@media (max-width: 640px) {
  .work-link { grid-template-columns: 34px minmax(0, 1fr); padding-inline: 4px; }
  .work-path { grid-column: 2; }
  .gauge { position: static; text-align: right; margin-top: 4px; }
}
