/* Ikigai AI Solutions: white paper, black ink, one red signal (a seal's red), Newsreader for display,
   Instrument Sans for everything else. Rules drawn from Hallmark's floor and Impeccable's craft floor:
   every colour and face is a token, hairlines instead of card grids, no eyebrows, one authored motion,
   themed focus, selection and caret. Fonts are self hosted (SIL Open Font License, fonts/). */

@font-face { font-family: "Newsreader"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/newsreader-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/newsreader-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --paper: #ffffff;
  --paper-deep: #f4f4f5;
  --surface: #ffffff;
  --ink: #111111;
  --ink-soft: #3f3f46;
  --ink-mute: #6b6b73;
  --rule: #e4e4e7;
  --rule-strong: #d4d4d8;
  --seal: #c42b1c;
  --seal-ink: #ffffff;
  --seal-soft: #fde8e4;
  --bubble-in: #f1f1f3;
  --bubble-out: #111111;
  --bubble-out-ink: #ffffff;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 18px 40px -24px rgb(0 0 0 / 0.22);

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
  --step-3: clamp(2.5rem, 1.6rem + 3.6vw, 4.4rem);

  --gutter: 16px;
  --max: 1160px;
  --measure: 66ch;
  --radius: 10px;
  --radius-lg: 22px;
  --section: clamp(64px, 9vw, 120px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b0b0c;
    --paper-deep: #141416;
    --surface: #18181b;
    --ink: #f4f4f5;
    --ink-soft: #d4d4d8;
    --ink-mute: #a1a1aa;
    --rule: #27272a;
    --rule-strong: #3f3f46;
    --seal: #ef5a43;
    --seal-ink: #0b0b0c;
    --seal-soft: #3b1712;
    --bubble-in: #232326;
    --bubble-out: #f4f4f5;
    --bubble-out-ink: #0b0b0c;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 18px 40px -24px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}

@media (min-width: 720px) { :root { --gutter: 40px; } }

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
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: 400 var(--step-0)/1.6 var(--font-body);
  caret-color: var(--seal);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--seal); color: var(--seal-ink); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; color: var(--ink); line-height: 1.08; letter-spacing: -0.02em; margin: 0; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); line-height: 1.15; }
h3 { font-size: var(--step-1); line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
strong { font-weight: 600; }

a { color: var(--ink); text-decoration-color: var(--seal); text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: color 160ms ease-out, text-decoration-color 160ms ease-out; }
a:hover { color: var(--seal); }
a:focus-visible, .button:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; border-radius: 4px; }

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

/* Masthead */
.mast { border-bottom: 1px solid var(--rule); }
.mast .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; min-height: 72px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 1rem; }
.mark svg { width: 26px; height: 26px; flex: none; }
.mark svg path { stroke: var(--seal); }
.mark svg circle { fill: var(--seal); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; font-size: var(--step--1); }
.nav a { text-decoration: none; color: var(--ink-soft); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--seal); }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px;
  border-radius: 999px; background: var(--seal); color: var(--seal-ink); font-weight: 600; font-size: 0.98rem;
  text-decoration: none; border: 0; transition: transform 160ms ease-out, filter 160ms ease-out;
}
.button:hover { color: var(--seal-ink); filter: brightness(1.08); }
.button:active { transform: translateY(1px); }
.quiet-link { font-weight: 500; }

/* Hero */
.hero { padding: clamp(40px, 6vw, 84px) 0 clamp(56px, 7vw, 96px); }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 940px) { .hero .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 64px; } }
.hero h1 { max-width: 11ch; }
.hero .lead { font-size: var(--step-1); color: var(--ink-soft); max-width: 30ch; margin: 22px 0 30px; line-height: 1.45; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }

/* The signature: a team member's thread, and the board it lands on */
.scene { position: relative; display: grid; justify-items: center; padding: 8px 0 28px; }
.thread {
  width: min(100%, 360px); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 16px 16px 20px;
}
.thread-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 4px 12px; border-bottom: 1px solid var(--rule); margin-bottom: 12px; font-size: var(--step--1); }
.thread-head b { font-weight: 600; }
.thread-head span { color: var(--ink-mute); }
.msg { max-width: 84%; padding: 9px 13px; border-radius: 18px; font-size: 0.95rem; line-height: 1.4; margin: 8px 0; }
.msg.out { margin-left: auto; background: var(--bubble-out); color: var(--bubble-out-ink); border-bottom-right-radius: 5px; }
.msg.in { background: var(--bubble-in); color: var(--ink); border-bottom-left-radius: 5px; }
.landed {
  width: min(88%, 300px); margin-top: -14px; justify-self: end; position: relative; background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; font-size: 0.92rem;
  animation: land 700ms cubic-bezier(0.16, 1, 0.3, 1) 600ms both;
}
@media (min-width: 940px) { .landed { margin-right: -28px; } }
.landed .col { color: var(--ink-mute); font-size: var(--step--1); margin-bottom: 6px; }
.landed .title { font-weight: 600; line-height: 1.35; }
.landed .who { color: var(--ink-soft); margin-top: 4px; }
@keyframes land { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .landed { animation: none; } }

