/* kfhiggs.com card. Tokens match cv.kfhiggs.com (site/style.css). The layout borrows from a newspaper front page. */
:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.09);
  --rule: #1d1d1f;
  --blue: #2424b8;
  --blue-soft: rgba(36, 36, 184, 0.07);
  --red: #d7262e;
  --accent: var(--blue);
  --on-accent: #ffffff;
  --well: #f2f2f5;
  --shadow: 0 1px 2px rgba(16, 16, 60, 0.05), 0 12px 32px -16px rgba(16, 16, 60, 0.22);
  --band: #1b1b8c;
  --band-text: #ffffff;
  --band-muted: rgba(255, 255, 255, 0.72);
  --panel: #0c0d16;
  --panel-text: #f5f5f7;
  --panel-muted: #a3a6b4;
  --panel-accent: #9a9aff;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --gutter: max(16px, env(safe-area-inset-left));
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --r-card: 20px; --r-chip: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090d;
    --surface: #14141b;
    --text: #f5f5f7;
    --muted: #a1a1aa;
    --line: rgba(255, 255, 255, 0.1);
    --rule: #f5f5f7;
    --blue: #9a9aff;
    --blue-soft: rgba(154, 154, 255, 0.1);
    --red: #ff5e64;
    --on-accent: #09090d;
    --well: #1d1d26;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 16px 40px -20px rgba(0, 0, 0, 0.8);
    --band: #15155f;
    --panel: #101120;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 100%/1.55 var(--sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* Masthead */
.mast {
  position: relative; overflow: hidden;
  padding: clamp(20px, 3vw, 32px) 0 clamp(40px, 5vw, 64px);
  background:
    radial-gradient(36rem 24rem at 96% 0%, color-mix(in srgb, var(--red) 11%, transparent), transparent 70%),
    radial-gradient(48rem 30rem at 72% 0%, var(--blue-soft), transparent 70%);
}
.folio {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px;
  padding: 10px 0; border-top: 3px double var(--rule); border-bottom: 1px solid var(--rule);
  font: 0.75rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.folio ul { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.folio li { margin: 0; }
.folio a { color: var(--text); }

.plate {
  display: flex; align-items: center; gap: clamp(16px, 3vw, 36px);
  padding: clamp(28px, 5vw, 56px) 0 clamp(24px, 4vw, 40px); border-bottom: 1px solid var(--line);
}
.portrait {
  flex: none; display: block; width: clamp(76px, 12vw, 152px); height: auto; aspect-ratio: 1; border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line), 0 0 0 5px var(--bg), 0 0 0 6px color-mix(in srgb, var(--blue) 35%, transparent), 0 14px 30px -12px rgba(20, 20, 120, 0.45);
}
h1 {
  font-size: clamp(2.5rem, 9vw, 7rem); line-height: 0.92; letter-spacing: -0.045em;
  font-weight: 780; margin: 0;
}
.headline {
  font-size: clamp(1rem, 2vw, 1.4375rem); line-height: 1.3; letter-spacing: -0.01em;
  color: var(--muted); margin: 12px 0 0; font-weight: 500;
}

.deck {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px); align-items: end; padding-top: clamp(24px, 4vw, 40px);
}
.lede {
  margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.875rem); line-height: 1.3; letter-spacing: -0.018em;
  font-weight: 500; text-wrap: pretty;
}
.actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font: 600 1rem/1 var(--sans); text-decoration: none;
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--blue) 80%, transparent);
  transition: transform 0.2s var(--ease), filter 0.2s;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn:active { transform: scale(0.97); transition-duration: 0.1s; }
.btn.ghost {
  background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent);
}
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.9375rem; }
.links li { margin: 0; }

/* Sections */
.sec { padding: clamp(64px, 9vw, 112px) 0; }
.sec + .sec { padding-top: 0; }
.kicker {
  display: flex; align-items: center; gap: 10px;
  font: 600 0.75rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); margin: 0 0 14px;
}
.kicker::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: currentColor; }
h2 {
  font-size: clamp(1.875rem, 4.6vw, 3rem); line-height: 1.05; letter-spacing: -0.035em;
  margin: 0 0 clamp(28px, 4vw, 48px); font-weight: 750; text-wrap: balance; max-width: 24ch;
}
h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.015em; margin: 0; font-weight: 700; }

