:root {
  --blue: #B85A3A;
  --blue-dark: #964428;
  --navy: #1B2230;
  --ink: #1B2230;
  --paper: #F4F1EA;
  --surface: #FCFBF8;
  --soft: #EBE6DC;
  --line: rgba(27, 34, 48, 0.14);
  --muted: #5A6273;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.7 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  letter-spacing: -0.01em;
  word-break: keep-all;
}

h1, h2, h3, h4 {
  line-height: 1.18;
  letter-spacing: -0.04em;
  margin-top: 0;
}

h1 {
  font-size: clamp(2.35rem, 4.8vw, 4.2rem);
  margin-bottom: .45em;
}

h2 {
  font-size: clamp(1.8rem, 3.3vw, 2.7rem);
  margin-bottom: 1.15rem;
}

h3 {
  font-size: clamp(1.32rem, 2.1vw, 1.85rem);
  margin-bottom: .6rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--blue);
  text-underline-offset: .22em;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

figure {
  margin: 0;
}

figcaption, small {
  font-size: .84rem;
  color: var(--muted);
}

figcaption {
  margin-top: .45rem;
}

em {
  color: var(--blue);
  font-style: normal;
}

.eyebrow {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .55rem;
}

.eyebrow span {
  color: var(--blue);
  margin: 0 .4rem;
}

.metrics b,
.case-outcome,
output,
.timeline-period,
.badge {
  font-variant-numeric: tabular-nums;
}

#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--blue);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 25;
  pointer-events: none;
}

[id] {
  scroll-margin-top: 5.5rem;
}

/* Header & 3-Part Floating Pill Navigation */
header {
  position: sticky;
  top: .75rem;
  z-index: 15;
  width: min(1140px, 92%);
  margin: .75rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

header a {
  text-decoration: none;
  pointer-events: auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  background: rgba(252, 251, 248, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .48rem 1.05rem;
  color: var(--ink);
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: -.05em;
  box-shadow: 0 8px 24px rgba(27, 34, 48, 0.08);
  white-space: nowrap;
}

.wordmark > span:first-child {
  color: var(--blue);
}

.wordmark-sub {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--muted);
  padding-left: .65rem;
  margin-left: .55rem;
  border-left: 1px solid var(--line);
}

nav {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem;
  background: rgba(27, 34, 48, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(252, 251, 248, 0.1);
  border-radius: 999px;
  padding: .34rem .42rem;
  font-size: .86rem;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(27, 34, 48, 0.14);
}

nav a {
  color: rgba(244, 241, 234, 0.82);
  padding: .36rem .78rem;
  border-radius: 999px;
  transition: color .15s ease, background .15s ease;
  white-space: nowrap;
}

nav a:hover {
  color: #ffffff;
  background: rgba(252, 251, 248, 0.12);
}

nav a.is-active {
  color: #ffffff;
  background: var(--blue);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--blue);
  color: #ffffff;
  font-size: .86rem;
  font-weight: 700;
  padding: .56rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--blue);
  box-shadow: 0 8px 20px rgba(184, 90, 58, 0.24);
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.header-cta:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-1px);
}

/* Layout Containers */
.hero,
main > section,
.case-intro,
.case-layout,
.case-cover,
.case-nav {
  width: min(1120px, 90%);
  margin-left: auto;
  margin-right: auto;
}

main > section {
  padding: clamp(2.8rem, 5vw, 4.2rem) 0;
  border-bottom: 1px solid var(--line);
}

main > section:last-of-type {
  border-bottom: 0;
}

/* Buttons */
.button,
.button--ghost,
.showcase button,
.copy-btn,
.artifact-trigger,
.archive-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  font: inherit;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  cursor: pointer;
  padding: .72rem 1.35rem;
  border: 1px solid var(--navy);
  border-radius: 999px;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.button {
  background: var(--navy);
  color: #FCFBF8;
}

.button:hover {
  background: var(--blue);
  border-color: var(--blue);
  transform: translateY(-1px);
}

