/* ==========================================================================
   Kiwito Digital — case study.
   A different identity from the work it presents. The studio has no house
   colour; the client does. Everything here is ink on cool paper, and the only
   colour on the page belongs to the project being shown.
   ========================================================================== */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-var.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Cool neutrals, biased faintly blue-violet — deliberately nothing like the
     green-biased greys of the site being presented. */
  --paper: #f7f7f9;
  --paper-2: #eeeef2;
  --card: #ffffff;
  --ink: #14141a;
  --ink-2: #3b3b46;
  --muted: #70707f;
  --rule: #dedee6;
  --rule-2: #c3c3d0;

  /* The client's colours appear only as specimens. */
  --mm-guide: #04693f;
  --mm-warn: #f2c230;
  --mm-ground: #eff1ed;
  --mm-ink: #111a15;
  --mm-night: #0d1411;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 1080px;
  --column: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101014;
    --paper-2: #17171d;
    --card: #1a1a21;
    --ink: #ececf1;
    --ink-2: #b9b9c6;
    --muted: #85859a;
    --rule: #2a2a34;
    --rule-2: #3d3d4a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #101014;
  --paper-2: #17171d;
  --card: #1a1a21;
  --ink: #ececf1;
  --ink-2: #b9b9c6;
  --muted: #85859a;
  --rule: #2a2a34;
  --rule-2: #3d3d4a;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 380;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

p {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.012em;
  text-wrap: balance;
  color: var(--ink);
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--rule-2);
}

a:hover {
  text-decoration-color: currentColor;
}

img,
svg {
  max-width: 100%;
  display: block;
}

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  text-decoration: none;
}

/* --- Layout ------------------------------------------------------------- */

.sheet {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.col {
  max-width: var(--column);
}

.sec {
  padding-block: clamp(2.75rem, 6vw, 4.75rem);
  border-top: 1px solid var(--rule);
}

.flow > * + * {
  margin-top: 1.15rem;
}

.flow--wide > * + * {
  margin-top: 1.75rem;
}

/* Section head sits in a narrow left column on wide screens — the case study
   is read, not scanned, so the reading column stays fixed and narrow. */
.sec__grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 940px) {
  .sec__grid {
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 3.5rem;
  }
}

.tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.sec__h {
  font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2rem);
  margin-bottom: 1.1rem;
  max-width: 22ch;
}

.sub {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  margin-bottom: 0.35rem;
}

.body {
  color: var(--ink-2);
}

.small {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.55;
}

/* --- Masthead ----------------------------------------------------------- */

.top {
  padding-block: 1.5rem;
}

.top__in {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.top__link {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  color: var(--muted);
  text-decoration: none;
}

.top__link:hover {
  color: var(--ink);
}

/* --- Title block -------------------------------------------------------- */

.title {
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
}

.title__no {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.title__h {
  font-size: clamp(2.5rem, 1.6rem + 4vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.028em;
  max-width: 14ch;
}

.title__deck {
  margin-top: 1.5rem;
  font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.4375rem);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 44ch;
}

.facts {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.25rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}

.facts dt {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.facts dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

/* --- Site preview frame ------------------------------------------------- */

.frame {
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  overflow: hidden;
  background: var(--mm-ground);
  box-shadow: 0 24px 60px -32px rgb(20 20 26 / 0.35);
}

.frame__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
}

.frame__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rule-2);
}

.frame__url {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
}

.frame iframe {
  display: block;
  width: 100%;
  height: 30rem;
  border: 0;
  background: var(--mm-ground);
}

/* --- Findings ----------------------------------------------------------- */

.findings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
  counter-reset: find;
}

.find {
  display: grid;
  gap: 0.45rem;
  padding-left: 2.75rem;
  position: relative;
}

.find::before {
  counter-increment: find;
  content: counter(find, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.28rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* --- Specimens ---------------------------------------------------------- */

.spec {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 780px) {
  .spec--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.swatch {
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: var(--card);
}

.swatch__chip {
  height: 4.5rem;
}

.swatch__meta {
  padding: 0.55rem 0.6rem 0.7rem;
}

.swatch__name {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
}

.swatch__hex {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
  text-transform: uppercase;
}

.swatch__use {
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-2);
}

.typecard {
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1.25rem;
  background: var(--card);
}

.typecard__line {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.typecard__line--sign {
  font-family: "Overpass", Helvetica, Arial, sans-serif;
  font-weight: 800;
}

.typecard__line--body {
  font-family: "Plex Sans", system-ui, sans-serif;
  font-weight: 500;
}

.typecard__note {
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.5;
  border-top: 1px solid var(--rule);
  padding-top: 0.75rem;
}

.typecard__note b {
  color: var(--ink);
}

@font-face {
  font-family: "Overpass";
  src: url("../fonts/overpass-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Plex Sans";
  src: url("../fonts/plex-sans-var.woff2") format("woff2-variations");
  font-weight: 100 700;
  font-display: swap;
}

/* --- Section-by-section table ------------------------------------------- */

.reasons {
  border-top: 1px solid var(--rule);
}

.reason {
  display: grid;
  gap: 0.3rem 2rem;
  padding-block: 1.15rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 780px) {
  .reason {
    grid-template-columns: 13rem minmax(0, 1fr);
    align-items: baseline;
  }
}

.reason__what {
  font-weight: 600;
  font-size: 1rem;
}

.reason__why {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.55;
}

/* --- Rejected ----------------------------------------------------------- */

.rejects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.rejects li {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.55;
}

.rejects svg {
  margin-top: 0.4rem;
  color: var(--muted);
}

/* --- Measure list ------------------------------------------------------- */

.metrics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.metric {
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1rem;
  background: var(--card);
}

.metric__n {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.metric__t {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.metric__d {
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* --- CTA / colophon ----------------------------------------------------- */

.end {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
}

.end__h {
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.25rem);
  max-width: 20ch;
  margin-bottom: 1rem;
}

.btn-ink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  padding: 0.85rem 1.4rem;
  border-radius: 2px;
  border: 1px solid var(--ink);
}

.btn-ink:hover {
  background: transparent;
  color: var(--ink);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--rule-2);
  border-radius: 2px;
}

.btn-ghost:hover {
  border-color: var(--ink);
}

.end__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.colophon {
  border-top: 1px solid var(--rule);
  padding-block: 2rem 2.75rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.colophon p {
  max-width: 62ch;
}

.colophon p + p {
  margin-top: 0.85rem;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
