/* Ziji Solutions. Colors, type and proportions follow the shared style guide (tokens.json). */

@font-face { font-family: "Newsreader"; src: url("assets/fonts/Newsreader-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("assets/fonts/Newsreader-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/Inter-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --ink: #1A1519;
  --paper: #FFFFFF;
  --field: #4B0F3A;
  --wash: #F4EFF3;
  --plum: #875D7B;
  --mauve: #C3A9BC;
  --lilac: #E3D7E0;
  --graphite: #5C555A;
  --hairline: #BFB8BD;

  --display: "Newsreader", Georgia, serif;
  --text: "Inter", Arial, sans-serif;

  /* Slide proportions: 0.9 in margins on 13.33 in, headline at 0.8 in, ground line at 6.2 of 7.5 in. */
  --side: max(16px, 6.75vw);
  --top: max(48px, 10.7svh);
  --ground: max(72px, 17.3svh);

  --size-cover: clamp(2.2rem, 3.9vw, 3.6rem);
  --size-statement: clamp(2rem, 4.4vw, 4.2rem);
  --size-headline: clamp(2rem, 3.7vw, 3.5rem);
  --size-subhead: clamp(1.3rem, 1.7vw, 1.6rem);
  --size-body: clamp(1.0625rem, 1.2vw, 1.25rem);
  --size-note: clamp(0.875rem, 0.95vw, 0.9375rem);
  --size-running: 0.8125rem;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--size-body)/1.55 var(--text);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: underline; text-decoration-color: var(--hairline); text-decoration-thickness: 1px; text-underline-offset: 0.25em; transition: color .2s, text-decoration-color .2s; }
a:hover { color: var(--field); text-decoration-color: var(--field); }
a:focus-visible { outline: 2px solid var(--field); outline-offset: 4px; border-radius: 2px; }

.headline, .section-num, .service-name, .person h3, .number, .ledger .name, .ledger .n, .words {
  font-family: var(--display);
  font-weight: 400;
  font-variant-numeric: lining-nums;
}
.headline { font-size: var(--size-headline); line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; max-width: 15em; }
p, li { text-wrap: pretty; }
.figure .label, .cover .subtitle { text-wrap: balance; }

/* ---------- Scenes ---------- */

.scene { position: relative; }
.frame {
  position: relative;
  min-height: 100svh;
  padding: var(--top) var(--side) var(--ground);
  display: grid;
  grid-template-columns: 34.7fr 43.3fr 22fr;
  grid-template-rows: auto 1fr auto;
  column-gap: 2.2vw;
}
.head { grid-column: 1 / -1; grid-row: 1; }
.section-num { font-size: var(--size-subhead); color: var(--plum); margin-bottom: 0.6em; }

.field { background: var(--field); color: var(--paper); }
.field a { text-decoration-color: var(--mauve); }
.field a:hover { color: var(--lilac); text-decoration-color: var(--lilac); }
.field a:focus-visible { outline-color: var(--paper); }

.drawing { pointer-events: none; user-select: none; }

/* Cover */
.cover .headline { font-size: var(--size-cover); line-height: 1.08; max-width: 12em; }
.cover .head { grid-column: 1 / 3; align-self: end; grid-row: 3; position: relative; z-index: 1; }
.cover .subtitle { margin-top: 1.4em; max-width: 30em; color: var(--lilac); }
.cover .drawing { grid-column: 2 / -1; grid-row: 1 / 4; justify-self: end; align-self: end; height: min(62svh, 46vw); width: auto; margin-bottom: calc(var(--ground) * -0.25); }
.cover .cue { position: absolute; right: var(--side); bottom: calc(var(--ground) * 0.33); font-size: var(--size-note); color: var(--mauve); }

/* Statement */
.statement .frame { align-items: end; }
.statement .words { grid-column: 1 / 3; grid-row: 3; font-size: var(--size-statement); line-height: 1.14; letter-spacing: -0.01em; max-width: 17em; text-wrap: pretty; }
.statement .mark { font-style: normal; color: var(--field); }

/* Services */
.service .drawing { grid-column: 1; grid-row: 2 / 4; align-self: end; justify-self: start; height: min(52svh, 30vw); width: auto; }
.service .body { grid-column: 2; grid-row: 3; align-self: end; max-width: 30em; }
.service .service-name { font-size: var(--size-subhead); color: var(--ink); margin-bottom: 0.5em; }
.note { grid-column: 3; grid-row: 3; align-self: end; font-size: var(--size-note); color: var(--graphite); }
ul.note li { padding: 0.55em 0; border-top: 0.5px solid var(--hairline); }
ul.note li:last-child { border-bottom: 0.5px solid var(--hairline); }
.note .term { display: block; color: var(--ink); margin-bottom: 0.2em; }

/* Steps */
.steps .body { grid-column: 2 / 4; grid-row: 3; align-self: end; max-width: 46em; }
.steps .intro { max-width: 34em; margin-bottom: 2em; }
.ledger li { display: grid; grid-template-columns: 2.2em 11em 1fr; gap: 0 1.2em; padding: 0.9em 0; border-top: 0.5px solid var(--hairline); align-items: baseline; }
.ledger li:last-child { border-bottom: 0.5px solid var(--hairline); }
.ledger .n { color: var(--graphite); font-size: var(--size-subhead); }
.ledger .name { font-size: var(--size-subhead); line-height: 1.2; transition: color .4s; }
.ledger .text { font-size: var(--size-note); color: var(--graphite); line-height: 1.5; }

