/* autopunk studio site. Tokens mirror .brand/BRAND.md. No build step. */

@font-face {
  font-family: "Caprasimo";
  src: url("fonts/caprasimo-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens: dark is the brand's home; light follows the system ── */
:root {
  color-scheme: dark light;

  --bg: oklch(0.136 0.006 71.3);          /* #0A0806 logo black */
  --surface: oklch(0.212 0.010 67.2);     /* #1C1814 */
  --ink: oklch(0.946 0.039 97.4);         /* #F4EED1 logo ink */
  --ink-muted: oklch(0.850 0.053 94.1);   /* #D9CEA7 */
  --frame: oklch(0.600 0.174 24.0);       /* #D44A4A logo frame */
  --accent-ink: oklch(0.670 0.162 26.3);  /* #E8675E red text on dark */
  --rule: oklch(0.946 0.039 97.4 / 0.18);
  --star: oklch(0.946 0.039 97.4);
  --on-frame: oklch(0.136 0.006 71.3);    /* black on red, 4.64:1 */
  --focus: oklch(0.946 0.039 97.4);

  --font-display: "Caprasimo", "Cooper Black", Georgia, serif;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 62ch;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: clamp(3.5rem, 8vw, 6.5rem);
  --space-6: clamp(5rem, 12vw, 10rem);

  --frame-width: clamp(3px, 0.45vw, 5px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: oklch(0.966 0.004 56.4);          /* #F6F3F1 */
    --surface: oklch(0.934 0.007 53.4);     /* #EDE8E5 */
    --ink: oklch(0.136 0.006 71.3);         /* #0A0806 */
    --ink-muted: oklch(0.400 0.015 59.2);   /* #4E4640 */
    --accent-ink: oklch(0.492 0.157 27.4);  /* #A8302A red text on light */
    --rule: oklch(0.136 0.006 71.3 / 0.16);
    --star: oklch(0.600 0.174 24.0);
    --focus: oklch(0.136 0.006 71.3);
  }
}

:root[data-theme="light"] {
  --bg: oklch(0.966 0.004 56.4);
  --surface: oklch(0.934 0.007 53.4);
  --ink: oklch(0.136 0.006 71.3);
  --ink-muted: oklch(0.400 0.015 59.2);
  --accent-ink: oklch(0.492 0.157 27.4);
  --rule: oklch(0.136 0.006 71.3 / 0.16);
  --star: oklch(0.600 0.174 24.0);
  --focus: oklch(0.136 0.006 71.3);
}

/* ── Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.98rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
  overflow-x: clip;
  font-kerning: normal;
}

/* Analogue grain from the brand guide, baked into the page background so it scrolls with the page. */
body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-ink);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}

.skip:focus {
  top: 0.75rem;
}

.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Header ── */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-3);
}

.site-head .logo {
  display: block;
  width: 3.5rem;
  flex: none;
}

.site-head nav ul {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-head nav a {
  display: inline-block;
  padding-block: 0.6rem;
  font-weight: 600;
  text-decoration: none;
}

.site-head nav a:hover {
  text-decoration: underline;
}

/* ── Hero: the logo's frame at page scale ── */
.hero {
  padding-top: var(--space-3);
  padding-bottom: var(--space-5);
}

.frame {
  position: relative;
  --hero-size: clamp(2.6rem, 10.4vw, 6rem);
  min-height: clamp(17rem, 46vw, 33rem);
  /* The headline hangs 42% of its two-line height below the frame. */
  margin-bottom: calc(var(--hero-size) * 0.85 + clamp(1.5rem, 3vw, 2.5rem));
}

.frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--frame-width) solid var(--frame);
  animation: frame-draw 1.1s var(--ease-out) both;
}

.frame .stars {
  position: absolute;
  top: clamp(1.25rem, 4vw, 3rem);
  right: clamp(1.25rem, 5vw, 4rem);
  width: clamp(6.5rem, 18vw, 13rem);
  height: auto;
  color: var(--star);
}

.stars path {
  transform-box: fill-box;
  transform-origin: center;
  animation: star-in 0.9s var(--ease-out) both;
}

.stars path:nth-child(1) { animation-delay: 0.35s; }
.stars path:nth-child(2) { animation-delay: 0.5s; }
.stars path:nth-child(3) { animation-delay: 0.62s; }

.hero h1 {
  position: absolute;
  left: clamp(0.75rem, 3vw, 2.5rem);
  bottom: 0;
  transform: translateY(42%);
  font-size: var(--hero-size);
  line-height: 0.98;
  /* Knock the frame line out behind the letters, like the logo's outlined wordmark. */
  text-shadow:
    0.05em 0 0 var(--bg),
    -0.05em 0 0 var(--bg),
    0 0.05em 0 var(--bg),
    0 -0.05em 0 var(--bg),
    0.04em 0.04em 0 var(--bg),
    -0.04em -0.04em 0 var(--bg),
    0.04em -0.04em 0 var(--bg),
    -0.04em 0.04em 0 var(--bg);
}

.hero h1 span {
  display: block;
}

.lead {
  max-width: 40ch;
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
  line-height: 1.4;
  font-weight: 500;
}

.lead em {
  font-style: normal;
  color: var(--accent-ink);
}

/* ── Sections ── */
.section-title {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
  margin-bottom: var(--space-4);
}

.work {
  padding-bottom: var(--space-5);
}

.project {
  display: grid;
  gap: var(--space-4);
  padding-block: var(--space-4) var(--space-5);
  border-top: 2px solid var(--rule);
}

.project h3 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.25rem);
}

