/* ============================================================
   Almira Hanafiah — shared site styles
   Linked by every page except play.html (which is bespoke).
   Page-specific CSS still lives inline in each page's <style>,
   loaded after this file so per-page overrides win.
   ============================================================ */

/* ============ TOKENS ============ */
:root {
  --paper: #fcfcfc;      /* neutral near-white */
  --paper-2: #f4f0e9;    /* warm cream for tonal bands and image wells */
  --ink: #2c2a28;        /* warm near-black */
  --ink-soft: #79736a;   /* warm grey */
  --pink: #ea5f82;       /* bright rose, the one accent */
  --pink-deep: #c0395c;  /* readable rose, links, small text */
  --rule: rgba(44, 42, 40, 0.16);

  --font: "Geist", system-ui, sans-serif;
  --w: 300;              /* Geist Light, uniform */

  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --shell: 1280px;
}

/* ============ RESET ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

/* smooth cross-fade between pages (Chrome 126+, Safari 18+); harmlessly ignored elsewhere */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: ease;
}
/* The whole page (header included) cross-fades as one opaque snapshot.
   We deliberately do NOT give the header its own view-transition-name:
   the header has a transparent background, so pinning it as a separate
   snapshot left the old and new headers visibly overlaid mid-transition. */

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: var(--w);
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a, p, h1, h2, h3, h4, div, span, nav, li, ol {
  font-weight: var(--w);
}
a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: var(--pink);
  color: var(--paper);
}

@media (hover: hover) and (pointer: fine) {
  body, a, button, .row {
    cursor: none;
  }
}

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 56px;
}

/* micro-label used throughout */
.label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.19em;
  color: var(--ink-soft);
}

/* ============ CURSOR ============ */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  border: 1px solid var(--pink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition:
    width 0.22s var(--ease),
    height 0.22s var(--ease),
    background-color 0.22s var(--ease);
}
.cursor.hot {
  width: 54px;
  height: 54px;
  background: rgba(234, 95, 130, 0.12);
}
.cursor.grab {
  width: 44px;
  height: 44px;
  background: rgba(234, 95, 130, 0.18);
}
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  background: var(--pink-deep);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-dot {
    display: none;
  }
}

/* ============ READING PROGRESS (case studies) ============ */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--pink);
  z-index: 500;
  transition: width 0.1s linear;
}

/* ============ MASTHEAD ============ */
header {
  border-bottom: 1px solid var(--rule);
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 28px 0 20px;
}
.wordmark {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--pink-deep);
}
.nav {
  display: flex;
  gap: 30px;
}
.nav a {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  position: relative;
  padding-bottom: 3px;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--pink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.26s var(--ease);
}
.nav a:hover::after {
  transform: scaleX(1);
}
.nav a.here {
  color: var(--pink-deep);
}
.nav a.here::after {
  transform: scaleX(1);
}