.button--ghost,
.archive-toggle-btn {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.button--ghost:hover,
.archive-toggle-btn:hover {
  background: var(--soft);
  border-color: var(--blue);
  color: var(--blue-dark);
  transform: translateY(-1px);
}

.artifact-trigger {
  padding: .38rem .85rem;
  font-size: .8rem;
  border-color: rgba(184, 90, 58, 0.34);
  background: var(--soft);
  color: var(--blue-dark);
  margin-top: .75rem;
}

.artifact-trigger:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 4.5%;
  padding: clamp(2.4rem, 5vw, 4.2rem) 0;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 48ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.tool-stack {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  list-style: none;
  padding: 0;
  margin: .95rem 0 1.25rem;
}

.tool-stack li {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 600;
  padding: .28rem .72rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
}

.hero-proof {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4rem;
  font-size: .92rem;
}

.hero-proof li {
  border-left: 2px solid var(--blue);
  padding-left: .85rem;
  margin: .5rem 0;
}

.hero-proof a {
  color: inherit;
  text-decoration: none;
}

.hero-proof a:hover {
  text-decoration: underline;
  color: var(--blue);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}

.showcase {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(27, 34, 48, 0.07);
}

.showcase-top,
.preview-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .8rem 1.2rem;
}

.showcase-top {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

#preview-number {
  font-family: var(--mono);
  letter-spacing: .06em;
  color: var(--blue-dark);
}

.preview-stage {
  height: clamp(240px, 25vw, 330px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .85rem;
  background: #EAE5DA;
  overflow: hidden;
}

#preview-image {
  display: block;
  width: auto;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(27, 34, 48, 0.12);
}

.preview-foot {
  position: relative;
  z-index: 1;
  background: var(--navy);
  color: #FCFBF8;
}

.preview-foot a {
  font-weight: 700;
  color: #FCFBF8;
  text-decoration: none;
}

.preview-foot a:hover {
  color: #E89274;
  text-decoration: underline;
}

.showcase button {
  background: transparent;
  color: #FCFBF8;
  border: 1px solid rgba(252, 251, 248, 0.35);
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  margin-left: .35rem;
}

.showcase button:hover {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

/* Metrics Strip (Deep Slate Navy Rhythm Band) */
.metrics {
  background: var(--navy);
  color: #FCFBF8;
  padding: 1.75rem 0 1.3rem;
  border-top: 1px solid rgba(27, 34, 48, 0.14);
  border-bottom: 1px solid rgba(27, 34, 48, 0.14);
}

.metrics-grid,
.metrics-note {
  width: min(1120px, 90%);
  margin: auto;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.metrics-item {
  padding-left: 1.15rem;
  border-left: 1px solid rgba(252, 251, 248, 0.18);
}

.metrics-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.metrics b {
  display: block;
  color: #E89274;
  font-size: clamp(1.38rem, 2.3vw, 1.95rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: .2rem;
}

.metrics span {
  display: block;
  font-size: .88rem;
  color: #D6D1C7;
}

.metrics-note {
  margin-top: .95rem;
  font-family: var(--mono);
  font-size: .74rem;
  color: #9DA4B3;
  text-align: right;
}

/* Featured Case Studies */
.case-feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(1.3rem, 3vw, 2.35rem);
  margin-top: 2rem;
  box-shadow: 0 4px 18px rgba(27, 34, 48, 0.04);
}

.case-feature-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2.2rem;
  align-items: start;
}

.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-bottom: .5rem;
}

.case-outcome {
  display: block;
  color: var(--blue);
  font-size: clamp(1.1rem, 1.8vw, 1.38rem);
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 1rem;
}

.case-dl {
  margin: 0 0 1.35rem;
}

.case-dl dt {
  font-weight: 700;
  font-size: .88rem;
  color: var(--blue-dark);
  margin-top: .85rem;
}

.case-dl dd {
  margin: .2rem 0 0;
  font-size: .95rem;
  color: var(--ink);
}

.case-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.case-visual {
  min-width: 0;
}