/* Key figure */
.figure .body { grid-column: 1 / 3; grid-row: 3; align-self: end; }
.figure .number { font-size: clamp(5.5rem, 15vw, 13rem); line-height: 0.9; color: var(--field); letter-spacing: -0.02em; }
.figure .label { margin-top: 0.6em; font-size: var(--size-subhead); font-family: var(--display); }

/* Team */
.team .people { grid-column: 2 / 4; grid-row: 3; align-self: end; display: grid; grid-template-columns: 1fr 1fr; gap: 3vw; }
.person h3 { font-size: var(--size-subhead); }
.person .role { color: var(--graphite); font-size: var(--size-note); margin: 0.2em 0 0.9em; }
.person p:not(.role) { font-size: var(--size-note); line-height: 1.55; margin-bottom: 1em; max-width: 26em; }
.person a { font-size: var(--size-note); }

/* Close */
.close .head { grid-column: 1 / 3; }
.close .headline { max-width: 11em; }
.close .body { grid-column: 1 / 3; grid-row: 3; align-self: end; max-width: 28em; color: var(--lilac); }
.close .links { margin-top: 1.4em; }
.close .links li { padding: 0.55em 0; border-top: 0.5px solid var(--plum); }
.close .links li:last-child { border-bottom: 0.5px solid var(--plum); }
.close .links a { color: var(--paper); }
.close .drawing { grid-column: 3; grid-row: 1 / 4; justify-self: end; align-self: end; height: min(60svh, 34vw); width: auto; }

/* Running line: the firm as a line of type, lower left; the section, lower right. */
.foot {
  position: absolute; left: var(--side); right: var(--side); bottom: calc(var(--ground) * 0.33);
  display: flex; justify-content: space-between; align-items: baseline; gap: 1em;
  font-size: var(--size-running); line-height: 1.2;
}
.foot .firm { font-weight: 700; }
.foot .where { color: var(--graphite); }
.field .foot .where { color: var(--mauve); }

/* ---------- Motion (only when the visitor allows it and scripts run) ---------- */

.motion .pinned { height: var(--length, 220svh); }
.motion .pinned > .frame { position: sticky; top: 0; height: 100svh; min-height: 0; }
.motion .statement { --length: 230svh; }
.motion .steps { --length: 340svh; }
.motion .figure { --length: 170svh; }

.motion .drawing { clip-path: inset(calc((1 - var(--grow, 0)) * 100%) -10% 0 -10%); }
.motion .cover .drawing { animation: grow 2.2s cubic-bezier(.3, .6, .2, 1) .2s both; clip-path: none; }
@keyframes grow { from { clip-path: inset(100% -10% 0 -10%); } to { clip-path: inset(0 -10% 0 -10%); } }
.motion .cover .headline { animation: rise 1.2s cubic-bezier(.3, .6, .2, 1) both; }
.motion .cover .subtitle { animation: rise 1.2s cubic-bezier(.3, .6, .2, 1) .35s both; }
.motion .cover .cue { animation: rise 1s ease .9s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.motion .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s cubic-bezier(.3, .6, .2, 1), transform .7s cubic-bezier(.3, .6, .2, 1); }
.motion .reveal.on { opacity: 1; transform: none; }
.motion .cover .reveal { opacity: 1; transform: none; }

.motion .words .w { color: var(--lilac); transition: color .35s; }
.motion .words .w.on { color: var(--ink); }
.motion .words .mark .w.on { color: var(--field); }

.motion .ledger li.current .name, .motion .ledger li.current .n { color: var(--field); }

/* ---------- Phones and narrow windows ---------- */

@media (max-width: 820px) {
  :root { --top: 56px; --ground: 88px; }
  .frame { grid-template-columns: 1fr; grid-template-rows: auto; row-gap: 28px; align-content: start; }
  .frame > :not(.foot) { grid-column: 1 !important; grid-row: auto !important; }
  .headline { max-width: none; }

  .motion .pinned { height: auto; }
  .motion .pinned > .frame { position: relative; height: auto; min-height: 100svh; }

  .cover .frame { align-content: end; }
  .cover .drawing { order: -1; justify-self: end; height: 40svh; margin: 0 -8px 0 0; }
  .cover .cue { display: none; }

  .statement .frame { align-content: center; }

  .service .frame { align-content: end; }
  .service .drawing { order: 1; height: 30svh; }
  .service .body { order: 2; }
  .service .note { order: 3; }

  .steps .frame, .figure .frame, .team .frame, .close .frame { align-content: end; }
  .ledger li { grid-template-columns: 1.8em 1fr; }
  .ledger .text { grid-column: 2; margin-top: 0.3em; }

  .team .people { grid-template-columns: 1fr; gap: 36px; }

  .close .drawing { order: -1; justify-self: end; height: 32svh; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
