:root {
  --bg: #f5f1ea;
  --surface: #fbf8f2;
  --surface-strong: #f1ebe1;
  --ink: #181513;
  --muted: #655d56;
  --line: #d7cec0;
  --accent: #294f47;
  --max: 1080px;
  --radius: 12px;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --step-xs: 11px;
  --step-sm: 12px;
  --step-base: 13px;
  --step-md: 14px;
  --step-lg: 15px;
  --step-xl: clamp(24px, 2.4vw, 30px);
  --step-2xl: clamp(20px, 2vw, 25px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.screen-page {
  min-height: 100svh;
  overflow: hidden;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 1000;
  padding: 8px 10px;
  color: #fff;
  background: var(--ink);
}

.site-shell {
  max-width: var(--max);
  height: 100svh;
  margin: 0 auto;
  padding: 14px 16px 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.site-brand {
  display: grid;
  gap: 2px;
}

.site-brand-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.site-kicker,
.eyebrow,
.meta-label,
.fact-label,
.chat-message-label,
.chat-prompt-heading,
.timeline-date,
.brand-group-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.site-title {
  font-size: var(--step-base);
  color: var(--muted);
}

.site-brand-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: var(--step-sm);
  color: var(--muted);
}

.site-brand-contact a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.site-brand-contact a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.icon-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-link {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  background: transparent;
}

.icon-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-link:hover,
.icon-link[aria-current="page"] {
  color: var(--ink);
  background: var(--surface);
}

.utility-link {
  font-size: var(--step-sm);
  color: var(--muted);
  text-decoration: none;
}

.utility-link:hover {
  color: var(--ink);
}

.screen {
  min-height: 0;
}

.screen-frame {
  height: 100%;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  overflow: hidden;
}

.profile-frame,
.contact-frame {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 18px;
}

.work-frame,
.resume-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.86fr);
  gap: 12px;
}

.screen-copy {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
}

.screen-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.screen-head--work {
  align-items: end;
  gap: 18px;
}

.work-headline {
  display: grid;
  gap: 4px;
}

.screen-head--work .eyebrow {
  margin: 0;
}

.screen-head--work .screen-title {
  max-width: 26ch;
  font-size: var(--step-lg);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.screen-title {
  margin: 0;
  font-size: var(--step-xl);
  line-height: 1.03;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.screen-subtitle {
  margin: 0;
  max-width: 36ch;
  font-size: var(--step-lg);
  line-height: 1.4;
  color: var(--ink);
  text-wrap: balance;
}

.screen-summary {
  margin: 0;
  max-width: 58ch;
  font-size: var(--step-base);
  line-height: 1.58;
  color: var(--muted);
  text-wrap: pretty;
}

.profile-list {
  display: grid;
  gap: 10px;
  margin: 2px 0 0;
}

.profile-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.profile-item p,
.meta-block p,
.timeline-row p,
.evidence-list dd,
.brand-label,
.brand-wall-note {
  margin: 0;
  font-size: var(--step-base);
  color: var(--muted);
}

.brand-label {
  font-size: 10px;
  line-height: 1.25;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 2px;
}

.metric {
  display: grid;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.metric strong {
  font-size: 20px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.metric span {
  max-width: 22ch;
  font-size: var(--step-xs);
  color: var(--muted);
}

.profile-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.rail-note {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.rail-note p {
  margin: 0;
  font-size: var(--step-md);
  color: var(--muted);
}

.rail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.rail-links a,
.meta-block a,
.action-inline a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.rail-links a:hover,
.meta-block a:hover,
.action-inline a:hover {
  border-bottom-color: var(--ink);
}

.chat-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f4ec;
}

.chat-head {
  display: grid;
  gap: 4px;
}

.chat-head h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 600;
}

.chat-head p {
  margin: 0;
  font-size: var(--step-base);
  color: var(--muted);
  text-wrap: pretty;
}

.chat-prompts {
  display: grid;
  gap: 8px;
}

.chat-prompt-heading {
  color: var(--muted);
}

.chat-prompt-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-prompt {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--step-sm);
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.chat-prompt:hover {
  color: var(--ink);
  background: var(--surface);
}

.chat-log {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 4px;
}

.chat-message {
  display: grid;
  gap: 4px;
}

.chat-message-body {
  padding: 10px 11px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: var(--step-base);
  line-height: 1.52;
  text-wrap: pretty;
}

.chat-message.user .chat-message-body {
  background: #ece5d9;
  color: var(--ink);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-input {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent);
}

.chat-send {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.chat-send:hover {
  background: var(--surface);
}

.chat-status {
  margin: 0;
  font-size: var(--step-sm);
  color: var(--muted);
}

.meta-stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

.meta-block {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.work-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.work-tab {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--step-sm);
}

.work-tab[aria-selected="true"] {
  color: var(--ink);
  background: #eee7dc;
}

.work-panel-set {
  min-height: 0;
}

.work-panel {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 0.88fr) minmax(0, 1.12fr);
  gap: 18px;
}

.work-panel[hidden] {
  display: none !important;
}

.work-panel-copy {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.process-graphic {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    radial-gradient(circle at top left, rgba(41, 79, 71, 0.06), transparent 32%),
    linear-gradient(180deg, #fbf8f2 0%, #f5f0e7 100%);
}

.process-head {
  display: grid;
  gap: 4px;
}

.process-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.process-head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.process-step {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 248, 242, 0.88);
}

.process-index {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--surface);
}

.process-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f0e9de;
  color: var(--accent);
}

.process-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.process-step h3 {
  margin: 0 0 2px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
}

.process-step p {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

.process-arrow {
  display: none;
}

.process-impact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
}

.process-impact span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  background: rgba(251, 248, 242, 0.9);
}

.work-meta,
.micro-metrics,
.action-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.work-meta span,
.micro-metrics span {
  font-size: var(--step-xs);
  color: var(--muted);
}

.work-panel-copy h2 {
  margin: 0;
  font-size: var(--step-2xl);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
  max-width: 17ch;
}

.evidence-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.evidence-list div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.evidence-list dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.evidence-list dd {
  text-wrap: pretty;
}

.resume-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
}

