/* davedai.com — requirement-to-release flow sheet.
   Diagram-first: the path from a requirement to a release is the main visual,
   and every project is laid out as requirement -> built -> shipped. */
:root {
  --paper: #f2f4f6;
  --grid: rgba(15, 28, 40, 0.05);
  --ink: #0f1c28;
  --ink-2: #485664;
  --line: #0f1c28;
  --line-soft: #c5ccd4;
  --panel: #e2e7ed;
  --accent: #1543c8;
  --ship: #0a6a48;
  --display: "Archivo", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --body: "IBM Plex Sans", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d141b;
    --grid: rgba(255, 255, 255, 0.04);
    --ink: #e6ebf0;
    --ink-2: #9ba8b4;
    --line: #e6ebf0;
    --line-soft: #2b3742;
    --panel: #17212b;
    --accent: #86a8ff;
    --ship: #5fd0a2;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

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

/* Small literal labels: stage numbers and column heads */
.label {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  margin: 0;
}

/* Masthead */
.mast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 2px solid var(--line);
  font-size: 15px;
}
.mast .who { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; text-decoration: none; white-space: nowrap; }
.mast nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 18px; }
.mast nav a { text-decoration: none; display: inline-block; padding: 6px 0; }
.mast .lang { font-weight: 600; border-bottom: 2px solid var(--accent); }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px 48px; align-items: end; padding: clamp(36px, 7vw, 88px) 0 clamp(28px, 4vw, 48px); }
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(38px, 6.6vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
  max-width: 13ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .avatar { width: 288px; height: 288px; image-rendering: pixelated; image-rendering: crisp-edges; border: 2px solid var(--line); }
.hero .pitch { grid-column: 1 / -1; margin: 0; max-width: 64ch; font-size: clamp(17px, 1.5vw, 20px); }
.hero .where { grid-column: 1 / -1; margin: 0; color: var(--ink-2); font-size: 14px; }

/* The flow: requirement -> release */
.flowsec { border-top: 2px solid var(--line); padding: 20px 0 clamp(40px, 6vw, 72px); }
.flowsec h2, .sec > h2 { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.2; margin: 0 0 20px; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); }
.flow li { position: relative; padding: 14px 18px 0 0; border-top: 4px solid var(--accent); }
.flow li + li { padding-left: 18px; border-left: 1px solid var(--line-soft); }
.flow li:not(:last-child)::after {
  content: "";
  position: absolute; top: -10px; right: -1px;
  border: 8px solid transparent; border-left-color: var(--accent); border-right-width: 0;
  z-index: 1;
}
.flow strong { display: block; font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.15; margin: 2px 0 8px; }
.flow p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.45; }
.flow a { font-size: 14px; font-weight: 600; color: var(--accent); display: inline-block; padding: 4px 0; }
.flow a::before { content: "\2193\00a0"; }

/* Cases: requirement -> built -> shipped */
.cases { border-top: 2px solid var(--line); padding-top: 20px; }
.cases > h2 { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 0 0 4px; }
.cases > .note { margin: 0 0 28px; color: var(--ink-2); max-width: 64ch; }
.case { border-top: 1px solid var(--line); padding: 24px 0 clamp(40px, 5vw, 64px); scroll-margin-top: 16px; }
.case .top { display: grid; grid-template-columns: minmax(0, 672px) 1fr; gap: 20px 32px; align-items: end; margin-bottom: 22px; }
.art { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; border: 2px solid var(--line); background: var(--panel); }
.art.banner { max-width: 672px; margin-bottom: 20px; }
.case header { display: flex; flex-direction: column; gap: 8px; }
.case h3 {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 108%;
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0;
}
.case .meta { margin: 0; color: var(--ink-2); font-size: 14px; }
.trio { display: grid; grid-template-columns: 0.9fr 1.15fr 1fr; gap: 0 44px; }
.trio > div { position: relative; min-width: 0; }
.trio .label { margin-bottom: 8px; }
.trio p { margin: 0 0 10px; }
.trio ul { margin: 0; padding-left: 1.1em; }
.trio li { margin-bottom: 7px; }
.req { background: var(--panel); border-left: 4px solid var(--ink); padding: 14px 16px 6px; align-self: start; }
.req p { font-size: 17px; line-height: 1.45; }
.built, .shipped { padding-top: 14px; }
.built::before, .shipped::before {
  content: "\2192";
  position: absolute; left: -32px; top: 12px;
  font-family: var(--mono); font-size: 18px; color: var(--accent);
}
.shipped .label { color: var(--ship); }
.shipped li::marker { color: var(--ship); }
.go { font-weight: 600; }
.go::after { content: " \2192"; }

