/* Karukrit Designs. Values follow docs/KARUKRIT_WEBSITE_SPEC.md; section numbers in comments point there. */

/* 3.3 Satoshi (Light, Regular, Medium) is self-hosted from assets/fonts/ and declared in fonts.css. Licence: docs/Satoshi-Fontshare-licence.txt */

:root {
  /* 3.2 main palette */
  --moss: #30321F; --orange: #8B4729; --gold: #BB8D3F; --sage: #818865; --taupe: #CBC7C2;
  /* 3.2 supporting tones */
  --ink: #23261A; --ink-2: #3A3D28; --taupe-dark: #B3AEA8; --taupe-light: #DEDAD6;
  --cream: #EFE8DC; --cream-warm: #F3ECE2; --cream-muted: #D9CFBF; --gold-light: #DDB86E; --gold-pale: #F0DDB5; --moss-deep: #1D1F13;
  --taupe-rgb: 203 199 194;   /* the light surface, for the frosted bar and glass */
  --paper: #EFE8DC; --grass: #6F7752; /* the 3D scene: the drawing paper and the lawn it becomes */
  /* soft layered shadows: a close contact shadow, a mid shadow and a wide, faint one */
  --shadow-1: 0 1px 2px rgba(20,22,12,.10), 0 4px 10px rgba(20,22,12,.10), 0 14px 30px rgba(20,22,12,.12);
  --shadow-2: 0 2px 4px rgba(20,22,12,.10), 0 12px 28px rgba(20,22,12,.16), 0 34px 70px rgba(20,22,12,.20);
  --font: "Satoshi", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
  --side: 64px;
  --focus: var(--orange);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--taupe); }
body { margin: 0; background-color: var(--taupe); color: var(--ink); font-family: var(--font); font-weight: 300; font-size: 17px; line-height: 1.75; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; font-weight: 300; }
b, strong { font-weight: 400; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[data-cursor="light"] { --focus: var(--gold-light); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 300; background-color: var(--moss); color: var(--cream); padding: 12px 18px; }
.skip-link:focus { top: 16px; }

/* 3.4 silk suede on every coloured surface: a fine nap that repeats, under one broad soft sheen that does not */
.tx { background-image: linear-gradient(118deg, rgba(255,250,240,0) 18%, rgba(255,250,240,.07) 42%, rgba(255,250,240,.02) 58%, rgba(0,0,0,.05) 82%), url("../texture/silk.png");
  background-size: 100% 100%, 1024px 1024px; background-repeat: no-repeat, repeat; }
.s-taupe { background-color: var(--taupe); color: var(--ink); }
.s-moss { background-color: var(--moss); color: var(--cream); }
.s-orange { background-color: var(--orange); color: var(--cream-warm); }
.s-gold { background-color: var(--gold); color: var(--ink); }

/* 3.3 type scale */
.h1 { font-size: clamp(52px, 5.3vw, 76px); line-height: 1.1; font-weight: 300; text-wrap: balance; }
.h2 { font-size: 40px; line-height: 1.2; font-weight: 300; text-wrap: balance; }
.body { font-size: 17px; line-height: 1.75; max-width: 65ch; }
.small { font-size: 15px; line-height: 1.7; }
.cap { font-size: 11px; font-weight: 500; line-height: 1.4; letter-spacing: .28em; text-transform: uppercase; }
.s-taupe .hl, .s-gold .hl { color: var(--moss); font-weight: 400; }
.s-moss .hl { color: var(--gold-light); font-weight: 400; }
.glass .hl { color: var(--moss); }
.s-moss .cap-gold { color: var(--gold-light); }
.s-orange .cap-gold { color: var(--gold-pale); }
.muted { color: var(--ink-2); }
.s-moss .muted { color: var(--cream-muted); }

/* 4 layout */
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding-left: var(--side); padding-right: var(--side); }
.g12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.ch { position: relative; min-height: max(100vh, 760px); }
.stack { display: flex; flex-direction: column; }

/* 5.5 buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 16px 26px; border-radius: 999px; font-size: 11px; font-weight: 500; letter-spacing: .28em; text-transform: uppercase; line-height: 1.2; transition: filter .3s ease, transform .35s var(--ease), box-shadow .35s var(--ease); position: relative; box-shadow: var(--shadow-1); }
.btn:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn-orange { background-color: var(--orange); color: var(--cream-warm); }
.btn-gold { background-color: var(--gold); color: var(--ink); }
.btn-line { padding: 15px 22px; border: 1px solid currentColor; box-shadow: none; }
.btn-line:hover { box-shadow: none; }
.btn-line:hover { filter: none; background-color: rgba(239,232,220,.08); }
.link-cap { display: inline-flex; align-items: center; min-height: 44px; position: relative; }
.underline { border-bottom: 1px solid var(--orange); padding-bottom: 4px; }

/* 5.3 sketched circle */
.ringable { position: relative; }
svg.kd-ring { position: absolute; left: -10px; top: -8px; width: calc(100% + 20px); height: calc(100% + 16px); pointer-events: none; overflow: visible; }

/* 5.2 pencil cursor */
html { cursor: url("../cursor/pencil-cursor-dark.svg") 3 29, auto; }
[data-cursor="light"] { cursor: url("../cursor/pencil-cursor-light.svg") 3 29, auto; }
html.kd-cursor-on, html.kd-cursor-on * { cursor: none !important; }
.kd-cursor { position: fixed; left: 0; top: 0; width: 32px; height: 32px; z-index: 1000; pointer-events: none; display: none; }
html.kd-cursor-on .kd-cursor { display: block; }
.kd-cursor img { width: 32px; height: 32px; position: absolute; inset: 0; transform-origin: 3px 29px; transition: transform .15s ease; }
.kd-cursor .light { display: none; }
.kd-cursor.on-dark .light { display: block; }
.kd-cursor.on-dark .dark { display: none; }
.kd-cursor.hot img { transform: rotate(-12deg) scale(1.08); }
.kd-cursor.down img { transform: scale(.94); transition-duration: .1s; }
.kd-cursor.hidden { visibility: hidden; }

/* 5.4 monochrome to colour */
.mono { filter: grayscale(1) contrast(.9); transition: filter .6s ease, transform .6s ease; }
.mono-host:hover .mono, .mono-host:focus-visible .mono, .mono.is-colour { filter: none; transform: translateY(-4px); }

/* placeholder blocks until the studio's images arrive */
.ph { display: flex; align-items: flex-end; padding: 14px 16px; background-color: var(--taupe-dark); color: var(--ink); }
.ph .cap { opacity: .9; }
.ph-dark { background-color: rgba(239,232,220,.08); border: 1px solid rgba(239,232,220,.25); color: var(--cream-muted); }