.resume-summary,
.timeline-compact {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.compact-stack {
  margin-top: 4px;
}

.timeline-compact {
  display: grid;
  gap: 10px;
  align-content: start;
}

.timeline-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.timeline-row h2 {
  margin: 0 0 2px;
  font-size: var(--step-md);
  font-weight: 600;
}

.brand-wall {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.brand-wall-head {
  display: grid;
  gap: 4px;
}

.brand-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
}

.brand-group {
  display: grid;
  gap: 4px;
  align-content: start;
}

.brand-group-title {
  margin: 0;
}

.brand-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.brand-chip {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 22px;
  padding: 0;
}

.brand-mark {
  min-width: 0;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 48px;
  max-height: 18px;
  object-fit: contain;
  object-position: left center;
}

.brand-logo--icon {
  max-width: 18px;
  max-height: 18px;
}

.brand-logo--tall {
  max-width: 20px;
  max-height: 24px;
}

.brand-logo--wide {
  max-width: 48px;
  max-height: 16px;
}

@media (max-width: 860px) {
  .site-shell {
    padding: 12px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .utility-link {
    display: none;
  }

  .site-brand-row {
    gap: 8px 14px;
  }

  .site-brand-contact {
    gap: 8px 14px;
    font-size: 12px;
  }

  .screen-frame {
    height: 100%;
    min-height: 0;
    padding: 15px;
  }

  .profile-frame,
  .contact-frame,
  .resume-grid,
  .work-panel {
    grid-template-columns: 1fr;
  }

  .profile-frame {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .resume-grid,
  .contact-frame {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .profile-rail {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .work-panel {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .process-graphic,
  .work-panel-copy,
  .resume-summary,
  .timeline-compact,
  .contact-frame .meta-stack {
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
  }

  .screen-title {
    font-size: 27px;
  }

  .screen-head--work .screen-title {
    max-width: 32ch;
    font-size: var(--step-md);
  }

  .brand-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .site-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .screen-frame {
    padding: 14px;
  }

  .screen-head {
    flex-direction: column;
  }

  .screen-head--work {
    align-items: flex-start;
    gap: 10px;
  }

  .profile-item,
  .timeline-row,
  .evidence-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
  }

  .screen-profile .screen-summary,
  .screen-contact .screen-summary,
  .profile-item:nth-of-type(2),
  .chat-head p {
    display: none;
  }

  .screen-title {
    font-size: 24px;
  }

  .screen-head--work .screen-title {
    max-width: none;
    font-size: var(--step-sm);
    line-height: 1.35;
  }

  .work-panel {
    grid-template-rows: minmax(200px, 0.78fr) minmax(0, 1fr);
    gap: 8px;
  }

  .process-graphic {
    gap: 8px;
    padding: 10px;
    overflow: auto;
  }

  .process-head p {
    display: none;
  }

  .process-flow {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .process-step {
    grid-template-columns: auto 26px minmax(0, 1fr);
    gap: 6px;
    padding: 8px;
    align-content: start;
  }

  .process-index {
    width: 20px;
    height: 20px;
    font-size: 8px;
  }

  .process-icon {
    width: 30px;
    height: 30px;
  }

  .process-icon svg {
    width: 18px;
    height: 18px;
  }

  .process-step h3 {
    font-size: 11px;
    line-height: 1.1;
  }

  .process-step p {
    display: none;
  }

  .process-impact span {
    padding: 4px 6px;
    font-size: 9px;
  }

  .work-panel-copy {
    gap: 6px;
    overflow: auto;
    padding-right: 4px;
  }

  .work-panel-copy h2 {
    font-size: 16px;
    line-height: 1.02;
    max-width: none;
  }

  .work-meta,
  .micro-metrics {
    gap: 6px;
  }

  .work-meta span,
  .micro-metrics span {
    font-size: 9px;
  }

  .screen-subtitle,
  .screen-summary,
  .profile-item p,
  .meta-block p,
  .timeline-row p,
  .evidence-list dd,
  .brand-label,
  .brand-wall-note {
    font-size: 13px;
  }

  .screen-work .evidence-list {
    gap: 4px;
  }

  .screen-work .evidence-list div {
    padding-top: 4px;
  }

  .screen-work .evidence-list dt {
    font-size: 8px;
    letter-spacing: 0.14em;
  }

  .screen-work .evidence-list dd {
    font-size: 10px;
    line-height: 1.28;
  }

  .chat-panel {
    padding: 12px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-log {
    gap: 8px;
  }

  .resume-frame {
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.95fr);
  }

  .brand-groups {
    grid-template-columns: 1fr;
  }

  .brand-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
  }

  .brand-chip {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 5px;
  }
}