/* Generic section with a side heading */
.sec { display: grid; grid-template-columns: 220px 1fr; gap: 24px; border-top: 2px solid var(--line); padding: 20px 0 clamp(40px, 6vw, 72px); }
.sec > h2 { margin: 0; }
.sec > .body { min-width: 0; }

.rows { width: 100%; border-collapse: collapse; }
.rows th, .rows td { text-align: left; vertical-align: top; padding: 12px 20px 12px 0; border-bottom: 1px solid var(--line-soft); }
.rows tr:first-child th, .rows tr:first-child td { padding-top: 0; }
.rows th { width: 13em; font-weight: 600; }
.rows.xp th { width: 8.5em; font-weight: 400; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rows td strong { display: block; font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.25; margin-bottom: 2px; }
.rows td span { display: block; max-width: 66ch; }
.rows td em { font-style: normal; color: var(--ink-2); }
.rows td a { display: block; width: fit-content; margin-top: 6px; font-weight: 600; color: var(--accent); }
.rows td a::after { content: " \2197"; }

.plain { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 40px; }
.plain li { break-inside: avoid; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }

/* Contact */
.contact { border-top: 2px solid var(--line); padding: clamp(36px, 6vw, 72px) 0; }
.contact p { margin: 0 0 10px; color: var(--ink-2); }
.contact .big {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 108%;
  font-size: clamp(21px, 5.6vw, 76px);
  line-height: 1;
  letter-spacing: -0.035em;
  text-decoration: none;
  display: inline-block;
  padding: 4px 0;
}
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding: 14px 0 36px; color: var(--ink-2); font-size: 14px; border-top: 1px solid var(--line-soft); }

/* Chinese pages */
body:lang(zh-Hant) { line-height: 1.7; }
body:lang(zh-Hant) .hero h1 { letter-spacing: -0.01em; line-height: 1.14; font-stretch: 100%; max-width: 9em; }
body:lang(zh-Hant) .case h3, body:lang(zh-Hant) .flow strong { letter-spacing: 0; line-height: 1.25; }
body:lang(zh-Hant) .label { font-family: var(--body); font-size: 13.5px; font-weight: 600; letter-spacing: 0.04em; }

@media (max-width: 980px) {
  .case .top { grid-template-columns: 1fr; }
  .hero .avatar { width: 216px; height: 216px; }
  .flow { grid-template-columns: repeat(3, 1fr); row-gap: 28px; }
  .flow li:nth-child(4) { padding-left: 0; border-left: 0; }
  .flow li:nth-child(3)::after { display: none; }
  .trio { grid-template-columns: 1fr 1fr; gap: 28px 44px; }
  .req { grid-column: 1 / -1; }
  .built::before { content: "\2193"; left: 0; top: -18px; }
  .sec { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero .avatar { width: 144px; height: 144px; grid-row: 1; }
  .mast nav { gap: 2px 14px; font-size: 14px; }
  .flow { grid-template-columns: 1fr; row-gap: 0; }
  .flow li, .flow li + li, .flow li:nth-child(4) { border-top: 0; border-left: 4px solid var(--accent); padding: 2px 0 20px 16px; }
  .flow li::after { display: none !important; }
  .trio { grid-template-columns: 1fr; gap: 26px; }
  .built::before, .shipped::before { content: "\2193"; left: 0; top: -18px; }
  .plain { columns: 1; }
  .rows th, .rows td { display: block; width: auto; padding-right: 0; }
  .rows th, .rows.xp th { border-bottom: 0; padding-bottom: 0; width: auto; }
  .rows td { padding-top: 2px; }
  .rows tr:first-child td { padding-top: 2px; }
}

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