/* 4 reveal on scroll */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }

/* 5.1 logo loader, first visit only */
.loader { position: fixed; inset: 0; z-index: 500; display: none; align-items: center; justify-content: center; background-color: var(--moss); transition: opacity .9s ease, visibility .9s; }
html.kd-intro .loader { display: flex; }
.loader .logo-anim, .loader .logo-last { width: min(39vw, 550px, calc(39vh * 1600 / 880)); aspect-ratio: 1600 / 880; height: auto; }
.loader .logo-last { position: absolute; opacity: 0; transition: opacity .6s ease; }
.loader.still .logo-last { opacity: 1; }
.loader.still .logo-anim { visibility: hidden; }
.loader video { position: absolute; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.hero.opened.dragging, .hero.opened.dragging * { user-select: none; }
.loader.out { opacity: 0; visibility: hidden; }
html.kd-intro .hero-fade { opacity: 0; }
html.kd-intro.kd-intro-out .hero-fade { opacity: 1; transition: opacity .9s ease; }

/* 4 slim header after chapter I, and on every other page */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: calc(64px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); background-color: rgb(var(--taupe-rgb) / .85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transform: translateY(-100%); transition: transform .5s var(--ease); }
.topbar.show, .topbar.always { transform: none; }
.topbar .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { display: block; width: 230px; }
.wordmark img { width: 100%; height: auto; }
.menu { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.menu a { display: inline-flex; align-items: center; min-height: 44px; }
.menu-btn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 7px; }
.menu-btn i { display: block; width: 26px; height: 1px; background: currentColor; }

/* 14 phone menu */
.mobile-menu { position: fixed; inset: 0; z-index: 200; padding: calc(24px + env(safe-area-inset-top, 0px)) 20px 40px; display: flex; flex-direction: column; gap: 40px; transform: translateY(-100%); transition: transform .6s var(--ease); visibility: hidden; }
.mobile-menu.open { transform: none; visibility: visible; }
.mobile-menu .row { display: flex; justify-content: space-between; align-items: center; }
.mobile-menu .wordmark { width: 160px; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.mobile-menu ul a { display: inline-block; font-size: 28px; line-height: 1.4; font-weight: 300; padding: 4px 0; }

/* 4 chapter indicator */
.indicator { position: fixed; right: 32px; top: 50%; transform: translateY(-50%); z-index: 50; color: var(--ink); transition: color .4s ease; }
.indicator.on-dark { color: var(--cream); }
.indicator > button { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 10px 8px; min-width: 44px; }
.indicator .line { width: 1px; height: 26px; background: currentColor; opacity: .35; }
.indicator .last { opacity: .65; }
.indicator ol { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); list-style: none; margin: 0; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; white-space: nowrap; background-color: var(--taupe); color: var(--ink); }
.indicator ol[hidden] { display: none; }
.indicator ol a { display: flex; gap: 14px; align-items: center; min-height: 36px; padding: 0 4px; }
.indicator ol a span:first-child { width: 22px; }

/* 6 chapter I: frosted glass */
.hero-scroll { position: relative; height: 420vh; }
.hero { position: sticky; top: 0; overflow: hidden; height: 100vh; height: 100svh; min-height: 0; }
.build-anchor { position: absolute; top: 130vh; left: 0; width: 1px; height: 1px; }
#house { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: var(--scene, 0); }
.glowsets { opacity: var(--glow, 1); }
.glowsets { position: absolute; inset: 0; }
.glowset { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.glowset.on { opacity: 1; }
.glowset i { position: absolute; border-radius: 50%; filter: blur(60px); }
.glowset img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(60px); transform: scale(1.1); }
/* the glass content stays put; only its pane (the frosted surface) shrinks into a card as Chapter I scrolls */
.glass { position: absolute; top: 64px; bottom: 56px; left: 72px; right: 72px; padding: 36px 56px 44px; display: flex; flex-direction: column; color: var(--ink); --focus: var(--orange); transform-origin: var(--card-x, 80%) var(--card-y, 80%); }
.glass > :not(.pane) { position: relative; z-index: 1; }
.pane { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 24px; border: 1px solid rgba(255,255,255,.3); background-color: rgb(var(--taupe-rgb) / .62); backdrop-filter: blur(36px) saturate(1.05); -webkit-backdrop-filter: blur(36px) saturate(1.05); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .pane { background-color: rgb(var(--taupe-rgb) / .92); } }
.fades { opacity: var(--fade, 1); }
.hero.opened .fades { pointer-events: none; visibility: hidden; }
.build-stages { display: flex; gap: 14px; align-items: center; opacity: var(--stg, 0); margin-block: -8px; }
.build-stages span { opacity: .5; transition: opacity .5s ease, color .5s ease; }
.build-stages span.on { opacity: 1; color: var(--ink); }
.build-stages i { width: 18px; height: 1px; background: currentColor; opacity: .35; }
.hero:not(.opened) .build-stages { visibility: hidden; }
.glass-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.glass-body { flex: 1; min-height: 0; align-items: center; }
.sketch-col { grid-column: 1 / span 7; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.sketches { position: relative; width: 100%; aspect-ratio: 640 / 470; max-height: calc(100vh - 330px); max-height: calc(100svh - 330px); }
.sketches img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: left center; opacity: 0; transition: opacity 1.2s ease; }
.sketches img.on { opacity: 1; }
.sketch-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dots { display: flex; gap: 0; align-items: center; }
.dots button { height: 24px; padding: 0 4px; display: inline-flex; align-items: center; }
.dots button::before { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); opacity: .4; transition: width .4s ease, opacity .4s ease, background-color .4s ease; }
.dots button[aria-current="true"]::before { width: 22px; border-radius: 3px; background-color: var(--orange); opacity: 1; }
.hero-text { grid-column: 9 / span 4; align-self: end; display: flex; flex-direction: column; gap: 26px; }
.hero-text .h1 { font-size: 52px; }
.hero-text .btn { align-self: flex-start; }