.evidence img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #EAE5DA;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-matrix {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: .82rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.mini-matrix th,
.mini-matrix td {
  text-align: left;
  padding: .52rem .7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.mini-matrix th {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 700;
  background: var(--soft);
}

/* Interactive Decision Tabs */
.decision {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
  background: var(--soft);
}

.decision legend {
  font-family: var(--mono);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0 .45rem;
}

.decision label {
  display: inline-block;
  padding: .38rem .85rem;
  margin: .25rem .3rem .25rem 0;
  border: 1px solid rgba(27, 34, 48, 0.18);
  border-radius: 999px;
  background: var(--surface);
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.decision label:has(:checked) {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

.decision input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.decision p {
  margin: .65rem 0 0;
  font-size: .92rem;
}

/* Interactive Compare Slider */
.compare {
  display: grid;
  grid-template-columns: 1fr 172px;
  align-items: center;
  gap: 1.3rem;
  padding: 1.35rem;
  background: var(--navy);
  color: #FCFBF8;
  border-radius: 10px;
  border: 1px solid rgba(252, 251, 248, 0.1);
  margin-bottom: 1rem;
}

.compare .eyebrow {
  color: #E89274;
}

.compare h4 {
  font-size: 1.2rem;
  margin-bottom: .45rem;
}

.compare p {
  font-size: .86rem;
  color: #D6D1C7;
  margin-bottom: .85rem;
}

.compare label {
  display: block;
  font-size: .8rem;
  color: #C4BEB3;
  margin-bottom: .25rem;
}

.compare input[type="range"] {
  width: 100%;
  accent-color: #E89274;
  cursor: ew-resize;
}

.compare-view {
  --split: 50%;
  position: relative;
  width: 172px;
  aspect-ratio: 9 / 16;
  justify-self: center;
  overflow: hidden;
  border-radius: 8px;
  background: #101520;
  border: 1px solid rgba(252, 251, 248, 0.24);
  cursor: ew-resize;
  touch-action: pan-y;
}

.compare-view img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

#before {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}

.compare-view::after {
  content: "";
  position: absolute;
  left: var(--split);
  top: 0;
  bottom: 0;
  width: 2px;
  background: #FCFBF8;
  pointer-events: none;
}

.compare-handle {
  position: absolute;
  left: var(--split);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FCFBF8;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 2;
}

.compare-tag {
  position: absolute;
  top: 8px;
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 700;
  padding: .16rem .46rem;
  border-radius: 999px;
  background: rgba(27, 34, 48, 0.85);
  color: #FCFBF8;
  pointer-events: none;
  z-index: 2;
}

.compare-tag--before {
  left: 8px;
}

.compare-tag--after {
  right: 8px;
  background: var(--blue);
}

/* Screens & Slide Frames */
.screens,
.slide-frames {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.screens figure,
.slide-frames figure {
  margin: 0;
}

.screens img,
.slide-frames img {
  display: block;
  width: 100%;
  height: clamp(165px, 21vw, 270px);
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(27, 34, 48, 0.06);
}

.screens figcaption,
.slide-frames figcaption {
  text-align: center;
  font-size: .8rem;
}

.metric-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .9rem;
}

.metric-pills span {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .28rem .72rem;
}

/* Skills / How I Work */
.skills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
  margin-top: 1.4rem;
}

.skill-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.3rem;
  box-shadow: 0 2px 10px rgba(27, 34, 48, 0.03);
}

.skill-card small {
  display: block;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: .4rem;
}

.skill-card h3 {
  font-size: 1.12rem;
  margin-bottom: .45rem;
}

.skill-card p {
  font-size: .92rem;
  color: var(--muted);
  margin: 0;
}

.skill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.ai-note {
  background: var(--navy);
  color: #FCFBF8;
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  padding: 1.4rem 1.7rem;
  margin-top: 1.65rem;
}

.ai-note h3 {
  font-size: 1.14rem;
  color: #FCFBF8;
  margin-bottom: .45rem;
}

.ai-note p {
  margin: 0;
  font-size: .95rem;
  color: #D6D1C7;
}

/* Experience Timeline */
.about-lead {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.35rem 1.65rem;
  margin-bottom: 1.85rem;
}

.about-lead p:last-child {
  margin-bottom: 0;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--line);
}

.timeline-item {
  position: relative;
  padding: 0 0 1.45rem 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: .4rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--paper);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem .85rem;
  margin-bottom: .3rem;
}

.timeline-period {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--blue);
}

.timeline-role {
  font-size: 1.06rem;
  font-weight: 800;
}

.timeline-bullets {
  list-style: none;
  margin: .3rem 0 0;
  padding-left: 0;
  color: var(--muted);
  font-size: .94rem;
}

.timeline-bullets li {
  position: relative;
  padding-left: 1rem;
  margin: .24rem 0;
}

.timeline-bullets li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
}

