/* jakem.uk: gritstone, heather and moss, with notebook-paper cards. Dark unless light is chosen. */
:root {
  --bg: #121411; --bg-2: #1a1d18; --ink: #ece8df; --muted: #a3a698; --line: #2d312a; --accent: #d08cbf; --btn-ink: #121411;
  --doodle: #1b1e19; --doodle-hero: #272b25; --doodle-size: 340px;
  --white: #fff; --black: #111; --paper: #f1ead9;
  --font: "Archivo", "Arial Narrow", Arial, sans-serif;
  --wide: 68rem; --gutter: 20px;
  --card-w: min(56vw, 250px, 36svh);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f1ea; --bg-2: #ebe6db; --ink: #1c1f1a; --muted: #5f6359; --line: #d9d3c6; --accent: #8a4f7d; --btn-ink: #f4f1ea; color-scheme: light;
  --doodle: #ebe6da; --doodle-hero: #e1dbcc;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { position: relative; margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.55 var(--font); overflow-x: clip; }
/* the doodles: one tile used as a mask, so each theme can colour it. Faint behind the text, stronger in the hero */
body::before, .hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--doodle);
  -webkit-mask: url("/assets/doodles.svg") 0 0 / var(--doodle-size); mask: url("/assets/doodles.svg") 0 0 / var(--doodle-size); }
.hero::before { background: var(--doodle-hero); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2 { font-stretch: 125%; font-weight: 900; line-height: .95; margin: 0; }
h2 { font-size: clamp(2rem, 7vw, 3.4rem); margin-bottom: .6em; }
p { margin: 0 0 1em; max-width: 38rem; }
section { padding-top: clamp(64px, 11vw, 128px); }
.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 9; background: var(--bg); color: var(--ink); padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- theme switch ---------- */
.theme { position: absolute; z-index: 5; top: 14px; right: var(--gutter); width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.theme svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme .sun { display: none; }
:root[data-theme="light"] .theme .sun { display: block; } :root[data-theme="light"] .theme .moon { display: none; }

/* ---------- title and table ---------- */
/* the title and cards hold still while you scroll through .stage, and the cards gather up */
.js .stage { height: 240svh; }
.hero { position: relative; isolation: isolate; padding: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); }
.js .hero { position: sticky; top: 0; height: 100svh; }
.hero h1 { font-size: 29vw; line-height: .8; padding: 66px 0 0; margin-left: -.03em; text-align: center; white-space: nowrap; }
.standfirst { margin: 16px auto 0; padding: 0 var(--gutter); max-width: none; text-align: center; font-size: clamp(1.05rem, 3.6vw, 1.5rem); font-weight: 500; }

.deck { display: none; position: relative; flex: 1; min-height: 0;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.js .deck { display: block; }
.deck.dragging { cursor: grabbing; }
.ring { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.pc { position: absolute; left: calc(var(--card-w) / -2); top: calc(var(--card-w) * -2 / 3); width: var(--card-w); aspect-ratio: 3 / 4;
  transform-style: preserve-3d; color: var(--black); text-decoration: none; -webkit-user-drag: none; }
.side { position: absolute; inset: 0; border-radius: calc(var(--card-w) * .03); overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .18), 0 3px 10px rgb(0 0 0 / .4); }
.face { background: var(--paper); }
.face img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
/* the drawings leave the bottom of the sheet clear for this */
.caption { position: absolute; left: 0; right: 0; bottom: calc(var(--card-w) * .022); }
.back { transform: rotateY(180deg); background: var(--white) center / cover no-repeat; }
.back.bricks { background-image: url("/assets/back-bricks.svg"); }
.back.paper { background-image: url("/assets/back-paper.svg"); }
.back.tiles { background-image: url("/assets/back-tiles.svg"); }
.pc b { display: block; font-weight: 900; font-size: calc(var(--card-w) * .086); line-height: 1.02; color: var(--black); text-align: center; padding: 0 5%; }
.pc small { display: block; margin-top: .2em; font-size: calc(var(--card-w) * .052); font-weight: 500; line-height: 1.25; color: #2b2b2b; text-align: center; padding: 0 9%; }
.hint { margin: 0 auto 18px; padding: 0 var(--gutter); max-width: none; text-align: center; color: var(--muted); font-size: .92rem; }
html:not(.js) .hint { display: none; }

/* ---------- each project ---------- */
.project { padding-top: clamp(48px, 9vw, 104px); }
.project-media { margin: 0 0 28px; background: var(--bg-2); overflow: hidden; }
.project-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.project-media video { display: block; width: 100%; height: auto; }
.project-body { display: grid; gap: 24px; }
.project h3 { margin: 0 0 .5em; font-stretch: 118%; font-weight: 900; font-size: clamp(2.2rem, 8vw, 4rem); line-height: 1; }
.tag { display: inline-block; vertical-align: middle; font-stretch: 100%; font-weight: 500; font-size: .9rem; color: var(--muted); }
.specs { margin: 0; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.highlights { margin: 16px 0 0; padding-left: 1.2em; }

/* ---------- about, contact ---------- */
.about { display: grid; gap: 28px; }
.portrait img { width: min(100%, 320px); }
.btn { display: inline-block; min-height: 48px; padding: 12px 22px; border: 1px solid var(--ink); background: var(--ink); color: var(--btn-ink); font: 700 1rem var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn.soon { background: none; color: var(--muted); border-color: var(--line); cursor: default; }
.email { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.email[hidden] { display: none; }
.email-text { color: var(--accent); font-stretch: 112%; font-weight: 800; font-size: clamp(1.5rem, 6vw, 2.4rem); line-height: 1.1; overflow-wrap: anywhere; }
.foot { padding: clamp(64px, 11vw, 120px) 0 32px; color: var(--muted); font-size: .92rem; }

/* ---------- 404 ---------- */
.lost { min-height: 100svh; display: grid; align-content: center; justify-items: start; padding: 64px var(--gutter); width: min(100%, var(--wide)); margin-inline: auto; }
.lost h1 { font-size: clamp(3.4rem, 17vw, 11rem); margin-bottom: .2em; }

@media (min-width: 760px) {
  :root { --gutter: 40px; --doodle-size: 440px; }
  .hero h1 { font-size: min(24vw, 30vh); padding-top: .12em; }
  .project-body { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 56px; }
  .specs div { grid-template-columns: 9rem minmax(0, 1fr); }
  .about { grid-template-columns: 320px minmax(0, 1fr); gap: 56px; align-items: end; }
}

/* no scroll-driven movement if motion is turned down */
@media (prefers-reduced-motion: reduce) {
  .js .stage { height: auto; }
  .js .hero { position: relative; height: 100svh; }
}