/* Sections */
.band { padding: var(--section) 0; border-top: 1px solid var(--rule); }
.band.deep { background: var(--paper-deep); }
.band h2 { max-width: 20ch; }
.intro { color: var(--ink-soft); max-width: 46ch; margin-top: 14px; font-size: var(--step-1); line-height: 1.5; }

/* How it works: three stages, each with its own object */
.stages { list-style: none; margin: 48px 0 0; padding: 0; }
.stage { display: grid; gap: 20px 56px; padding: 36px 0; border-top: 1px solid var(--rule); }
.stage:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 860px) { .stage { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; } }
.stage p { color: var(--ink-soft); margin: 12px 0 0; max-width: 40ch; }
.object { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); max-width: 480px; width: 100%; justify-self: start; }
@media (min-width: 860px) { .object { justify-self: end; } }
.said { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.35; margin: 0; }
.said small { display: block; font-family: var(--font-body); font-size: var(--step--1); color: var(--ink-mute); margin-bottom: 8px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; font-size: 0.86rem; }
.board h4 { margin: 0 0 8px; font-size: var(--step--1); font-weight: 500; color: var(--ink-mute); }
.chip { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 9px; line-height: 1.3; margin-bottom: 8px; overflow-wrap: anywhere; }
.chip.new { border-color: var(--seal); box-shadow: inset 0 0 0 1px var(--seal); }
.chip span { display: block; color: var(--ink-mute); margin-top: 3px; }
.alert-text { margin: 0; }
.alert-text small { display: block; color: var(--ink-mute); font-size: var(--step--1); margin-bottom: 8px; }
.alert-text .msg { max-width: 100%; margin: 0; }

/* Trust: three statements on hairlines, the log entry as their object */
.pledges { display: grid; gap: 0 48px; margin-top: 44px; }
@media (min-width: 860px) { .pledges { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pledge { border-top: 2px solid var(--ink); padding: 18px 0 26px; }
.pledge p { color: var(--ink-soft); margin: 10px 0 0; }
.log { margin-top: 28px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; font-size: 0.95rem; max-width: 760px; }
.log q { font-style: normal; }
.log .meta { color: var(--ink-mute); font-size: var(--step--1); }
.log .undo { color: var(--seal); font-weight: 600; }

/* Texting */
.texting { display: grid; gap: 28px 64px; }
@media (min-width: 900px) { .texting { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); } }
.texting p { color: var(--ink-soft); max-width: var(--measure); }
.keys { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 20px; padding: 0; list-style: none; }
.keys li { border: 1px solid var(--rule-strong); border-radius: 8px; padding: 8px 12px; background: var(--surface); font-size: 0.95rem; }
.keys b { font-weight: 600; margin-right: 6px; }

/* Contact */
.contact h2 { max-width: none; }
.address { display: inline-block; margin-top: 22px; font-family: var(--font-display); font-size: clamp(1.6rem, 0.9rem + 3.4vw, 3.6rem); line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.contact p { color: var(--ink-soft); margin-top: 18px; }

/* Long documents */
.doc { padding: clamp(40px, 6vw, 80px) 0 var(--section); }
.doc-grid { display: grid; gap: 32px 72px; margin-top: 40px; }
@media (min-width: 960px) { .doc-grid { grid-template-columns: 220px minmax(0, 1fr); } }
.doc h1 { font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.4rem); }
.doc .updated { color: var(--ink-mute); margin-top: 12px; }
.toc { font-size: var(--step--1); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a { display: block; padding: 5px 0 5px 14px; color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--seal); }
@media (min-width: 960px) { .toc { position: sticky; top: 28px; align-self: start; } }
@media (max-width: 959px) { .toc ol { display: flex; flex-wrap: wrap; gap: 4px 0; border-left: 0; } .toc a { padding: 4px 16px 4px 0; } }
.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.55rem; margin: 2.2em 0 0.6em; scroll-margin-top: 24px; }
.prose > h2:first-child { margin-top: 0; }
.prose > p:first-child { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); }
.prose p, .prose li { color: var(--ink-soft); }
.prose strong { color: var(--ink); }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--seal); }
.kw { width: 100%; border-collapse: collapse; margin: 0 0 1em; }
.kw th, .kw td { text-align: left; vertical-align: top; padding: 12px 0; border-top: 1px solid var(--rule); }
.kw tr:last-child th, .kw tr:last-child td { border-bottom: 1px solid var(--rule); }
.kw th { width: 7.5em; font-weight: 600; color: var(--ink); }
.kw td { color: var(--ink-soft); }

/* Footer */
.foot { border-top: 1px solid var(--rule); padding: 40px 0 56px; font-size: var(--step--1); color: var(--ink-mute); }
.foot .wrap { display: grid; gap: 20px; }
@media (min-width: 760px) { .foot .wrap { grid-template-columns: 1fr auto; align-items: center; } }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { color: var(--ink-soft); text-decoration: none; }
.foot a:hover { color: var(--seal); }