.pm-highlight {
  margin-top: .55rem;
  padding: .75rem 1rem;
  background: var(--soft);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  font-size: .88rem;
  color: var(--ink);
}

.edu-row {
  margin-top: 1.6rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .92rem;
}

/* Archive & Filter */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
}

.group-tabs {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.group-tabs legend {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: .45rem;
}

.group-tabs label {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: .42rem .95rem;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.group-tabs label:has(:checked) {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

.group-tabs input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.status-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  font-weight: 600;
}

select {
  font: inherit;
  padding: .42rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}

#result-count {
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  margin: .45rem 0 .8rem;
}

.lab-note {
  background: var(--soft);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: .75rem 1rem;
  font-size: .9rem;
  margin: 0 0 1.2rem;
}

#products {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1.2rem;
}

#products li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform .18s ease-out, border-color .18s ease-out, box-shadow .18s ease-out;
}

#products li.lab {
  border-color: rgba(184, 90, 58, 0.35);
  background: #FDF9F6;
}

#products li[hidden] {
  display: none;
}

#products li:hover,
#products li:focus-within {
  border-color: var(--blue);
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(27, 34, 48, 0.08);
}

#products li a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

#products img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #EAE5DA;
  padding: .25rem;
  border-bottom: 1px solid var(--line);
}

.card-body {
  padding: .9rem 1.05rem 1.1rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-bottom: .45rem;
}

.card-group {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
}

#products h3 {
  font-size: 1.15rem;
  margin: 0 0 .35rem;
}

#products p {
  font-size: .88rem;
  color: var(--muted);
  margin: 0;
}

.archive-actions {
  margin-top: 1.4rem;
  text-align: center;
}

/* Status Badges */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .18rem .58rem;
  border-radius: 999px;
}

.badge--done {
  background: #F4E0D8;
  color: #8F3D22;
}

.badge--proto {
  background: #EAE5DC;
  color: #394152;
}

.badge--end {
  background: #F2E1E2;
  color: #7C2B32;
}

.badge--live {
  background: #DFEBE4;
  color: #1E543E;
}

.badge--local {
  background: #EAE4F0;
  color: #4A356B;
}

/* Footer */
footer {
  background: var(--navy);
  color: #FCFBF8;
  width: 100%;
  padding: 3rem 0;
  margin-top: 2rem;
}

.footer-inner {
  width: min(1120px, 90%);
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

footer h2 {
  font-size: 1.5rem;
  margin-bottom: .4rem;
}

footer a {
  color: #FCFBF8;
  font-weight: 700;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}

.copy-btn {
  background: transparent;
  color: #FCFBF8;
  border: 1px solid rgba(252, 251, 248, 0.45);
  padding: .45rem 1rem;
  font-size: .86rem;
}

.copy-btn:hover {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

#copy-status {
  font-size: .84rem;
  color: #E89274;
}

.footer-meta {
  font-family: var(--mono);
  font-size: .78rem;
  color: #9DA4B3;
}

/* Case Study Pages */
.case-intro {
  padding: clamp(2.1rem, 5vw, 3.8rem) 0 1.8rem;
  border-bottom: 1px solid var(--line);
}

.case-intro h1 {
  max-width: 20em;
  font-size: clamp(2rem, 4.1vw, 3.3rem);
  margin-bottom: 1.2rem;
}

.case-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 0 0 1.1rem;
}

.case-summary dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem 1rem;
  margin: .9rem 0 0;
  font-size: .94rem;
}

.case-summary dt {
  font-weight: 700;
  color: var(--blue-dark);
}

.case-summary dd {
  margin: 0;
}

.case-cover {
  margin-top: 1.65rem;
  padding: 1rem;
  background: #EAE5DA;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}

.case-cover img {
  display: block;
  max-width: 100%;
  max-height: 460px;
  width: auto;
  margin: auto;
  object-fit: contain;
  border-radius: 6px;
}

.case-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 4.5%;
  padding: 2.2rem 0 3.5rem;
}

.case-layout aside {
  position: sticky;
  top: 5.5rem;
  align-self: start;
  display: grid;
  gap: .45rem;
}

.case-layout aside b {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .25rem;
}

.case-layout aside a {
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
  padding: .28rem .65rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
}

