/* Rakutave — rakutave.com
   Palette: paper, ink, muted, guide (construction-line magenta), rule.
   Type: Archivo (variable: weight + width), self-hosted. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f2f3f5;
  --ink: #151a38;
  --muted: #565c78;
  --guide: #e4007c;
  --guide-text: #c8006d;
  --rule: #d8dbe4;

  --gutter: clamp(20px, 4vw, 56px);
  --max: 1320px;

  --fs-small: 0.875rem;  /* 14 */
  --fs-body: 1.125rem;   /* 18 */
  --fs-h2: 1.3125rem;    /* 21 */
  --fs-lead: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); /* 24 → 36 */

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent);
}
a:hover { text-decoration-color: var(--guide); text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--guide);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 10;
}
.skip:focus { top: 12px; }

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

/* ---------- Header ---------- */

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
}

.home-link {
  font-weight: 800;
  font-stretch: 125%;
  font-size: 1.125rem;
  text-decoration: none;
  letter-spacing: 0.005em;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fs-small);
}
.site-nav a { text-decoration-color: transparent; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { text-decoration-color: var(--guide); }

/* ---------- Hero: wordmark on its construction guides ---------- */

.hero { padding-block: clamp(48px, 9vw, 120px) clamp(40px, 6vw, 80px); }

.mark {
  container-type: inline-size;
  position: relative;
  isolation: isolate;
}

.mark > * {
  /* Wordmark takes 84% of the measure; the rest holds the guide labels. */
  --fs: calc(84cqi / 5.52);
}

.wordmark {
  margin: 0;
  font-size: var(--fs);
  line-height: 1;
  font-weight: 800;
  font-stretch: 125%;
  white-space: nowrap;
  position: relative;
}

.wordmark .l { position: relative; }

/* Vertical guides at every letter boundary, like a spacing view. */
.wordmark .l::before,
.wordmark .l:last-child::after {
  content: "";
  position: absolute;
  top: -0.16em;
  bottom: -0.1em;
  width: 1px;
  background: var(--guide);
  opacity: 0.45;
  z-index: -1;
  transform-origin: top;
}
.wordmark .l::before { left: 0; }
.wordmark .l:last-child::after { right: 0; }

/* Horizontal guides: ascender, x-height, baseline (Archivo metrics at line-height 1). */
.guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.g {
  position: absolute;
  left: calc(-1 * var(--gutter));
  right: calc(-1 * var(--gutter));
  height: 1px;
  background: var(--guide);
  transform-origin: left;
}
.g-asc,
.g-x    { background: color-mix(in srgb, var(--guide) 55%, transparent); }
.g-asc  { top: calc(var(--fs) * 0.110); }
.g-x    { top: calc(var(--fs) * 0.3065); }
.g-base { top: calc(var(--fs) * 0.834); }

.g span {
  position: absolute;
  left: calc(var(--gutter) + 84cqi + 14px);
  bottom: 5px;
  font-size: 0.8125rem;
  line-height: 1;
  color: var(--guide-text);
  white-space: nowrap;
}

.tagline {
  margin: clamp(28px, 4vw, 48px) 0 0;
  max-width: 24ch;
  font-size: var(--fs-lead);
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.tagline .line { display: block; }

@media (prefers-reduced-motion: no-preference) {
  .g { animation: draw-x 1000ms cubic-bezier(0.2, 0.7, 0.1, 1) both; }
  .g-asc  { animation-delay: 0ms; }
  .g-x    { animation-delay: 110ms; }
  .g-base { animation-delay: 220ms; }

  .wordmark .l::before,
  .wordmark .l:last-child::after {
    animation: draw-y 700ms cubic-bezier(0.2, 0.7, 0.1, 1) both;
    animation-delay: calc(260ms + var(--i, 0) * 45ms);
  }
  .wordmark .l:last-child::after { animation-delay: calc(260ms + 8 * 45ms); }

  /* Fade the letters by color only, so the guides inside them keep drawing. */
  .wordmark .ink { animation: ink-color 900ms ease-out 620ms both; }
  .g span { animation: ink 500ms ease-out 1200ms both; }
}

@keyframes draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes ink    { from { opacity: 0; } to { opacity: 1; } }
@keyframes ink-color { from { color: transparent; } to { color: var(--ink); } }

@media (max-width: 640px) {
  .mark > * { --fs: calc(100cqi / 5.52); }
  .g span { display: none; }
}

/* ---------- Content sections ---------- */

main { display: block; }

.section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  padding-block: clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--rule);
}

.section > h2 {
  grid-column: 1 / span 4;
  margin: 0 0 16px;
  font-size: var(--fs-h2);
  line-height: 1.3;
  font-weight: 700;
  font-stretch: 112%;
}

.section > .body {
  grid-column: 5 / span 7;
  max-width: 62ch;
}

.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
.body p { margin: 0 0 1em; }

.services {
  margin: 0;
  display: grid;
  gap: 18px;
}
.services div { display: grid; gap: 2px; }
.services dt { font-weight: 650; }
.services dd { margin: 0; color: var(--muted); }

.project h3 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 800;
  font-stretch: 125%;
}
.project .status {
  margin: 0 0 12px;
  font-size: var(--fs-small);
  color: var(--muted);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 18px;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  align-items: baseline;
}
.steps li::before {
  content: counter(step);
  font-weight: 800;
  font-stretch: 125%;
  color: var(--guide-text);
}

/* ---------- Page header (sub pages) ---------- */

.page-head { padding-block: clamp(48px, 8vw, 104px) clamp(32px, 5vw, 56px); }

.page-title {
  margin: 0;
  font-size: clamp(3rem, 1.5rem + 7vw, 7.5rem);
  line-height: 0.95;
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.01em;
}
.page-title.smaller { font-size: clamp(2.25rem, 1.4rem + 4vw, 4.5rem); line-height: 1.02; }

.lead {
  margin: 24px 0 0;
  max-width: 34ch;
  font-size: var(--fs-lead);
  line-height: 1.22;
  font-weight: 500;
  text-wrap: pretty;
}

.meta {
  margin: 18px 0 0;
  font-size: var(--fs-small);
  color: var(--muted);
}

/* ---------- Policy document ---------- */

.doc {
  border-top: 1px solid var(--rule);
  padding-block: clamp(36px, 5vw, 64px) clamp(48px, 7vw, 96px);
}
.doc .prose { max-width: 66ch; }
.doc h2 {
  margin: 2.2em 0 0.5em;
  font-size: var(--fs-h2);
  line-height: 1.3;
  font-weight: 700;
  font-stretch: 112%;
}
.doc h2:first-child { margin-top: 0; }
.doc p, .doc ul { margin: 0 0 1em; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 0.35em; }
.doc li::marker { color: var(--guide-text); }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 28px 36px;
  font-size: var(--fs-small);
  color: var(--muted);
}
.site-footer p { margin: 0; }

@media (max-width: 820px) {
  .section > h2,
  .section > .body { grid-column: 1 / -1; }
}

@media print {
  .guides, .site-nav { display: none; }
  body { background: #fff; }
}
