:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfc;
  --navy: #0f1a2e;
  --navy-deep: #0c1525;
  --body: #313c52;
  --slate: #4a5670;
  --muted: #647089;
  --blue: #1668e3;
  --blue-dark: #0c56c7;
  --line: #e4e7ec;
  --line-strong: #d6dae1;
  --on-navy: #b7c2d4;
  --sky: #a4d9e4;
  --font: "Space Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--body); font: 1rem/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { color: var(--navy); overflow-wrap: break-word; }
h1 { font-size: clamp(2.45rem, 5.2vw, 3.875rem); line-height: 1.04; font-weight: 600; letter-spacing: -.04em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.375rem); line-height: 1.12; font-weight: 600; letter-spacing: -.03em; }
h3 { font-size: 1.3rem; line-height: 1.24; letter-spacing: -.02em; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: #d8e3fb; color: var(--navy); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
:where(#main, #work, #concepts, #about, #demo, #case-notes, #mockup) { scroll-margin-top: 5.5rem; }

.shell { width: min(calc(100% - 3rem), 72rem); margin-inline: auto; }
.skip-link { position: fixed; inset: .75rem auto auto .75rem; z-index: 10; transform: translateY(-150%); padding: .6rem 1rem; background: var(--navy); color: white; border-radius: .4rem; }
.skip-link:focus { transform: none; }

.system-bar { background: var(--navy); color: #cbd5e6; font: 500 .73rem/1.25 var(--mono); text-transform: uppercase; letter-spacing: .055em; }
.system-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 30px; }
.system-inner span:first-child { display: flex; align-items: center; gap: .6rem; }
.system-inner i { width: 6px; height: 6px; border-radius: 50%; background: #52b79b; box-shadow: 0 0 0 3px #52b79b29; }
.site-header { position: sticky; inset: 0 0 auto; z-index: 5; border-bottom: 1px solid var(--line); background: #f4f5f7ee; backdrop-filter: blur(12px); }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.4rem; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; width: fit-content; font-size: .96rem; font-weight: 700; line-height: 1.22; color: var(--navy); }
.brand-mark { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 7px; background: var(--navy); color: white; font: 600 .8rem/1 var(--mono); }
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.site-nav a { color: var(--slate); min-height: 2.65rem; display: inline-flex; align-items: center; font-size: .94rem; font-weight: 600; }
.site-nav a:hover { color: var(--blue-dark); }
.header-inner > button { justify-self: end; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.8rem; padding: .62rem 1rem; border: 1px solid transparent; border-radius: 7px; font-size: .95rem; font-weight: 600; line-height: 1.25; text-align: center; transition: border-color .15s, background .15s, color .15s; }
.button-primary { background: var(--navy); color: white; }
.button-primary:hover { background: #22344f; }
.button-outline { background: var(--surface); color: var(--navy); border-color: var(--line-strong); }
.button-outline:hover { color: var(--blue-dark); border-color: #a2b6d4; background: var(--surface-soft); }
.text-link { color: var(--blue-dark); font-weight: 600; }
.text-link:hover { text-decoration: underline; text-underline-offset: .23em; }

.hero, .detail-hero {
  background-image: linear-gradient(180deg, transparent 35%, var(--bg) 100%), radial-gradient(circle, #dce1e8 1px, transparent 1px);
  background-size: 100% 100%, 26px 26px;
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; padding-block: clamp(3.8rem, 6.5vw, 5rem) clamp(4rem, 8vw, 6rem); }
.hero-copy > p { max-width: 34rem; margin-top: 1.35rem; color: var(--slate); font-size: 1.125rem; line-height: 1.6; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-top: 1.7rem; }
.home-intro { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-block: clamp(2rem, 5vw, 4rem); }
.home-intro p { margin-top: .65rem; color: var(--slate); font-size: clamp(1rem, 1.6vw, 1.22rem); }
#work-grid:empty { display: none; }
.home-footer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.portfolio-home .footer-inner { padding-block: 1rem; }
@media (min-width: 701px) {
  .portfolio-home .header-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 0; }
}

.section { padding-block: clamp(2.9rem, 6.25vw, 5rem); border-top: 1px solid var(--line); }
.work-section { background: #ffffffbd; }
.section-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .9rem; margin-bottom: 1.8rem; }
.section-heading p:not(.eyebrow) { margin-top: .55rem; color: var(--slate); }
.eyebrow { display: flex; align-items: center; gap: .5rem; color: var(--blue-dark); font: 500 .76rem/1.45 var(--mono); text-transform: uppercase; letter-spacing: .065em; }
.eyebrow::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 2px; background: var(--blue); }
.section-heading .eyebrow, .about-section .eyebrow { margin-bottom: .6rem; }

.filters { display: flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.filter { min-height: 2.4rem; padding: .35rem .7rem; border: 0; border-radius: 5px; background: transparent; font-size: .88rem; font-weight: 600; color: var(--slate); }
.filter:hover { color: var(--blue-dark); }
.filter[aria-pressed="true"] { background: #e9f0fb; color: var(--blue-dark); }


.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.concept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-card { min-width: 0; }
.project-link { display: flex; height: 100%; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.project-link:hover { border-color: #a7b9d5; box-shadow: 0 10px 24px -18px #0f1a2e80; }
.card-cover { width: 100%; aspect-ratio: 2.2; object-fit: cover; object-position: center 20%; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.card-body { display: flex; flex: 1; align-items: flex-start; flex-direction: column; gap: .7rem; padding: clamp(1rem, 2.2vw, 1.5rem); }
.card-body p { color: var(--slate); overflow-wrap: anywhere; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.project-type, .project-status, .card-tags { font: 500 .8rem/1.4 var(--mono); }
.project-type { color: var(--blue-dark); }
.project-status { padding: .18rem .38rem; border: 1px solid #cfd9e8; border-radius: 4px; background: #f0f5fc; color: #385780; }
.card-tags { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: .25rem 0; list-style: none; }
.card-tags li { border: 1px solid var(--line); border-radius: 4px; padding: .22rem .4rem; background: var(--surface-soft); color: var(--muted); }
.card-action { margin-top: auto; padding-top: .25rem; color: var(--blue-dark); font-size: .9rem; font-weight: 700; }
.project-link:hover .card-action { text-decoration: underline; text-underline-offset: .2em; }
.empty-state { grid-column: 1 / -1; color: var(--slate); background: var(--surface); padding: 1.25rem; border: 1px dashed var(--line-strong); border-radius: 8px; }

.about-section { display: grid; grid-template-columns: minmax(10rem, .65fr) minmax(0, 1.35fr); gap: 1.5rem; }
.about-copy { display: grid; max-width: 43rem; justify-items: start; gap: 1.15rem; }
.about-copy p { font-size: 1.1rem; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; min-height: 84px; }
.footer-inner .text-link { font-size: .9rem; }

.detail-hero-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); gap: clamp(1.5rem, 6vw, 4.5rem); align-items: center; padding-block: clamp(2.15rem, 4.2vw, 3.5rem) clamp(1.85rem, 4vw, 3.1rem); }
.detail-hero-inner:has(.detail-copy:only-child) { grid-template-columns: minmax(0, 48rem); }
.detail-back { display: inline-flex; align-items: center; font-size: .87rem; margin-bottom: 1.15rem; }
.detail-copy h1 { margin-top: .55rem; font-size: clamp(2.3rem, 5.2vw, 3.65rem); }
.detail-lead { margin-top: .9rem; font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--slate); }
.detail-copy .hero-actions { margin-top: 1.3rem; }
.detail-highlight { min-width: 0; display: grid; gap: .6rem; padding: 1.35rem; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); }
.detail-context h2 { font-size: 1.24rem; line-height: 1.25; }
.scale-context { min-width: 0; display: grid; gap: .4rem; padding-inline-start: 1rem; border-inline-start: 2px solid var(--line-strong); }
.scale-context .case-paragraph { line-height: 1.45; }
.scale-manual summary { width: fit-content; cursor: pointer; color: var(--blue-dark); font-weight: 600; padding-block: .25rem; }
.scale-manual[open] .case-paragraph { margin-top: .25rem; }
.detail-highlight strong { display: block; font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.2; color: var(--navy); overflow-wrap: anywhere; }
.detail-demo { padding-bottom: clamp(2.5rem, 6vw, 4.25rem); }
.case-section { padding-block: clamp(2.1rem, 5vw, 3.75rem); border-top: 1px solid var(--line); background: var(--surface); }
.case-article { display: grid; max-width: 62rem; gap: 1.25rem; }
.case-note { display: grid; gap: .42rem; }
.case-paragraph { color: var(--slate); white-space: pre-line; overflow-wrap: anywhere; }
.case-note > .text-link { justify-self: start; }
@media (min-width: 50rem) {
  .case-note { grid-template-columns: minmax(10rem, 13rem) minmax(0, 43rem); gap: .35rem 2rem; align-items: baseline; }
  .case-note > :not(h3) { grid-column: 2; }
}
.case-image { max-width: 64rem; display: grid; gap: 1rem; overflow-wrap: anywhere; }
.case-image img { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.case-image figcaption { margin-top: .6rem; color: var(--slate); font-size: .94rem; }
.case-error { min-height: 50vh; padding-block: 3rem; display: grid; align-content: start; justify-items: start; gap: 1rem; }

body:has(dialog[open]) { overflow: hidden; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1.1fr .9fr; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { grid-template-columns: 1fr auto; column-gap: .5rem; row-gap: .3rem; padding-block: .65rem .2rem; }
  .header-inner > button { grid-column: 2; grid-row: 1; min-height: 2.5rem; font-size: .82rem; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; }
  .site-nav a { min-height: 2.2rem; }
  .hero-inner, .detail-hero-inner, .about-section { grid-template-columns: 1fr; }
  .hero-inner { gap: 2rem; }
  .hero-copy > p { font-size: 1.04rem; }
  .detail-hero-inner, .detail-hero-inner:has(.detail-copy:only-child) { grid-template-columns: minmax(0, 1fr); }
  :where(#work, #concepts, #about, #demo, #case-notes, #mockup) { scroll-margin-top: 7rem; }
}
@media (max-width: 490px) {
  .system-inner span:last-child { display: none; }
  .brand { font-size: .87rem; gap: .45rem; }
  .button { padding-inline: .7rem; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .section-heading { margin-bottom: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.sr-only, .detail-demo .mp-head { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.site-nav [aria-current="page"] { color: var(--blue-dark); }
.groups-hero { padding-block: clamp(2.5rem, 5vw, 4rem) 2rem; }
.group-filters { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.3rem; }
.group-filter[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: white; }
.group-body { background: var(--surface); padding-block: clamp(1.85rem, 4vw, 3rem); }
.role-projects-layout { display: grid; gap: 2rem; }
.role-resume { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.role-resume summary { width: fit-content; color: var(--blue-dark); font-weight: 700; cursor: pointer; }
.role-resume[open] summary { margin-bottom: 1rem; }
.role-resume-choices { display: flex; flex-wrap: wrap; column-gap: 1rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.role-resume-choices legend, #resume-title { font-weight: 600; }
.group-projects > p { margin-top: .45rem; color: var(--slate); }
.group-project-list { min-width: 0; margin: 1rem 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: .75rem; list-style: none; }
.group-project-row { display: flex; justify-content: space-between; align-items: start; gap: .65rem; padding: .85rem .9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.group-project-copy { min-width: 0; overflow-wrap: anywhere; }
.group-project-copy p { margin-top: .5rem; color: var(--slate); font-size: .94rem; }
.group-project-link { color: var(--blue-dark); font-weight: 700; }
.group-project-link:hover { text-decoration: underline; text-underline-offset: .18em; }
.group-concept-list { display: grid; gap: .4rem; margin: .55rem 0 0; padding-left: 1.2rem; color: var(--slate); }
.resume-choice { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.3rem; padding-inline: .4rem; color: var(--slate); font-size: .86rem; font-weight: 600; cursor: pointer; }
.resume-choice input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--blue-dark); }
.group-output { display: grid; justify-items: start; gap: .65rem; min-width: 0; padding: 1.15rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); }
.group-output h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
.group-output p { color: var(--slate); }
.group-output textarea { display: block; min-width: 0; width: 100%; min-height: 21rem; padding: .8rem; resize: vertical; border: 1px solid var(--line-strong); border-radius: 7px; background: white; color: var(--navy); font: 400 .86rem/1.5 var(--mono); }
.group-output button:disabled { opacity: .57; cursor: default; }
.copy-status:empty { display: none; }
.detail-workflow { padding-bottom: clamp(2.5rem, 6vw, 4.25rem); }
.why-section { border-top: 1px solid var(--line); background: #edf2f9; }
.why-section .shell { display: grid; gap: .7rem; padding-block: clamp(1.7rem, 4vw, 2.75rem); }
.why-section h2 { font-size: clamp(1.4rem, 3.2vw, 2rem); }
.why-section p { max-width: 53rem; }
:where(#workflow, #why-beyond) { scroll-margin-top: 5.5rem; }

@media (max-width: 900px) {
  .header-inner { grid-template-columns: 1fr auto; column-gap: .55rem; row-gap: .3rem; padding-block: .55rem .25rem; }
  .header-inner > button { grid-column: 2; grid-row: 1; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; row-gap: 0; }
  .site-nav a { min-height: 2.2rem; }
  :where(#work, #concepts, #about, #demo, #case-notes, #mockup, #workflow, #why-beyond) { scroll-margin-top: 7rem; }
}
@media (max-width: 820px) {
}
@media (max-width: 420px) {
  .site-nav { column-gap: .75rem; }
  .site-nav a { font-size: .84rem; }
  .group-output textarea { min-height: 24rem; }
}

@media (min-width: 701px) {
  #work-grid:has(> .project-card:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .concept-grid > .project-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