/* Pillars: three newspaper columns with rules between them */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.pillar { padding: 24px clamp(20px, 3vw, 36px) 8px; }
.pillar:first-child { padding-left: 0; }
.pillar:last-child { padding-right: 0; }
.pillar + .pillar { border-left: 1px solid var(--line); }
.dek { margin: 6px 0 18px; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 1.0625rem; line-height: 1.4; }
.lead-item { margin: 0 0 10px; font-weight: 650; }
.ticks { list-style: none; margin: 0; padding: 0; color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.ticks li { position: relative; margin: 0 0 12px; padding-left: 18px; line-height: 1.5; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; }
.chips li {
  margin: 0; padding: 5px 9px; border-radius: var(--r-chip); background: var(--well);
  font-size: 0.8125rem; line-height: 1.25; box-shadow: inset 0 0 0 1px var(--line);
}

/* Scale band */
.band {
  position: relative; overflow: hidden; background: var(--band); color: var(--band-text);
  padding: clamp(48px, 7vw, 88px) 0;
}
.band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(40rem 20rem at 100% 0%, color-mix(in srgb, #ff2b33 30%, transparent), transparent 70%);
}
.band .wrap { position: relative; }
.band .kicker { color: #ff8a8f; margin-bottom: 28px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.stat { display: flex; flex-direction: column; gap: 6px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.22); }
.stat .v {
  font-size: clamp(2.5rem, 4.2vw, 3.75rem); line-height: 1; letter-spacing: -0.045em; font-weight: 750;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat .l { font: 600 0.9375rem/1.4 var(--sans); }
.stat .w { font: 0.75rem/1.45 var(--mono); color: var(--band-muted); }

/* Featured work */
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.work {
  display: flex; flex-direction: column; padding: clamp(22px, 3vw, 32px); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.work p { margin: 10px 0 18px; color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.where { font: 600 0.6875rem/1 var(--mono) !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted) !important; margin: 0 0 10px !important; }
.work .chips { margin-bottom: 20px; }
.fromto {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: auto 0 0 !important;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.fromto .k { flex-basis: 100%; font: 0.75rem/1.4 var(--mono); color: var(--muted); }
.fromto s { color: var(--muted); text-decoration-color: color-mix(in srgb, var(--red) 70%, transparent); text-decoration-thickness: 2px; }
.fromto .arrow { color: var(--muted); }
.fromto strong { font-size: 1.375rem; letter-spacing: -0.02em; color: var(--text); }
.flows { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.flows li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 0.875rem; }
.node {
  padding: 5px 10px; border-radius: 8px; font-weight: 600; background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 35%, transparent); color: var(--text);
}
.via { color: var(--muted); font: 0.75rem/1.3 var(--mono); }
.via::after { content: " →"; }
.flows li:last-child .via::after { content: ""; }
.cfoot { margin: auto 0 0 !important; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.work.mealie {
  grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px 32px;
  background: var(--well); box-shadow: inset 0 0 0 1px var(--line);
}
.work.mealie p:not(.where) { margin-bottom: 0; }

/* How I work */
.quote { margin: 0 0 clamp(24px, 4vw, 40px); padding-left: clamp(18px, 3vw, 32px); border-left: 4px solid var(--red); }
.quote blockquote { margin: 0; }
.quote p {
  margin: 0; font-family: var(--serif); font-size: clamp(1.5rem, 3.6vw, 2.625rem); line-height: 1.22;
  letter-spacing: -0.012em; text-wrap: balance; max-width: 34ch;
}
.quote p::before { content: "\201C"; }
.quote p::after { content: "\201D"; }
.quote figcaption { margin-top: 16px; font: 0.8125rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.quote figcaption::before { content: "— "; }
.story { margin: 0; max-width: 40rem; font-size: 1.125rem; line-height: 1.6; color: color-mix(in srgb, var(--text) 86%, var(--muted)); }

/* MegaMind line */
.mm { background: var(--panel); color: var(--panel-text); padding: clamp(28px, 4vw, 40px) 0; }
.mm p { margin: 0; max-width: 52rem; font-size: 1.0625rem; line-height: 1.55; color: color-mix(in srgb, var(--panel-text) 85%, var(--panel-muted)); }
.mm strong { color: var(--panel-text); }
.mm a { color: var(--panel-accent); font-weight: 600; white-space: nowrap; }

/* Footer */
.foot { padding: 32px 0 48px; font-size: 0.875rem; color: var(--muted); }
.foot .in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; border-top: 3px double var(--rule); padding-top: 20px; }
.foot p { margin: 0; color: var(--text); font-weight: 600; }

/* Arrival: the masthead settles in once. Static when motion is reduced. */
@media (prefers-reduced-motion: no-preference) {
  .plate, .deck { animation: settle 0.8s var(--ease) both; }
  .deck { animation-delay: 0.08s; }
  @keyframes settle { from { opacity: 0; transform: translateY(12px); } }
}

@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
}
@media (max-width: 860px) {
  .deck { grid-template-columns: minmax(0, 1fr); }
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .pillar, .pillar:first-child, .pillar:last-child { padding: 24px 0 8px; }
  .pillar + .pillar { border-left: 0; border-top: 1px solid var(--line); }
  .works { grid-template-columns: minmax(0, 1fr); }
  .work.mealie { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
  .flows li { display: grid; justify-items: start; gap: 4px; }
  .via::after { content: ""; }
  .flows li:not(:last-child) .via::before { content: "↓ "; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat .v { white-space: normal; }
}
@media (prefers-contrast: more) {
  :root { --line: currentColor; --muted: var(--text); }
}
@media print {
  .mast, .band, .mm { background: none; color: #000; }
  .btn { box-shadow: none; }
}