/* 7.1 the architect */
.arch { display: grid; grid-template-columns: 1fr 1fr; }
.arch .portrait { min-height: 100%; }
.arch-text { padding: 100px 80px; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.arch-text .h1 { font-size: 52px; }
.book-card { display: flex; gap: 20px; align-items: center; padding: 24px 28px; align-self: flex-start; max-width: 460px; }
.book-card img { width: 70px; height: 96px; object-fit: cover; flex: none; }
.book-card .t { font-size: 20px; line-height: 1.35; color: var(--cream); }

/* 7.2 the author */
.author { padding-block: 64px; display: flex; flex-direction: column; justify-content: center; gap: 40px; }
.author-left { grid-column: 1 / span 4; align-self: center; display: flex; flex-direction: column; gap: 20px; }
.author-left .cover { width: 128px; box-shadow: 0 14px 30px rgba(0,0,0,.35); }
/* the book as an object: it turns as the chapter scrolls and leans toward the cursor; hover lifts the cover */
.book-wrap { perspective: 1200px; padding: 8px 0 12px 8px; align-self: flex-start; }
.book3d { --w: 230px; --h: 359px; --t: 30px; --rx: -6deg; --ry: -26deg; --open: 0deg; position: relative; display: block; width: var(--w); height: var(--h); transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .3s ease-out; }
.book3d > span { position: absolute; top: 0; height: 100%; display: block; }
.book3d img, .book3d picture { width: 100%; height: 100%; object-fit: cover; display: block; }
.book3d .b-cover, .book3d .b-inside, .book3d .b-back { left: 0; width: var(--w); }
.book3d .b-spine, .book3d .b-pages { left: calc((var(--w) - var(--t)) / 2); width: var(--t); }
.book3d .b-cover { transform-origin: left center; transform: translateZ(calc(var(--t) / 2)) rotateY(calc(var(--open) * -1)); transition: transform .9s cubic-bezier(.6,.05,.25,1); overflow: hidden; box-shadow: inset 4px 0 0 rgba(0,0,0,.12); }
.book3d .b-inside { transform: translateZ(calc(var(--t) / 2 - 1px)); overflow: hidden; background: var(--cream); }
.book3d .b-back { background: #7A8459 url("../book/book-cover-back.jpg") center / cover; transform: rotateY(180deg) translateZ(calc(var(--t) / 2)); box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.book3d .b-spine { background: #7A8459 url("../book/book-spine.jpg") center / 100% 100%; transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); }
.book3d .b-pages { background: repeating-linear-gradient(90deg, #EFE8DC 0 2px, #D9CFBF 2px 3px); transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - 3px)); top: 3px; height: calc(100% - 6px); }
.book3d:hover, .book3d:focus-visible { --open: 28deg; }
.author-left .title { font-size: 34px; line-height: 1.2; }
.author-left .line { font-size: 15px; line-height: 1.7; color: var(--cream-muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.author-right { grid-column: 6 / span 7; min-width: 0; }
.handbooks { border-top: 1px solid rgba(239,232,220,.25); padding-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.handbook { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.handbook .pg { width: 128px; aspect-ratio: 640 / 449; object-fit: cover; }
.handbook .pg.cover { box-shadow: 0 8px 18px rgba(0,0,0,.3); }
.handbook .meta { display: flex; flex-direction: column; gap: 4px; margin-left: 10px; }
.handbook .name { font-size: 18px; line-height: 1.4; }
.handbook .sub { font-size: 13px; line-height: 1.5; color: var(--cream-muted); }

/* 7.2 spread viewer */
.viewer { display: flex; flex-direction: column; gap: 18px; }
.spread { position: relative; display: flex; justify-content: center; height: 440px; perspective: 2200px; touch-action: pan-y; }
.spread-inner { position: relative; display: flex; height: 100%; box-shadow: 0 18px 40px rgba(0,0,0,.35); transform-style: preserve-3d; }
.spread .page { height: 100%; width: auto; background: var(--cream); }
.spread .page img { height: 100%; width: auto; }
.spread.two .page + .page { border-left: 1px solid #CFC6B6; }
.spread .single img { max-width: 100%; object-fit: contain; }
.leaf { position: absolute; top: 0; height: 100%; transform-style: preserve-3d; transform-origin: left center; transition: transform .7s cubic-bezier(.55,.05,.3,1); visibility: hidden; }
.leaf.turning { visibility: visible; }
.leaf > div { position: absolute; inset: 0; backface-visibility: hidden; background: var(--cream); }
.leaf > div img { height: 100%; width: 100%; object-fit: cover; }
.leaf .back { transform: rotateY(180deg); }
.spread .fade { transition: opacity .5s ease; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.viewer-bar .cap { color: var(--cream-muted); min-width: 0; }
.viewer-nav { display: flex; align-items: center; gap: 16px; flex: none; font-variant-numeric: tabular-nums; }
.circle-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(239,232,220,.4); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.circle-btn:hover { background-color: rgba(239,232,220,.08); }

/* full-screen viewer and lightbox */
dialog.full { width: 100vw; height: 100vh; height: 100svh; max-width: none; max-height: none; margin: 0; border: 0; padding: 24px var(--side); background-color: var(--moss); color: var(--cream); }
dialog.full::backdrop { background: rgba(42,45,27,.6); }
dialog.full[open] { display: flex; flex-direction: column; gap: 18px; }
.full-top { display: flex; justify-content: space-between; align-items: center; }
.full .viewer { flex: 1; min-height: 0; }
.full .viewer { justify-content: center; }
.full .spread { height: calc(100vh - 170px); height: calc(100svh - 170px); }
.lightbox-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.lightbox-stage > * { max-width: 100%; max-height: 100%; }
.lightbox-stage .ph { width: min(1100px, 100%); aspect-ratio: 16 / 10; }

/* 8 the studio */
.team { padding-block: 80px; display: flex; flex-direction: column; gap: 44px; }
.team-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 48px; flex-wrap: wrap; }
.team-head .rule { display: block; width: 56px; height: 3px; background-color: var(--orange); margin-top: 14px; }
.team-head p { max-width: 420px; }
.team-grid { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; list-style: none; margin: 0 auto; padding-block: 0; }
.member { display: flex; flex-direction: column; gap: 12px; }
.member { perspective: 900px; }
.member .frame { flex: 1; min-height: 360px; background: rgba(35,38,26,.12); border: 1px solid rgba(35,38,26,.25); display: flex; position: relative; }
/* portraits lean toward the cursor, with a soft light following it */
.tilt { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform .5s var(--ease); }
.member:hover .tilt { transition-duration: .15s; }
.tilt::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--mx) var(--my), rgba(255,246,230,.32), rgba(255,246,230,0) 55%); opacity: 0; transition: opacity .4s ease; }
.member:hover .tilt::after { opacity: 1; }
.member .frame > * { flex: 1; }
.member .name { font-size: 18px; line-height: 1.4; }

/* 9 philosophy */
.philosophy { position: relative; }
/* one plan drawing sits behind all three screens, draws itself and moves slower than the words */
.philo-back { position: absolute; inset: 0; pointer-events: none; }
.philo-draw { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; color: var(--ink); opacity: .13; }
.philo-draw svg { position: absolute; inset: -10%; width: 120%; height: 120%; will-change: transform; }
.philo-draw svg * { stroke-dasharray: 1; stroke-dashoffset: var(--draw, 1); }
.thought { position: relative; z-index: 1; }
.philosophy::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 14px; background-color: var(--gold); background-image: url("../texture/silk.png"); background-size: 1024px 1024px; }
.thought { display: flex; flex-direction: column; justify-content: center; gap: 30px; padding: 0 160px; }
.thought > * { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.thought.in > * { opacity: 1; transform: none; }
.thought.in > :nth-child(2) { transition-delay: .08s; }
.thought.in > :nth-child(3) { transition-delay: .16s; }
.thought.in > :nth-child(4) { transition-delay: .24s; }
.thought .h1 { font-size: 76px; max-width: 1000px; }
.thought .body { max-width: 560px; color: var(--ink-2); }
.bars { display: flex; gap: 10px; margin-top: 20px; }
.bars i { width: 40px; height: 3px; background-color: var(--taupe-dark); }
.bars i.on { background-color: var(--orange); }

/* 10 work */
.work { padding-block: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.work-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px 40px; flex-wrap: wrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px 30px; align-items: center; list-style: none; margin: 0; padding: 0; }
.tabs a, .tabs button { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { background-color: var(--moss); color: var(--cream); background-image: url("../texture/silk.png"); background-size: 1024px 1024px; }
.rows { display: flex; flex-direction: column; gap: 28px; transition: opacity .25s ease; }
.rows.fading { opacity: 0; }
.marq { overflow: hidden; width: 100%; }
.track { display: flex; gap: 24px; padding-right: 24px; width: max-content; animation: kdflow var(--dur, 48s) linear infinite; }
.track.row2 { animation-delay: calc(var(--dur, 48s) / -2); }
.marq:hover .track, .marq.held .track { animation-play-state: paused; }
/* the curved gallery wall: when script runs, the rows bend into a gentle concave wall and keep flowing left */
.marq.curved { overflow: visible; perspective: 1100px; cursor: grab; touch-action: pan-y; user-select: none; }
.marq.curved.dragging { cursor: grabbing; }
.marq.curved .track { animation: none; position: relative; width: 100%; height: 262px; padding: 0; transform-style: preserve-3d; }
.marq.curved .tile { position: absolute; left: 50%; top: 0; margin-left: -150px; transform-style: preserve-3d; will-change: transform; }
.marq.curved .tile .img { transition: filter .6s ease, transform .6s var(--ease); }
.marq.curved .tile:hover .img, .marq.curved .tile:focus-visible .img { transform: translateZ(60px) translateY(-4px); }
.work { overflow: hidden; }
@keyframes kdflow { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tile { width: 300px; flex: none; display: flex; flex-direction: column; gap: 9px; }
.tile .img { height: 200px; }
.tile .img > * { width: 100%; height: 100%; object-fit: cover; }
.tile .nm { font-size: 15px; line-height: 1.4; }
.status { display: flex; gap: 8px; align-items: center; }
.status i { width: 7px; height: 7px; border-radius: 50%; background-color: var(--orange); flex: none; }
.work-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* 13 contact */
.contact { display: flex; flex-direction: column; justify-content: center; gap: 34px; padding: 0 160px 60px; overflow: hidden; }
.contact .h1 { font-size: 72px; }
.contact-cols { display: flex; gap: 32px 80px; flex-wrap: wrap; font-size: 18px; line-height: 1.8; }
.contact-cols > div { display: flex; flex-direction: column; }
.contact-cols .cap { margin-bottom: 8px; }
.contact .btn { align-self: flex-start; }
.stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; display: flex; }
.stripe i:nth-child(1) { background: #5B2525; width: 120px; }
.stripe i:nth-child(2) { background: #295B28; width: 120px; }
.stripe i:nth-child(3) { background: #24305A; width: 120px; }
.stripe i:nth-child(4) { background: #5A5A5A; flex: 1; }
.form-panel { position: absolute; inset: 0 0 10px; z-index: 5; overflow-y: auto; padding: 104px 160px 56px; transform: translateY(100%); visibility: hidden; transition: transform .6s var(--ease), visibility .6s; color: var(--ink); --focus: var(--orange); }
.form-panel.open { transform: none; visibility: visible; }
.form-panel .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 48px; max-width: 980px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea { font: inherit; font-size: 17px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 8px 0; min-height: 44px; appearance: none; }
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 12px) 55%, calc(100% - 7px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field textarea { resize: vertical; min-height: 96px; }
.field .err { color: var(--ink); font-size: 13px; line-height: 1.4; min-height: 18px; }
.field.bad input, .field.bad select { border-bottom-width: 2px; }
.form-actions { display: flex; align-items: center; gap: 24px; margin-top: 36px; flex-wrap: wrap; }
.thanks { font-size: 28px; line-height: 1.3; max-width: 560px; }

/* 10 category page, 11 and 12 project pages */
.page-top { padding-top: calc(64px + env(safe-area-inset-top, 0px)); }
.cat { padding-block: 56px 96px; display: flex; flex-direction: column; gap: 32px; min-height: 100vh; }
.chips { display: flex; gap: 8px 22px; flex-wrap: wrap; }
.chips button { min-height: 44px; padding: 8px 14px; }
.chips button[aria-pressed="true"] { background-color: var(--moss); color: var(--cream); background-image: url("../texture/silk.png"); background-size: 1024px 1024px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; list-style: none; margin: 0; padding: 0; }
.cat-grid .tile { width: auto; }
.cat-grid .tile .img { height: auto; aspect-ratio: 4 / 3; }
.cat-grid li[hidden] { display: none; }
.p-hero { height: 520px; }
.p-hero > * { width: 100%; height: 100%; object-fit: cover; }
.p-info { padding-block: 48px; }
.p-info .name-col { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: 14px; }
.p-info .brief { grid-column: 6 / span 4; }
.p-info nav { grid-column: 10 / span 3; display: flex; flex-direction: column; gap: 4px; }
.p-info nav a { min-height: 36px; display: inline-flex; align-items: center; align-self: flex-start; }
.gallery-sec { padding-block: 72px 24px; display: flex; flex-direction: column; gap: 28px; }
.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.gallery .full-w { grid-column: span 12; }
.gallery .half { grid-column: span 6; }
.gallery button { display: block; width: 100%; aspect-ratio: 3 / 2; }
.gallery .full-w button { aspect-ratio: 21 / 9; }
.gallery button > * { width: 100%; height: 100%; object-fit: cover; }
.facts { border-collapse: collapse; min-width: 320px; }
.facts th, .facts td { text-align: left; padding: 12px 32px 12px 0; border-bottom: 1px solid var(--taupe-light); font-size: 15px; vertical-align: top; }
.facts th { font-weight: 500; font-size: 11px; letter-spacing: .28em; text-transform: uppercase; }
.next { padding-block: 72px 96px; position: relative; }
.next a { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: center; }
.next .img { aspect-ratio: 3 / 2; }
.next .img > * { width: 100%; height: 100%; object-fit: cover; }
.ongoing { padding-block: 64px; display: flex; flex-direction: column; gap: 32px; }
.p-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.stages li { padding: 16px; font-size: 13px; line-height: 1.4; }
.stages .done { background-color: var(--moss); color: var(--cream); }
.stages .now { background-color: var(--orange); color: var(--cream-warm); font-weight: 500; }
.stages .later { background-color: var(--taupe-dark); color: var(--ink); }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.photo-grid figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.photo-grid .wide { grid-column: span 2; }
.photo-grid button { display: block; width: 100%; aspect-ratio: 4 / 3; }
.photo-grid .wide button { aspect-ratio: auto; height: 100%; min-height: 260px; }
.photo-grid button > * { width: 100%; height: 100%; object-fit: cover; }
.archive { display: flex; flex-direction: column; gap: 28px; }
.archive h3 { margin-bottom: 12px; }
.foot { position: relative; padding-block: 48px 58px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* 14 tablet */
@media (max-width: 1199px) {
  :root { --side: 40px; }
  .g12 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .ch { min-height: 100vh; }
  .h1 { font-size: 56px; }
  .glass { left: 40px; right: 40px; padding: 30px 36px 36px; }
  .hero-scroll { height: 380vh; }
  .sketch-col { grid-column: 1 / span 5; }
  .hero-text { grid-column: 6 / span 3; }
  .hero-text .h1 { font-size: 40px; }
  .menu { gap: 20px; }
  .author-left { grid-column: 1 / span 3; }
  .author-right { grid-column: 4 / span 5; }
  .thought { padding: 0 96px; }
  .thought .h1 { font-size: 56px; }
  .contact { padding: 0 96px 60px; }
  .contact .h1 { font-size: 56px; }
  .form-panel { padding: 96px 96px 48px; }
  .p-info .name-col { grid-column: 1 / span 4; }
  .p-info .brief { grid-column: 5 / span 4; }
  .p-info nav { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 4px 24px; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .indicator { right: 16px; }
}

/* 14 phones */
@media (max-width: 767px) {
  :root { --side: 20px; }
  body { font-size: 16px; }
  .g12 { grid-template-columns: minmax(0, 1fr); }
  .g12 > * { grid-column: 1 / -1 !important; }
  .ch { min-height: 0; }
  .h1, .hero-text .h1, .arch-text .h1, .thought .h1, .contact .h1 { font-size: 36px; }
  .h2 { font-size: 28px; }
  .body { font-size: 16px; }
  .wordmark { width: 160px; }
  .menu { display: none; }
  .menu-btn { display: inline-flex; }
  .indicator { display: none; }
  .glass { inset: 16px; padding: 22px 20px 26px; }
  .glass-body { display: flex; flex-direction: column; align-items: stretch; gap: 20px; padding-top: 16px; }
  .sketch-col { flex: 1; min-height: 0; }
  .sketches { flex: 1; min-height: 0; aspect-ratio: auto; max-height: none; }
  .sketches img { object-position: center; }
  .marq.curved .track { height: 214px; }
  .marq.curved .tile { margin-left: -110px; }
  .book3d { --w: 170px; --h: 265px; --t: 24px; }
  .hero-text { gap: 20px; }
  .dots button { height: 44px; }
  .arch { grid-template-columns: 1fr; }
  .arch .portrait { min-height: 60vh; min-height: 60svh; }
  .arch-text { padding: 48px 20px 64px; }
  .author { padding-block: 64px; }
  .author-left .title { font-size: 28px; }
  .spread { height: auto; }
  .spread .page img { height: auto; width: 100%; max-height: 70svh; object-fit: contain; }
  .handbooks { grid-template-columns: 1fr; }
  .handbook .pg { width: calc(33.33% - 10px); }
  .handbook .meta { margin-left: 0; width: 100%; }
  .team { padding-block: 64px; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .member .frame { min-height: 220px; }
  .thought { padding: 96px 28px 96px 20px; min-height: 80svh; }
  .tile { width: 220px; }
  .tile .img { height: 150px; }
  .contact { padding: 96px 20px 80px; min-height: 100svh; }
  .form-panel { padding: 88px 20px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
  .p-hero { height: 56svh; }
  .gallery .half { grid-column: span 12; }
  .stages { grid-template-columns: 1fr; gap: 6px; }
  .stages li { border-left: 3px solid var(--bar); background: none !important; color: var(--ink) !important; padding: 10px 14px; }
  .stages .done { --bar: var(--moss); }
  .stages .now { --bar: var(--orange); }
  .stages .later { --bar: var(--taupe-dark); }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .next a { grid-template-columns: 1fr; }
  dialog.full { padding: 16px 20px; }
}

/* 15 reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rv, .thought > * { opacity: 1 !important; transform: none !important; transition: none !important; }
  .track { animation: none; }
  .hero-scroll { height: auto; }
  .hero { position: relative; }
  .tilt, .book3d, .book3d .b-cover { transition: none; }
  .marq { overflow-x: auto; }
  .sketches img, .glowset, .leaf, .rows, .form-panel, .mobile-menu, .topbar, .mono { transition: none !important; }
}

/* 11 completed project: scrolling walks you through the front door */
.walk { position: relative; height: 200vh; }
.walk-pin { position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); height: calc(100vh - 64px); height: calc(100svh - 64px - env(safe-area-inset-top, 0px)); overflow: hidden; }
.walk-in, .walk-out { position: absolute; inset: 0; }
.walk-in > *, .walk-out > :first-child { width: 100%; height: 100%; object-fit: cover; }
.walk-in > .ph, .walk-out > .ph { padding: 24px var(--side); }
.walk-in .ph { color: var(--cream); }
.walk-out { transform-origin: var(--door-x) var(--door-y); will-change: transform, opacity; }
.door { position: absolute; left: var(--door-x); top: calc(var(--door-y) - 16%); width: 7%; height: 32%; margin-left: -3.5%; background: rgba(35,38,26,.5); border: 1px solid rgba(35,38,26,.6); }
.walk-hint { position: absolute; right: var(--side); bottom: 28px; color: var(--ink); }

/* 12 ongoing project: the stage line fills up to today, and a drawing builds to match */
.stages.fill li { position: relative; overflow: hidden; }
.stages.fill li.done, .stages.fill li.now { background-color: var(--taupe-dark); color: var(--ink); transition: color .3s ease; transition-delay: calc(var(--i, 0) * .3s + .3s); }
.stages.fill li::before { content: ""; position: absolute; inset: 0; z-index: -1; transform: scaleX(0); transform-origin: left; transition: transform .6s cubic-bezier(.6,.05,.3,1); transition-delay: calc(var(--i, 0) * .3s); background-image: url("../texture/silk.png"); background-size: 1024px 1024px; }
.stages.fill li { z-index: 0; isolation: isolate; }
.stages.fill li.done::before { background-color: var(--moss); }
.stages.fill li.now::before { background-color: var(--orange); }
.stages.fill.in li.done { color: var(--cream); }
.stages.fill.in li.now { color: var(--cream-warm); }
.stages.fill.in li::before { transform: none; }
.progress-draw { margin: 0; display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.grow { width: 100%; height: auto; background-color: var(--cream); padding: 16px; }
.grow g { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.grow g path, .grow g circle { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s ease; }
.grow g.later path, .grow g.later circle { stroke-dasharray: .012 .012; stroke-dashoffset: 0; opacity: .35; transition: none; }
.grow.in g.built path, .grow.in g.built circle { stroke-dashoffset: 0; }

@media (max-width: 767px) {
  .stages.fill li.done, .stages.fill li.now { background-color: transparent; }
  .stages.fill li::before { display: none; }
  .stages.fill.in li.done, .stages.fill.in li.now { color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  .walk { height: 520px; }
  .walk-pin { position: relative; height: 520px; }
  .walk-in { display: none; }
  .walk-hint { display: none; }
  .stages.fill li::before, .grow g path, .grow g circle, .stages.fill li { transition: none !important; }
}

/* the home page ends with a contents page; each chapter is its own page */
.contents { padding-block: 120px 96px; }
.contents .wrap { display: flex; flex-direction: column; gap: 28px; }
.toc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--taupe-light); }
.toc li { border-bottom: 1px solid var(--taupe-light); }
.toc a { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr) 40px; align-items: baseline; gap: 8px 24px; padding: 28px 10px 26px; }
.toc a:hover { opacity: 1; }
.toc .t { font-size: 40px; line-height: 1.2; font-weight: 300; transition: transform .6s var(--ease); }
.toc .d { font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.toc .arr { font-size: 20px; transition: transform .6s var(--ease); }
.toc a:hover .t { transform: translateX(10px); color: var(--moss); }
.toc a:hover .arr { transform: translateX(8px); }
.toc svg.kd-ring { display: none; }
@media (max-width: 767px) {
  .contents { padding-block: 80px 64px; }
  .toc a { grid-template-columns: 44px minmax(0, 1fr) 24px; }
  .toc .t { font-size: 28px; }
  .toc .d { grid-column: 2 / 3; }
  .toc .arr { grid-row: 1; grid-column: 3; }
}
/* a soft cross-fade from one page to the next, where the browser supports it */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .6s; animation-timing-function: cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

/* ---------- the book: real page turns (StPageFlip) and the opening sequence ---------- */
.flip-host { position: relative; margin: 0 auto; }
/* the shadow sits on each page, not as a filter over the whole book, so nothing is redrawn while a page turns */
.inline-host { width: 100%; max-width: 570px; margin-left: auto; margin-right: 0; }
.big-host { opacity: 0; transition: opacity .35s ease; }
/* one steady shadow under the open book: it never moves or redraws while a page turns, in any browser */
.flip-host { position: relative; isolation: isolate; }
.flip-host::before { content: ""; position: absolute; left: calc(var(--sh-l, 0px) + 1%); width: calc(var(--sh-w, 100%) - 2%); top: 2%; bottom: 0; z-index: -1; pointer-events: none; transition: left .3s ease, width .3s ease;
  box-shadow: 0 16px 34px rgba(0,0,0,.34), 0 4px 10px rgba(0,0,0,.18); }
.reading.ready .big-host { opacity: 1; }
.reading { gap: 12px; }
.reading .reading-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.reading .viewer-bar { opacity: 0; transition: opacity .5s ease .2s; }
.reading.ready .viewer-bar { opacity: 1; }
.reading.closing { opacity: 0; transition: opacity .4s ease; }
/* paper: warm off-white, with the soft shadow a real book has where the pages run into the spine */
.leafpage { background-color: #F7F2E8; overflow: hidden; }
.leafpage picture, .leafpage img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.leafpage .gutter { position: absolute; top: 0; bottom: 0; width: 14%; pointer-events: none; }
.leafpage.--left .gutter { right: 0; background: linear-gradient(to left, rgba(40,32,20,.28), rgba(40,32,20,.08) 35%, rgba(40,32,20,0)); }
.leafpage.--right .gutter { left: 0; background: linear-gradient(to right, rgba(40,32,20,.28), rgba(40,32,20,.08) 35%, rgba(40,32,20,0)); }
.leafpage.--hard .gutter { display: none; }
.leafpage.endpaper-page { background-color: #E9E2D4; }

/* the opening: a 3D book that lifts off the page, opens on its hinge and riffles to the first spread */
.ob { position: fixed; z-index: 2147483000; width: calc(var(--W) * 2); height: var(--H); transform-origin: 75% 50%; transform-style: preserve-3d; pointer-events: none; }
.ob.done { opacity: 0; transition: opacity .35s ease; }
.ob > * { position: absolute; top: 0; height: 100%; transform-style: preserve-3d; }
.ob-floor { left: 50%; width: 50%; top: 4%; height: 96%; background: rgba(20,22,12,.55); filter: blur(28px); transform: translateZ(-2px) translate(calc(var(--lift) * 24px), calc(var(--lift) * 40px)) scale(calc(1 + var(--lift) * .08)); opacity: calc(.55 - var(--lift) * .35); }
.ob-right, .ob-block, .ob-leaf, .ob-cover { left: 50%; width: 50%; }
.ob-face { position: absolute; inset: 0; background-color: #F7F2E8; background-size: cover; background-position: center; backface-visibility: hidden; }
.ob-right .ob-face { box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.ob-gutter { position: absolute; top: 0; bottom: 0; left: 0; width: 14%; background: linear-gradient(to right, rgba(40,32,20,.3), rgba(40,32,20,0)); }
.ob-cast { position: absolute; inset: 0; background: linear-gradient(to right, rgba(20,16,8,.65), rgba(20,16,8,.2) 45%, rgba(20,16,8,0) 80%); opacity: 0; }
/* the page block seen from the fore-edge while the book is still closed */
.ob-block { left: calc(100% - var(--T) / 2); width: var(--T); background: repeating-linear-gradient(90deg, #F1EADC 0 1px, #D9CFBD 1px 2px); transform: rotateY(90deg) translateZ(calc(var(--T) / -2)); transform-origin: center; }
.ob-leaf { transform-origin: left center; }
.ob-half { position: absolute; top: 0; height: 100%; width: 50%; transform-style: preserve-3d; }
.ob-half.in { left: 0; transform-origin: left center; }
.ob-half.out { left: 100%; width: 100%; transform-origin: left center; }
.ob-half .ob-face.f { background: linear-gradient(to right, #EFE8DA, #F7F2E8 30%); }
.ob-half .ob-face.b { transform: rotateY(180deg); background-color: #F7F2E8; background-size: 200% 100%; }
.ob-half.out .ob-face.f { background: #F7F2E8; }
.ob-leaf .ob-half.in::after { content: ""; position: absolute; inset: 0 -100% 0 0; background: linear-gradient(to right, rgba(0,0,0,.25), rgba(0,0,0,0) 60%); opacity: var(--sh, 0); pointer-events: none; }
.ob-cover { transform-origin: left center; }
.ob-cover .ob-face.f { background-color: #E7E1D8; background-size: contain; background-repeat: no-repeat; border-radius: 0 3px 3px 0; box-shadow: inset 6px 0 8px -4px rgba(0,0,0,.35); }
.ob-cover .ob-face.b { transform: rotateY(180deg); border-radius: 3px 0 0 3px; }
.ob-cover .endpaper { background: #E9E2D4 linear-gradient(to left, rgba(40,32,20,.22), rgba(40,32,20,0) 18%); }
.ob-light { position: absolute; inset: 0; background: linear-gradient(105deg, rgba(0,0,0,.55), rgba(0,0,0,.15)); opacity: 0; backface-visibility: hidden; pointer-events: none; }
.ob-edge { position: absolute; top: 0; bottom: 0; right: -3px; width: 3px; background: #CFC6B6; transform: rotateY(90deg); transform-origin: left; }
@media (prefers-reduced-motion: reduce) { .ob { display: none; } .big-host, .reading .viewer-bar { transition: none; } }

/* photos supplied by the studio fill their frames */
.portrait-img { width: 100%; height: 100%; }
.portrait-img picture, .portrait-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.arch .portrait-img { min-height: 100%; }

/* the client questionnaire: the Manus quiz fills the page under the header */
.quiz-frame { height: calc(100vh - 64px - 44px); height: calc(100svh - 64px - 44px); padding: 0 var(--side); }
.quiz-frame iframe { width: 100%; height: 100%; border: 0; background: var(--cream); }
.quiz-alt { padding-block: 12px; color: var(--ink-2); }
.quiz-msg { min-height: calc(100vh - 64px); display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 760px; margin: 0; }

/* the K of Kapri is the K from the KARUKRIT wordmark */
.kname { white-space: nowrap; }
.kd-k svg { height: .7em; width: auto; vertical-align: baseline; overflow: visible; margin-right: .01em; }

/* coming soon: each chapter keeps its colour and motion, and holds a countdown */
.soon-ch { display: flex; flex-direction: column; justify-content: center; padding: 140px var(--side) 100px; overflow: hidden; }
.soon-ch .philo-back { z-index: 0; }
.soon { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 28px; max-width: 980px; }
.soon .h1 { font-size: clamp(44px, 5.3vw, 76px); }
.soon-sub { font-weight: 300; margin-top: -8px; }
.soon .book-card { margin-top: 8px; }
.countdown { display: flex; gap: clamp(20px, 4vw, 56px); align-items: flex-start; }
.countdown .unit { display: flex; flex-direction: column; gap: 10px; min-width: 2.2ch; }
.countdown b { display: block; font-size: clamp(44px, 6vw, 92px); line-height: 1; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.countdown .cap { opacity: .75; }
.soon-note { opacity: .8; }
.soon-hero { justify-content: flex-end; align-self: end; gap: 22px; }
.countdown.big b { font-size: clamp(56px, 7vw, 120px); }
@media (max-width: 767px) {
  .soon-ch { padding: 120px var(--side) 80px; }
  .countdown { gap: 18px; }
  .countdown .cap { letter-spacing: .16em; font-size: 10px; }
  .countdown b, .countdown.big b { font-size: 44px; }
  .soon-hero { gap: 14px; align-self: stretch; }
}

/* ---------- colour themes ----------
   The build sets data-theme on <html> from content/theme.txt (leather, bottle or maroon).
   Every surface, text colour and highlight comes from these tokens, so a theme is only a set of values. */
html[data-theme="bottle"] {
  --moss: #123D2F; --moss-deep: #0A251C; --sage: #5F8A72; --orange: #B5512A; --gold: #E8B12B; --taupe: #D2D4D0;
  --ink: #0E1D17; --ink-2: #1D3329; --taupe-dark: #B7BAB5; --taupe-light: #E6E7E3;
  --cream: #F3F1EA; --cream-warm: #F7F5EF; --cream-muted: #C9D2CB; --gold-light: #F3C54A; --gold-pale: #FBE3A1;
  --taupe-rgb: 210 212 208; --paper: #EEEFEA; --grass: #2E5A43;
}
html[data-theme="maroon"] {
  --moss: #4A1D1F; --moss-deep: #2B0F10; --sage: #8C6F5F; --orange: #A8432A; --gold: #E3A93A; --taupe: #D7D2CC;
  --ink: #1F1112; --ink-2: #3A2224; --taupe-dark: #BDB6AF; --taupe-light: #E8E4DF;
  --cream: #F4EEE6; --cream-warm: #F7F2EB; --cream-muted: #D8C8BC; --gold-light: #F0C060; --gold-pale: #F8DFAE;
  --taupe-rgb: 215 210 204; --paper: #F0ECE6; --grass: #5E6B45;
}

/* the logo is revealed on the flat green, with the edges falling into darkness */
.loader::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: none; }
.loader .vignette { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 1.4s ease; }
.loader .vignette.on { opacity: 1; }
.loader .logo-anim { position: relative; z-index: 1; }
.loader .logo-last { z-index: 1; }

/* smooth shadows: things that sit on the leather cast a soft, layered shadow */
.loader .logo-anim, .loader .logo-last { filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)) drop-shadow(0 10px 22px rgba(0,0,0,.30)); }
.pane { box-shadow: var(--shadow-2); }
.topbar.show, .topbar.always { box-shadow: 0 1px 0 rgba(20,22,12,.06), 0 10px 30px rgba(20,22,12,.10); }
.book-card { box-shadow: var(--shadow-2); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.book-card:hover { transform: translateY(-3px); }
.member .frame, .tile .img, .handbook .pg { box-shadow: var(--shadow-1); }
/* where one coloured chapter meets the next, the upper one throws a soft shadow, like overlapping hides */
main > .ch + .ch, main > .ch + .philosophy, main > .philosophy + .ch, main > .contents, main > .hero-scroll + * { box-shadow: inset 0 26px 40px -30px rgba(10,12,6,.38); }
@media (prefers-reduced-motion: reduce) { .btn:hover, .book-card:hover { transform: none; } }

/* coming soon: the work, out of focus, on the curved wall exactly as the full site has it:
   the same card size and the same room under each card where the project name would be */
.veil { position: relative; z-index: 1; margin: 40px calc(-1 * var(--side)) 0; overflow: hidden; }   /* full width, inside the countdown's section */
.veil-tile .img { box-shadow: var(--shadow-1); background: var(--taupe-dark); }
.veil-tile .img::after { content: none; }
.veil-tile picture, .veil-tile img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.veil-tile::after { content: ""; display: block; height: 53px; }   /* where the name and status sit on the full site */
@media (max-width: 767px) { .veil { padding-bottom: 80px; } }

/* the covers keep their own proportions inside the letter-size page */
.leafpage.cv img { object-fit: contain !important; }
.leafpage.cv-front { background-color: #E7E1D8; }
.leafpage.cv-back { background-color: #75825A; }
/* a photo under the cursor comes forward and grows a little, slowly, with its shadow deepening */
.veil-tile .img { transition: transform 1.1s cubic-bezier(.2,.7,.2,1), box-shadow 1.1s cubic-bezier(.2,.7,.2,1); }
.marq.curved .veil-tile:hover .img { transform: translateZ(80px); box-shadow: var(--shadow-2); }
@media (prefers-reduced-motion: reduce) { .veil-tile .img { transition: none; } }

/* about the book, beside the 3D book */
.about-book { align-self: center; display: flex; flex-direction: column; gap: 22px; max-width: 640px; margin-left: auto; }
.about-book .lead { font-size: clamp(24px, 2.1vw, 32px); line-height: 1.35; font-weight: 300; }
.about-book .body { color: var(--cream-muted); }
.about-book .for { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 18px; border-top: 1px solid rgba(239,232,220,.18); padding-top: 22px; }
.about-book .for li { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: baseline; }
.about-book .for li > span:last-child { font-size: 15px; line-height: 1.65; color: var(--cream-muted); }
.about-book .actions { letter-spacing: .32em; color: var(--gold-light); border-top: 1px solid rgba(239,232,220,.18); padding-top: 22px; }
.about-book .close { font-size: 18px; line-height: 1.5; }
@media (max-width: 1199px) { .about-book .for li { grid-template-columns: 1fr; gap: 6px; } }
@media (max-width: 767px) { .about-book { margin-top: 28px; } }

.veil-canvas { display: block; width: 100%; cursor: grab; touch-action: pan-y; }
.veil-canvas.dragging { cursor: grabbing; }

/* the reading room fades in behind the book: its leather is a layer that comes up while the book flies in */
dialog.reading { background: transparent; isolation: isolate; }
dialog.reading::before { content: ""; position: fixed; inset: -25vh -25vw; z-index: -1;   /* larger than the screen, so a phone toolbar sliding away never uncovers the page */ background-color: var(--moss);
  background-image: linear-gradient(118deg, rgba(255,250,240,0) 18%, rgba(255,250,240,.07) 42%, rgba(255,250,240,.02) 58%, rgba(0,0,0,.05) 82%), url("../texture/silk.png");
  background-size: 100% 100%, 1024px 1024px; opacity: 0; transition: opacity .75s cubic-bezier(.2,.7,.2,1); }
dialog.reading.lit::before { opacity: 1; }
dialog.reading::backdrop { background: transparent; }
.reading .full-top { opacity: 0; transition: opacity .5s ease .35s; }
.reading.lit .full-top { opacity: 1; }
@media (prefers-reduced-motion: reduce) { dialog.reading::before, .reading .full-top { transition: none; } }

/* while the animated book hands over to the real one, the real one appears at once, underneath it */
.reading.swap .big-host, .reading.swap .viewer-bar { transition: none; }

/* below the 3D house: the studio's links */
.toc.links .ico { display: inline-flex; align-self: center; }
.toc.links .ico svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; color: var(--moss); transition: transform .6s var(--ease); }
.toc.links a:hover .ico svg { transform: scale(1.12); }
.toc.links a:hover .arr { transform: translate(6px, -6px); }
@media (max-width: 767px) { .toc.links .ico svg { width: 24px; height: 24px; } }

/* Nirman IQ: a highlighted moss-green panel above "Find us" */
.nirman { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; padding: 34px 40px; margin-bottom: 36px; border-radius: 4px; box-shadow: var(--shadow-2); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.nirman:hover { transform: translateY(-3px); }
.nirman .ni-ico svg { width: 46px; height: 46px; fill: none; stroke: var(--gold-light); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.nirman .ni-text { display: flex; flex-direction: column; gap: 6px; }
.nirman .ni-name { font-size: 44px; line-height: 1.1; font-weight: 300; color: var(--cream); }
.nirman .ni-d { font-size: 15px; color: var(--cream-muted); }
.nirman .ni-go { color: var(--ink); background-color: var(--gold); padding: 15px 22px; border-radius: 999px; white-space: nowrap; transition: filter .3s ease; }
.nirman:hover .ni-go { filter: brightness(1.08); }
@media (max-width: 767px) {
  .nirman { grid-template-columns: auto 1fr; padding: 24px 22px; gap: 16px 18px; }
  .nirman .ni-ico svg { width: 34px; height: 34px; }
  .nirman .ni-name { font-size: 32px; }
  .nirman .ni-go { grid-column: 1 / -1; justify-self: start; }
}