.project .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--space-2);
  color: var(--ink-muted);
  font-size: 0.95em;
}

.project .meta img {
  width: 3rem;
  height: 3rem;
  border-radius: 0.7rem;
}

.project .body > p {
  max-width: var(--measure);
  margin-top: var(--space-2);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.75rem;
  font-weight: 650;
}

.links a span[aria-hidden] {
  display: inline-block;
  transition: transform 0.25s var(--ease-out);
}

.links a:hover span[aria-hidden] {
  transform: translate(0.12em, -0.12em);
}

/* Rucksteady: the app's own plan screen */
.shot {
  margin: 0;
  justify-self: center;
  width: min(100%, 20rem);
}

.shot img {
  border-radius: 1.75rem;
  border: 6px solid oklch(0.136 0.006 71.3);
  box-shadow: 0 0 0 var(--frame-width) var(--frame);
  rotate: 2deg;
}

.shot figcaption,
.specimen figcaption {
  margin-top: var(--space-2);
  color: var(--ink-muted);
  font-size: 0.85em;
}

/* Skills library: a real skill file, set as a specimen */
.specimen {
  margin: 0;
  align-self: start;
}

.specimen .file {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface);
  border: 2px solid var(--rule);
  border-radius: 0.6rem;
  font-size: 0.9em;
  line-height: 1.5;
}

.file .path {
  margin-bottom: var(--space-2);
  color: var(--ink-muted);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
}

.file h4 {
  margin: var(--space-2) 0 0.25rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2em;
}

.file blockquote {
  margin: var(--space-3) 0 0;
  padding-top: var(--space-2);
  border-top: 2px dashed var(--rule);
  font-size: 1.05em;
}

.file blockquote p::before {
  content: "\201C";
}

.file blockquote p::after {
  content: "\201D";
}

.file cite {
  display: block;
  margin-top: 0.5rem;
  color: var(--ink-muted);
  font-style: normal;
  font-size: 0.85em;
}

.more {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  padding-top: var(--space-4);
  border-top: 2px solid var(--rule);
}

.more svg {
  width: 3.25rem;
  color: var(--star);
}

.more h3 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  margin-bottom: 0.5rem;
}

.more p {
  max-width: var(--measure);
}

.project .status {
  color: var(--ink-muted);
}

/* Pitch Doctor and Plotkeep: real sequences, numbered because order is the point */
.pipeline {
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  list-style: none;
  counter-reset: stage;
  background: var(--surface);
  border: 2px solid var(--rule);
  border-radius: 0.6rem;
}

.pipeline li {
  counter-increment: stage;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding-block: 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.35rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pipeline li::before {
  content: counter(stage, decimal-leading-zero);
  flex: none;
  color: var(--accent-ink);
  font-family: var(--font-body);
  font-size: 0.7em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pipeline li.key {
  color: var(--accent-ink);
}


@media (min-width: 52rem) {
  .project {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-5);
  }

  .project--flip .body {
    order: 2;
  }

  .shot {
    width: min(100%, 22rem);
  }
}

/* ── Studio: about and FAQ, merged ── */
.studio {
  padding-bottom: var(--space-5);
}

.studio .intro {
  max-width: 34ch;
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
  line-height: 1.4;
  font-weight: 500;
  margin-bottom: var(--space-4);
}

.qa {
  display: grid;
  gap: var(--space-4);
  margin: 0;
}

.qa div {
  padding-top: var(--space-2);
  border-top: 2px solid var(--rule);
}

.qa dt {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.qa dd {
  margin: 0;
  max-width: var(--measure);
  color: var(--ink-muted);
}

@media (min-width: 52rem) {
  .qa {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-5);
  }
}

/* ── Hello: the one drenched moment ── */
.hello {
  background: var(--frame);
  color: var(--on-frame);
  padding-block: var(--space-6);
}

.hello h2 {
  font-size: clamp(3rem, 1.6rem + 7vw, 6rem);
}

.hello p {
  max-width: 34ch;
  margin-top: var(--space-3);
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);
  font-weight: 500;
}

.hello a {
  display: inline-block;
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 0.9rem + 3.6vw, 3.5rem);
  line-height: 1.1;
  text-decoration-thickness: 0.06em;
  overflow-wrap: anywhere;
}

.hello a:hover {
  color: var(--on-frame);
  text-decoration-style: wavy;
}

.hello :focus-visible {
  outline-color: var(--on-frame);
}

/* ── Footer ── */
.site-foot {
  padding-block: var(--space-4);
  color: var(--ink-muted);
  font-size: 0.9em;
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  align-items: center;
  justify-content: space-between;
}

.site-foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-foot a {
  display: inline-block;
  padding-block: 0.6rem;
}

/* ── Plain pages (privacy, 404) ── */
.page {
  padding-block: var(--space-4) var(--space-5);
}

.page h1 {
  font-size: clamp(2.4rem, 1.6rem + 4vw, 4.5rem);
  margin-bottom: var(--space-3);
}

.page h2 {
  font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem);
  margin: var(--space-4) 0 var(--space-1);
}

.page p,
.page ul {
  max-width: var(--measure);
}

.page p + p {
  margin-top: var(--space-2);
}

.page ul {
  padding-left: 1.2em;
}

.page li + li {
  margin-top: 0.4rem;
}

.page .updated {
  color: var(--ink-muted);
}

.lost .frame {
  min-height: clamp(14rem, 36vw, 24rem);
}

/* ── Motion ── */
@keyframes frame-draw {
  from {
    clip-path: inset(0 100% 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes star-in {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-45deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