/* ============ CASE-STUDY TOP BAR ============ */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 28px 0 20px;
}
.back {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.back .ar {
  color: var(--pink-deep);
  margin-right: 7px;
}
.back:hover {
  color: var(--pink-deep);
}

/* ============ CASE HEADER ============ */
.cs-header {
  padding: 76px 0 48px;
}
.cs-header .eyebrow {
  margin-bottom: 26px;
}
.cs-title {
  font-size: clamp(2.2rem, 4.7vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 17ch;
}
.cs-title em {
  font-style: normal;
  color: var(--pink-deep);
}
.cs-header .dek {
  margin-top: 26px;
  max-width: 52ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* hero / image plates */
.plate {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
}
.plate .g {
  width: 30px;
  height: 30px;
  border: 1px solid var(--ink-soft);
}
.hero-plate {
  aspect-ratio: 16 / 7;
  margin-bottom: 8px;
}
.cap {
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

/* ============ CASE LAYOUT: sticky TOC + article ============ */
.layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 72px;
  padding-top: 64px;
  padding-bottom: 96px;
}
.toc {
  position: sticky;
  top: 44px;
  align-self: start;
}
.toc .label {
  margin-bottom: 18px;
}
.toc ol {
  list-style: none;
}
.toc li {
  margin-bottom: 2px;
}
.toc a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: color 0.25s var(--ease);
}
.toc a .tick {
  width: 16px;
  height: 1px;
  background: var(--rule);
  transition: width 0.25s var(--ease), background-color 0.25s var(--ease);
  flex-shrink: 0;
}
.toc a .n {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  width: 1.2em;
}
.toc a:hover {
  color: var(--ink);
}
.toc a.active {
  color: var(--ink);
}
.toc a.active .tick {
  width: 28px;
  background: var(--pink);
}
.toc a.active .n {
  color: var(--pink-deep);
}

/* ---- article ---- */
.article {
  min-width: 0;
}
.cs-sec {
  scroll-margin-top: 36px;
  padding-bottom: 84px;
}
.sec-tag {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.sec-tag::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--pink);
}
.cs-sec h2 {
  font-size: clamp(1.55rem, 2.5vw, 2.1rem);
  letter-spacing: -0.028em;
  line-height: 1.12;
  margin-bottom: 22px;
}
.cs-sec p {
  max-width: 64ch;
  margin-bottom: 18px;
  color: var(--ink);
}
.cs-sec p.muted {
  color: var(--ink-soft);
}
.cs-sec h3 {
  font-size: 1.06rem;
  letter-spacing: 0.005em;
  margin: 36px 0 12px;
}

/* quick facts */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 30px 0 8px;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.facts .k {
  margin-bottom: 8px;
}
.facts .v {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* outcome / callout line */
.callout {
  font-size: clamp(1.3rem, 2.3vw, 1.8rem);
  line-height: 1.4;
  letter-spacing: -0.018em;
  max-width: 24ch;
  margin: 6px 0 8px;
}
.callout em {
  font-style: normal;
  color: var(--pink-deep);
}

/* TL;DR three-part */
.tldr {
  border-top: 1px solid var(--rule);
}
.tldr .part {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 28px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
.tldr .part .k {
  padding-top: 3px;
}
.tldr .part p {
  margin: 0;
  max-width: 56ch;
}

/* key insight note */
.insight {
  border-left: 2px solid var(--pink);
  padding: 4px 0 4px 24px;
  margin: 30px 0;
}
.insight .k {
  margin-bottom: 8px;
}
.insight p {
  margin: 0;
  font-size: 1.12rem;
  max-width: 52ch;
}

/* figures */
figure {
  margin: 30px 0;
}
.screen {
  aspect-ratio: 4 / 5;
}
.wide {
  aspect-ratio: 16 / 9;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
figure .cap {
  display: block;
  margin-top: 10px;
}

/* learnings two-col */
.cols2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.cols2 h3 {
  margin-top: 0;
}
.cols2 p {
  margin-bottom: 0;
}

/* ============ FOOTER / COLOPHON ============ */
footer {
  border-top: 1px solid var(--rule);
}
.colophon {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 22px;
}
.colophon .links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.colophon a {
  font-size: 0.8rem;
}
.colophon a:hover {
  color: var(--pink-deep);
}
.colophon .set {
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.sign {
  margin-top: 30px;
}
.sign-mark {
  display: inline-block;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--pink-deep);
}

/* case-study "Next project" link (no-op on pages without it) */
.next {
  display: block;
  padding: 60px 0;
  border-bottom: 1px solid var(--rule);
}
.next .label {
  margin-bottom: 14px;
}
.next .nt {
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  display: inline;
  background-image: linear-gradient(var(--pink), var(--pink));
  background-size: 0% 1px;
  background-position: 0 1.12em;
  background-repeat: no-repeat;
  transition: background-size 0.34s var(--ease);
}
.next:hover .nt {
  background-size: 100% 1px;
}
.next .nt .ar {
  color: var(--pink-deep);
}

/* ============ REVEAL ============ */
.rv {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease);
}
.rv.in {
  opacity: 1;
  transform: none;
}

/* prototype / status badge */
.proto-note {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 600;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 7px 13px;
  border-radius: 999px;
  opacity: 0.82;
}

/* ============ SHARED RESPONSIVE ============ */
@media (max-width: 900px) {
  .shell {
    padding: 0 30px;
  }
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 36px;
  }
  .toc {
    position: static;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--rule);
  }
  .toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 22px;
  }
  .toc a .tick {
    display: none;
  }
  .facts {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .tldr .part {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .pair, .cols2 {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}
@media (max-width: 560px) {
  .shell {
    padding: 0 20px;
  }
  .cs-header {
    padding: 48px 0 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .rv {
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }
  .cursor, .toc a, .toc a .tick, .next .nt {
    transition: none !important;
  }
}