.case-layout aside a:hover,
.case-layout aside a.is-active {
  color: var(--blue-dark);
  font-weight: 700;
  border-left-color: var(--blue);
  background: var(--soft);
}

.case-layout section {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}

.case-layout section:last-child {
  border-bottom: 0;
}

.case-layout h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  margin-bottom: .7rem;
}

.case-layout p {
  max-width: 72ch;
  font-size: 1.01rem;
  line-height: 1.82;
}

/* HTML/CSS Step Flow */
.flow {
  list-style: none;
  padding: 1rem 1.25rem;
  margin: 1.1rem 0;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
}

.flow li {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .45rem .95rem;
  font-size: .9rem;
  font-weight: 600;
}

.flow li::after {
  content: "→";
  color: var(--blue);
  font-weight: 800;
}

.flow li:last-child::after {
  content: "";
  display: none;
}

.flow-step-num,
.case-steps li > span {
  font-family: var(--mono);
  letter-spacing: .04em;
  color: var(--blue);
  font-weight: 800;
  font-size: .8rem;
}

.flow-branch {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
}

.decision-proof,
.slide-evidence {
  background: var(--soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 1.15rem 1.35rem;
  margin: 1.25rem 0;
}

.decision-proof h3,
.slide-evidence h4 {
  font-size: 1.08rem;
  margin-bottom: .5rem;
}

.decision-proof img {
  display: block;
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  margin-top: .75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

/* Gallery 2-Column Grid (1-Column when single figure) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.gallery-grid:has(> figure:only-child) {
  grid-template-columns: minmax(0, 720px);
}

#gallery figure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem;
}

#gallery img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #EAE5DA;
  border-radius: 6px;
  cursor: zoom-in;
}

.decision-proof figure a,
.slide-frames a {
  cursor: zoom-in;
}

.case-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
}

.case-nav a {
  font-weight: 700;
  text-decoration: none;
}

.case-nav a:hover {
  text-decoration: underline;
}

/* Lightbox Modal */
dialog.lightbox {
  width: min(1060px, 94vw);
  max-width: none;
  max-height: 92vh;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(27, 34, 48, 0.45);
}

dialog.lightbox::backdrop {
  background: rgba(27, 34, 48, 0.82);
}

.lightbox-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
}

.lightbox-caption {
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.lightbox-close {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: var(--navy);
  color: #ffffff;
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  margin: auto;
  object-fit: contain;
  background: #EAE5DA;
  border-radius: 6px;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .wordmark-sub {
    display: none;
  }

  .case-feature-grid {
    grid-template-columns: 1fr;
  }

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

  .case-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .case-layout aside {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--line);
  }

  .case-layout aside b {
    width: 100%;
  }

  .case-layout aside a {
    border-left: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: .25rem .45rem;
  }

  .case-layout aside a.is-active {
    border-bottom-color: var(--blue);
  }
}

@media (max-width: 680px) {
  header {
    top: .45rem;
    width: 94%;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .5rem;
  }

  .header-cta {
    display: none;
  }

  .wordmark {
    font-size: 1.15rem;
    padding: .38rem .8rem;
  }

  nav {
    width: 100%;
    justify-content: space-between;
    padding: .28rem .4rem;
    gap: .15rem;
    font-size: .78rem;
  }

  nav a {
    padding: .3rem .48rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.35rem;
    padding: 1.8rem 0;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .9rem .75rem;
  }

  .metrics b {
    font-size: 1.18rem;
  }

  .metrics-item:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .compare {
    grid-template-columns: 1fr;
  }

  .screens,
  .slide-frames,
  .skills,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .screens img,
  .slide-frames img {
    height: auto;
    max-height: 260px;
  }

  /* Compact horizontal cards on mobile to cut scroll fatigue */
  #products {
    grid-template-columns: 1fr;
    gap: .7rem;
  }

  #products li a {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
  }

  #products img {
    height: 100%;
    min-height: 82px;
    aspect-ratio: auto;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }

  .card-body {
    padding: .65rem .85rem;
  }

  .case-summary dl {
    grid-template-columns: 1fr;
    gap: .15rem;
  }

  .case-summary dt {
    margin-top: .5rem;
  }

  .flow {
    flex-direction: column;
    align-items: stretch;
  }

  .flow li {
    justify-content: space-between;
    border-radius: 10px;
  }

  .flow li::after {
    content: "↓";
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
