/* humanai.sg. Colours are sampled from the logo (see CLAUDE.md). */
:root {
  --paper: #F5F2ED;
  --navy: #0F3183;
  --red: #D93B2B;
  --ink: #2B3350;         /* running text: 11.0:1 on paper */
  --muted: #5A5F70;       /* small print: 5.7:1 on paper */
  --sheet: #FFFEFB;
  --sheet-edge: #DED8CE;
  --ink-soft: #7888B8;    /* the drafted lines on the sheet */
  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue",
          Arial, sans-serif;
}

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

html, body { overflow-x: clip; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); font-weight: 600; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 4px; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 1400px;
  margin-inline: auto;
  padding: clamp(24px, 4.5vh, 56px) clamp(20px, 6vw, 88px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(24px, 4vh, 48px);
}

.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.logo { display: block; width: clamp(190px, 22vw, 280px); height: auto; min-width: 0; }

/* Language switch: the current language is plain text, the other one is a link. */
.lang { display: flex; align-items: center; flex: none; font-size: 0.9375rem; font-weight: 600; }
.lang > * { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 10px; }
.lang > :last-child { padding-right: 0; }
.lang > * + *::before {
  content: "";
  width: 1px;
  height: 1.1em;
  margin-right: 10px;
  margin-left: -10px;
  background: var(--muted);
}
.lang-on { color: var(--ink); }

/* Chinese page: Latin letters keep the page's face, Chinese falls to the system's Simplified
   face. Chinese characters fill the line, so the headline needs more leading and no tightening. */
html:lang(zh) {
  --font: "Segoe UI Variable Display", "Segoe UI", -apple-system, "PingFang SC",
          "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC",
          system-ui, sans-serif;
}
html:lang(zh) h1 { line-height: 1.22; letter-spacing: 0.01em; }
html:lang(zh) body { line-height: 1.7; }
html:lang(zh) .services { line-height: 1.3; }

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 3vw, 48px);
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 3.9vw, 3.375rem);
  line-height: 1.06;
  font-weight: 650;
  letter-spacing: -0.022em;
  color: var(--navy);
  text-wrap: balance;
}
h1 span { display: block; }

.vision {
  margin: clamp(18px, 2.6vh, 30px) 0 0;
  max-width: 30em;
  font-size: clamp(1.0625rem, 1.5vw, 1.3125rem);
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 32px;
  color: var(--muted);
  font-size: 0.9375rem;
}
.hero-foot p { margin: 0; }

/* ---------- The stamp ---------- */
.stage-wrap { display: grid; justify-items: center; gap: 18px; }

/* The figure is the sheet plus a margin on each side for the service labels: 606 x 452 against
   the sheet's 316 x 452. --w is the sheet's width. */
.figure {
  --w: clamp(232px, min(21.5vw, 44vh), 300px);
  position: relative;
  width: calc(var(--w) * 606 / 316);
}

/* 1em inside the stage is 10 px of the 316 x 452 design, so everything scales with --w. */
.stage {
  position: relative;
  width: var(--w);
  margin-inline: auto;
  aspect-ratio: 316 / 452;
  font-size: calc(var(--w) / 31.6);
}

/* Leader lines from the labels into the sheet. */
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.leaders path { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round;
                vector-effect: non-scaling-stroke; }
.leaders circle { fill: var(--ink); }

/* The service labels. Each is placed by its bottom edge, which is where its leader starts, so a
   label that wraps to two lines grows upwards. */
.services {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(0.875rem, 1.2vw, 1.0625rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy);
}
/* Anchored 12 units clear of the sheet's edge (133 / 606), growing away from it. */
.services li { position: absolute; max-width: 8.6em; text-wrap: balance; }
.s-l1, .s-l2 { right: 78.05%; text-align: right; }
.s-r1, .s-r2 { left: 78.05%; text-align: left; }
.s-l1 { bottom: 84.5%; }
.s-l2 { bottom: 54.4%; }
.s-r1 { bottom: 75.7%; }
.s-r2 { bottom: 44.7%; }

.sheet {
  position: absolute;
  inset: 0;
  background: var(--sheet);
  border: 1px solid var(--sheet-edge);
  border-radius: 1em;
  box-shadow: 0 1px 2px rgba(60, 50, 30, 0.06), 0 1.8em 3.6em -1.4em rgba(60, 50, 30, 0.34);
}
.sheet-next { opacity: 0; }

.bar, .rule, .caret, .tick, .seal { position: absolute; }
.bar { height: 0.8em; border-radius: 0.3em; background: var(--ink-soft); transform-origin: left center; }

.title { left: 3em; top: 3.4em; width: 15em; height: 1.4em; background: var(--navy); }
.caret { left: 18.6em; top: 3.1em; width: 0.22em; height: 2em; background: var(--red); opacity: 0; }
.sub { left: 3em; top: 6em; width: 9.2em; }

.p { left: 3em; }
.p1 { top: 9.4em; width: 25.6em; }
.p2 { top: 11.2em; width: 24em; }
.p3 { top: 13em; width: 25em; }
.p4 { top: 14.8em; width: 16.8em; }

.rule { left: 3em; width: 25.6em; height: 1px; background: var(--sheet-edge); }
.r0 { top: 18.4em; } .r1 { top: 21.2em; } .r2 { top: 24em; } .r3 { top: 26.8em; }

.label { left: 3em; }
.value { left: 18em; width: 3.4em; }
.l1, .v1 { top: 19.4em; } .l2, .v2 { top: 22.2em; } .l3, .v3 { top: 25em; }
.l1 { width: 11em; } .l2 { width: 9.2em; } .l3 { width: 12.4em; }

.tick { left: 25.9em; width: 1.8em; height: 1.4em; fill: none; stroke: var(--navy);
        stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.t1 { top: 19.1em; } .t2 { top: 21.9em; } .t3 { top: 24.7em; }

.total { left: 18em; top: 28.5em; width: 10.6em; height: 1.2em; background: var(--navy); }

.seal { right: 2.6em; bottom: 3em; width: 9.6em; height: auto; }

.motion-toggle {
  font: inherit;
  font-size: 0.875rem;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 14px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.motion-toggle:hover { color: var(--navy); }
.motion-toggle:active { border-color: var(--sheet-edge); }

/* Two lines, one sentence each, wherever the two columns fit. */
@media (min-width: 821px) { h1 span { white-space: nowrap; } }

/* ---------- One column: the sheet goes under the words ---------- */
@media (max-width: 1079px) {
  .hero-body { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  h1 { font-size: clamp(2.25rem, 5vw, 3.375rem); }
  .figure { --w: clamp(250px, 44vw, 300px); }
  .services { font-size: 0.9375rem; }
}

@media (max-width: 820px) {
  .hero-foot { flex-direction: column; }
}

/* ---------- Phones: no room beside the sheet, so the labels are a list under it ---------- */
@media (max-width: 599px) {
  .figure { --w: clamp(200px, 60vw, 280px); width: 100%; }
  .leaders { display: none; }
  .services {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 22px;
    margin-top: 26px;
  }
  .services li { position: static; max-width: none; text-align: center; }
}

/* ---------- 404 ---------- */
.plain { grid-template-rows: auto 1fr; }
.plain .hero-text { align-self: center; }
