/* Base: fonts, palette tokens and resets shared by every page. Page styles: css/home.css (homepage), css/site.css (inner pages). */
@font-face { font-family: 'Archivo'; src: url(/assets/fonts/archivo.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/assets/fonts/geist-mono.woff2) format('woff2'); font-weight: 400; font-display: swap; }

/* Light, 60 / 30 / 10: peach ground, deep teal ink and bands, apricot accent.
   Apricot is too faint on peach for text and thin marks, so those use burnt apricot (--pink-ink, --mark). */
:root {
  --bg: #F8DBC1;
  --bg-2: #F2CDAE;
  --ink: #0E1718;
  --muted: #4F5D5C;
  --line: rgba(14, 23, 24, .16);
  --pink: #F2A65A;
  --pink-ink: #944810;
  --mark: #944810;
  --on-pink: #0E1718;
  --teal: #944810;
  --on-teal: #F8DBC1;
  --gutter: clamp(1rem, 2.4vw, 2.5rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

/* Dark: the same three colours turned inside out. Deep teal ground, peach ink, apricot accent. */
:root[data-theme='dark'] {
  --bg: #0E1718;
  --bg-2: #15292B;
  --ink: #F8DBC1;
  --muted: #A8968A;
  --line: rgba(248, 219, 193, .16);
  --pink: #F2A65A;
  --pink-ink: #F2A65A;
  --mark: #F2A65A;
  --on-pink: #0E1718;
  --teal: #F2A65A;
  --on-teal: #0E1718;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; transition: background-color 0.6s var(--ease), color 0.6s var(--ease); }
img { display: block; max-width: 100%; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- The period as a portal (js/dot.js) ----------
   A heading's full stop is the brand square and a link. At rest it is just punctuation in the accent colour.
   Hover or focus: colour seeps out of it like ink taking to paper (light theme) or light leaking through a pinhole
   (dark theme): an irregular bloom with a darker tide-line at its edge and a faint wash beyond, all from the square.
   Click: the bloom floods the screen and you pass through it. Colours come from one warm family:
   --bleed on the link (work = apricot, talk = ember, concepts = ochre). Markup:
   <h2>Concepts<a class="dotp" href="/concepts/" data-bleed="concepts" aria-label="…"><span class="dotp__sq"></span></a></h2> */
.dotp { --bleed: #F2A65A; --bleed-deep: #B9561C; transition: --bleed .6s ease, --bleed-deep .6s ease;
  position: relative; display: inline-block; width: .2em; height: .2em; margin-left: .05em; vertical-align: baseline;
  color: var(--mark); text-decoration: none; outline: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.dotp[data-bleed='talk'] { --bleed: #E2652B; --bleed-deep: #9E3410; }
.dotp[data-bleed='concepts'] { --bleed: #E9B94F; --bleed-deep: #A86F12; }
/* 44px of touch target around a square that may be 12px */
.dotp::before { content: ''; position: absolute; left: 50%; top: 50%; width: max(44px, .7em); height: max(44px, .7em); translate: -50% -50%; }
.dotp__sq { position: absolute; inset: 0; z-index: 2; background: currentColor; border-radius: 0; transition: border-radius .7s var(--ease), background-color .5s var(--ease), scale .7s var(--ease); }
.dotp__bleed { position: absolute; left: 50%; top: 50%; width: 3.8em; height: 3.8em; margin: -1.9em 0 0 -1.9em; z-index: -1; pointer-events: none; mix-blend-mode: multiply; }
:root[data-theme='dark'] .dotp__bleed { mix-blend-mode: screen; }
:root[data-theme='dark'] .dotp__bleed .b2 { display: none; }
.dotp__bleed i { position: absolute; display: block; border-radius: 50%; will-change: transform, opacity; opacity: 0; scale: .02; }
/* the pigment: dense at the source, thinning outward, edges torn by the paper's fibres */
.dotp__bleed .b1 { inset: 0; filter: url(#dotp-ink); border-radius: 0;
  background:
    radial-gradient(28% 26% at 50% 50%, var(--bleed) 0%, color-mix(in srgb, var(--bleed) 85%, transparent) 60%, transparent 100%),
    radial-gradient(30% 22% at 66% 38%, color-mix(in srgb, var(--bleed) 70%, transparent), transparent 100%),
    radial-gradient(22% 30% at 36% 64%, color-mix(in srgb, var(--bleed) 65%, transparent), transparent 100%),
    radial-gradient(26% 20% at 62% 70%, color-mix(in srgb, var(--bleed) 55%, transparent), transparent 100%),
    radial-gradient(20% 24% at 30% 34%, color-mix(in srgb, var(--bleed) 45%, transparent), transparent 100%);
  transition: scale 1.2s cubic-bezier(.22, .8, .2, 1), opacity .5s ease; }
/* the tide-line: where the wet edge stops, pigment gathers darker */
.dotp__bleed .b2 { inset: 8%; filter: url(#dotp-tide); border-radius: 0; background: radial-gradient(closest-side, transparent 60%, color-mix(in srgb, var(--bleed-deep) 32%, transparent) 66%, transparent 72%);
  -webkit-mask: conic-gradient(from 30deg, #000 0 22%, transparent 30% 46%, #000 58% 70%, transparent 80% 88%, #000 96%); mask: conic-gradient(from 30deg, #000 0 22%, transparent 30% 46%, #000 58% 70%, transparent 80% 88%, #000 96%);
  transition: scale 1.35s cubic-bezier(.22, .8, .2, 1) .05s, opacity .6s ease .1s; rotate: 40deg; }
/* the wash: water travelling ahead of the colour */
.dotp__bleed .b3 { inset: -22%; background: radial-gradient(closest-side, color-mix(in srgb, var(--bleed) 22%, transparent), transparent 72%);
  transition: scale 1.7s cubic-bezier(.22, .8, .2, 1) .1s, opacity .9s ease .1s; }
.dotp:hover .dotp__bleed i, .dotp:focus-visible .dotp__bleed i { opacity: 1; scale: 1; }
.dotp:hover .dotp__bleed .b1, .dotp:focus-visible .dotp__bleed .b1 { animation: dotp-creep 7s ease-in-out 1.2s infinite alternate; }
.dotp:hover .dotp__bleed .b2, .dotp:focus-visible .dotp__bleed .b2 { animation: dotp-creep2 9s ease-in-out 1.3s infinite alternate; }
@keyframes dotp-creep { to { scale: 1.08; rotate: 14deg; } }
@keyframes dotp-creep2 { from { rotate: 40deg; } to { scale: 1.1; rotate: 22deg; } }
/* keyboard focus: a hairline square around the hit area */
.dotp:focus-visible::after { content: ''; position: absolute; left: 50%; top: 50%; width: max(40px, .62em); height: max(40px, .62em); translate: -50% -50%; border: 2px solid var(--ink); }
/* a heading that holds a portal becomes the bleed's stacking context, so the colour sits behind its letters */
:has(> .dotp) { position: relative; isolation: isolate; }
/* the pass-through, on click (created by dot.js) */
.dotp-burst { position: fixed; z-index: 9999; border-radius: 50%; pointer-events: none; filter: url(#dotp-ink);
  background: radial-gradient(closest-side, var(--bleed) 0%, var(--bleed) 55%, color-mix(in srgb, var(--bleed) 60%, transparent) 72%, transparent 80%); }
@media (prefers-reduced-motion: reduce) {
  .dotp__bleed i, .dotp__sq { transition: none !important; animation: none !important; }
  .dotp:hover .dotp__bleed i, .dotp:focus-visible .dotp__bleed i { scale: 1; }
}

/* ---------- The period cycles through the three worlds of The Other Side (set by js/dot.js as data-w) ----------
   base: the portfolio's own square · fable: a lime diamond with a cobalt block · neon: a lime pixel on a night tile
   with a scanline · hollow: a torn deep-navy shard split by a red seam. Each change passes through a short glitch. */
@property --bleed { syntax: '<color>'; inherits: true; initial-value: #F2A65A; }
@property --bleed-deep { syntax: '<color>'; inherits: true; initial-value: #B9561C; }
@font-face { font-family: 'OS Grotesk'; src: url(/other-side/fonts/space-grotesk.woff2) format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'OS Cormorant'; src: url(/other-side/fonts/cormorant-400-italic.woff2) format('woff2'); font-style: italic; font-display: swap; }
.dotp[data-w='fable'] { --bleed: #C4E44A; --bleed-deep: #3B45DE; }
.dotp[data-w='neon'] { --bleed: #12C9D9; --bleed-deep: #22336B; }
.dotp[data-w='hollow'] { --bleed: #A33D34; --bleed-deep: #20264B; }
.dotp__sq { overflow: visible; transition: background-color .35s ease, clip-path .45s var(--ease), scale .45s var(--ease); }
.dotp__f, .dotp__x { position: absolute; display: block; pointer-events: none; opacity: 0; transition: opacity .3s ease, transform .45s var(--ease), background-color .3s ease; }
.dotp__f { inset: 0; }
.dotp[data-w='fable'] .dotp__sq { background: transparent; }
.dotp[data-w='fable'] .dotp__f { opacity: 1; background: #C4E44A; transform: rotate(45deg) scale(.86); }
.dotp[data-w='fable'] .dotp__x { opacity: 1; left: -.13em; top: 18%; width: .07em; height: 64%; background: #3B45DE; }
.dotp[data-w='neon'] .dotp__sq { background: #080B12; box-shadow: inset 0 0 0 1px #22336B; }
.dotp[data-w='neon'] .dotp__f { opacity: 1; background: #B6F34A; transform: scale(.42); }
.dotp[data-w='neon'] .dotp__x { opacity: .9; left: 0; right: 0; height: 1px; top: 30%; background: #12C9D9; animation: dotp-scan 1.1s steps(6) infinite alternate; }
@keyframes dotp-scan { to { top: 74%; } }
.dotp[data-w='hollow'] .dotp__sq { background: radial-gradient(70% 60% at 60% 40%, #55283A, #20264B 55%, #090A12); clip-path: polygon(0 0, 58% 0, 66% 18%, 80% 8%, 100% 26%, 100% 100%, 0 100%); scale: 1.12; }
.dotp[data-w='hollow'] .dotp__f { opacity: 1; inset: auto; left: 8%; top: 46%; width: 84%; height: max(1px, 6%); background: #C0463B; transform: rotate(-36deg); }
:root[data-theme='dark'] .dotp[data-w='neon'] .dotp__sq, :root[data-theme='dark'] .dotp[data-w='hollow'] .dotp__sq { box-shadow: inset 0 0 0 1px rgba(234, 241, 255, .38); }
/* the jump between worlds: two frames of torn slices, then the new world settles */
.dotp.is-glitch .dotp__sq { animation: dotp-glitch .22s steps(2, jump-none) 1; }
@keyframes dotp-glitch {
  0% { translate: -.03em 0; clip-path: inset(0 0 55% 0); }
  50% { translate: .04em .01em; clip-path: inset(40% 0 0 0); }
  100% { translate: 0 0; }
}
/* "To the other side": a tag that glitches in on hover, focus and once when the period scrolls into view */
.dotp__label { position: absolute; right: -.02em; top: calc(100% + 10px); z-index: 3; padding: 7px 9px 6px; background: #121320; color: #F2A65A;
  font: 400 12px/1 'Geist Mono', monospace; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; font-stretch: normal;
  opacity: 0; translate: 0 -4px; clip-path: inset(0 0 100% 0); transition: opacity .25s ease, translate .45s var(--ease), clip-path .35s var(--ease); pointer-events: none; }
.dotp__label b { font-weight: 400; display: inline-block; min-width: .62em; text-align: center; }
.dotp__label b.s { width: .35em; min-width: 0; }
.dotp:hover .dotp__label, .dotp:focus-visible .dotp__label, .dotp.is-tell .dotp__label { opacity: 1; translate: 0 0; clip-path: inset(0 0 0 0); }
.dotp[data-w='fable'] .dotp__label { background: #3B45DE; color: #C4E44A; }
.dotp[data-w='neon'] .dotp__label { background: #080B12; color: #B6F34A; font-family: 'OS Grotesk', 'Geist Mono', monospace; letter-spacing: .02em; box-shadow: inset 0 -1px 0 #12C9D9; }
.dotp[data-w='hollow'] .dotp__label { background: #0C0D15; color: #D8D2C6; font-family: 'OS Cormorant', Georgia, serif; font-style: italic; font-size: 14px; letter-spacing: .02em; text-transform: none; box-shadow: inset 2px 0 0 #A33D34; }
:root[data-theme='dark'] .dotp:not([data-w]) .dotp__label, :root[data-theme='dark'] .dotp[data-w='base'] .dotp__label { background: #F8DBC1; color: #0E1718; }
.dotp.is-glitch .dotp__label { animation: dotp-tear .2s steps(2, jump-none) 1; }
@keyframes dotp-tear { 0% { translate: 3px 0; clip-path: inset(0 0 50% 0); } 50% { translate: -2px 0; clip-path: inset(45% 0 0 0); } 100% { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .dotp.is-glitch .dotp__sq, .dotp.is-glitch .dotp__label, .dotp[data-w='neon'] .dotp__x { animation: none !important; }
  .dotp__f, .dotp__x, .dotp__label { transition: none !important; }
}
