/* Kasumi Labs site. Colours from kasumi-hq doc/design/tokens.css; rules in
   doc/design/STYLE.md (layout A, "Catalogue", chosen 2026-11-19). */
:root {
  --paper: #F5F3EE;
  --surface: #FFFFFF;
  --ink: #2E2833;
  --brand: #302733;
  --hover: #4A3F50;
  --muted: #6B626F;
  --rule: #DDD6DF;
  --petal: #E8C9CE;
  --focus: #302733;
  --display: "Manrope", system-ui, sans-serif;
  --body: "Libre Franklin", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "Overpass Mono", ui-monospace, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 var(--body);
  font-feature-settings: "kern";
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--display);
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; font-weight: 700; }
h3 { font-weight: 600; }
p { margin: 0; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px), 4vw);
  padding-right: max(16px, env(safe-area-inset-right, 0px), 4vw);
}
@media (min-width: 1300px) { .wrap { padding-left: 48px; padding-right: 48px; } }

.skip {
  position: absolute; left: 16px; top: 0; transform: translateY(-120%);
  background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 10;
}
.skip:focus { transform: translateY(12px); }

/* Header */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; }
.brand { display: inline-block; padding: 6px 0; }
.brand img { width: 150px; height: auto; }
nav { display: flex; gap: 4px 22px; flex-wrap: wrap; font-size: 15px; }
nav a { text-decoration: none; padding: 10px 0; }
nav a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 8px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 16px;
  text-decoration: none; transition: background-color .15s ease;
}
.btn:hover { background: var(--hover); }
.text-link { font-weight: 500; text-underline-offset: 5px; text-decoration-thickness: 1px; padding: 12px 0; }
.text-link:hover { text-decoration-thickness: 2px; }

/* Hero */
.hero { padding-bottom: clamp(56px, 8vw, 104px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(28px, 4.5vw, 64px); align-items: center; padding-top: clamp(8px, 2vw, 24px); }
.hero h1 { font-size: clamp(36px, 4.8vw, 58px); line-height: 1.05; font-weight: 700; margin-bottom: 22px; max-width: 14ch; }
.lede { font-size: clamp(18px, 1.5vw, 20px); max-width: 44ch; margin-bottom: 30px; }
.actions { display: flex; align-items: center; gap: 8px 24px; flex-wrap: wrap; }
.hero-art { margin: 0; border-radius: 4px; overflow: hidden; background: var(--petal); }
.hero-art img { width: 100%; }

/* Sections */
.section { padding-top: clamp(56px, 8vw, 104px); padding-bottom: 0; }
.section:last-of-type { padding-bottom: clamp(56px, 8vw, 104px); }

/* Projects */
.case { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px clamp(24px, 5vw, 72px); border-top: 1px solid var(--ink); padding-top: 28px; margin-top: 32px; }
.case + .case { margin-top: 48px; }
.case h3 { font-size: clamp(21px, 2vw, 25px); line-height: 1.2; margin-bottom: 8px; max-width: 22ch; }
.for { color: var(--muted); font-size: 16px; }
.case-body { display: grid; gap: 18px; }
.facts { margin: 0; border-top: 1px solid var(--rule); }
.facts div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-family: var(--mono); font-size: 14px; letter-spacing: 0; padding-top: 1px; }

/* Services */
.services { display: grid; grid-template-columns: 1fr 1fr; margin-top: 32px; border-top: 1px solid var(--rule); }
.service { display: grid; gap: 14px; align-content: start; padding: 30px clamp(20px, 3vw, 40px) 0 0; }
.service + .service { border-left: 1px solid var(--rule); padding-left: clamp(20px, 3vw, 40px); padding-right: 0; }
.service h3 { font-size: 22px; line-height: 1.25; }
.service ul { margin: 4px 0 0; padding-left: 1.1em; display: grid; gap: 8px; font-size: 16px; }
.service li::marker { color: var(--muted); }

/* In development */
.dev { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 20px clamp(24px, 5vw, 72px); }
.dev h2 { max-width: 18ch; }
.dev-body { display: grid; gap: 18px; }
.stage { display: flex; gap: 14px; align-items: baseline; padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; font-size: 15px; }
.stage-label { font-family: var(--display); font-weight: 600; flex: none; }

/* Steps: numbered because the order matters */
.steps { list-style: none; counter-reset: step; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
.steps li { counter-increment: step; padding: 24px 24px 0 0; display: grid; gap: 8px; align-content: start; }
.steps li + li { padding-left: 24px; border-left: 1px solid var(--rule); }
.steps h3 { font-size: 19px; display: flex; gap: 10px; align-items: baseline; }
.steps h3::before { content: counter(step); font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--muted); }
.steps p { font-size: 16px; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 20px clamp(24px, 5vw, 72px); }
.about-body { display: grid; gap: 16px; max-width: 62ch; }

/* Contact */
.contact { margin-top: clamp(56px, 8vw, 104px); background: var(--petal); padding-top: clamp(48px, 6vw, 80px); }
.contact.section:last-of-type { padding-bottom: clamp(48px, 6vw, 80px); }
.contact-inner { display: grid; gap: 18px; justify-items: start; }
.contact-inner p:first-of-type { max-width: 52ch; }

/* Footer */
.site-footer { background: var(--brand); color: #F5F3EE; }
.foot { display: flex; flex-wrap: wrap; gap: 16px 48px; align-items: flex-start; justify-content: space-between; padding-top: 40px; padding-bottom: 40px; font-size: 14px; }
.foot img { width: 140px; }
.foot a { color: #F5F3EE; text-underline-offset: 4px; }
.mono { font-family: var(--mono); }

/* Narrow screens */
@media (max-width: 880px) {
  .hero-grid, .case, .dev, .about { grid-template-columns: 1fr; }
  .hero h1 { max-width: none; }
  .services { grid-template-columns: 1fr; }
  .service { padding-right: 0; }
  .service + .service { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); margin-top: 30px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(odd) { padding-left: 0; border-left: 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 20px 0 0; border-left: 0; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .stage { flex-direction: column; gap: 4px; }
  nav { gap: 0 18px; }
}

/* Approach facts are sentences, not identifiers: body face, not mono. */
.facts.prose dd { font-family: inherit; font-size: inherit; letter-spacing: normal; }

/* zh-TW: Noto Sans TC for headings and body; CJK glyphs are about 2ch wide, so measures switch to em. */
:root:lang(zh-Hant-TW) {
  --display: "Manrope", "Noto Sans TC", "PingFang TC", sans-serif;
  --body: "Libre Franklin", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}
:lang(zh-Hant-TW) body { line-height: 1.8; }
:lang(zh-Hant-TW) .hero h1 { max-width: 9em; line-height: 1.2; }
:lang(zh-Hant-TW) .lede { max-width: 25em; }
:lang(zh-Hant-TW) .dev h2 { max-width: 9em; }
:lang(zh-Hant-TW) .case h3 { max-width: 12em; }
