/* Marie-Eva Desroses — shared styles for the portfolio and case studies.
   Edit the tokens below to change the palette, type scale, or page width.
   Devicon owns its brand colors; no local rule recolors technology icons. */

:root {
  --navy: #102747;
  --ink: #243b55;
  --blue: #235ccb;
  --blue-hover: #184aa9;
  --sky: #edf5ff;
  --rose: #92516a;
  --blush: #fbf4f7;
  --rose-line: #e8cfda;
  --muted: #536477;
  --line: #dce4ee;
  --surface: #f6f8fb;
  --white: #fff;
  --radius: 12px;
  --container: 74rem;
  --section-space: clamp(3.5rem, 7vw, 5.5rem);
  --shadow: 0 12px 32px rgb(16 39 71 / 6%);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  font-synthesis: none;
}

/* Foundations */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
}

body.modal-open {
  overflow: hidden;
}

button, input, textarea {
  font: inherit;
}

button, a, input, textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .6;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--blue);
}

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

h1, h2, h3, p, pre, figure {
  margin: 0;
}

h1, h2, h3 {
  color: var(--navy);
  line-height: 1.25;
}

h1, h2 {
  letter-spacing: -.035em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 700;
}

h3 {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -.015em;
}

p {
  color: var(--muted);
}

p + p {
  margin-top: 1rem;
}

[hidden] {
  display: none !important;
}

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.container {
  width: min(var(--container), calc(100% - 4rem));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-space);
}

.eyebrow {
  color: var(--blue);
  font-size: .8125rem;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: .875rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2.5rem;
  margin-bottom: 2.25rem;
}

.section-heading > div {
  max-width: 38rem;
}

.section-heading > p {
  max-width: 26rem;
}

.section-intro {
  max-width: 36rem;
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .875rem;
  min-height: 3rem;
  padding: .75rem 1.25rem;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: var(--white);
  font-size: .9375rem;
  font-weight: 650;
  line-height: 1.5;
  text-align: center;
  transition: background .18s, border-color .18s;
}

.button:hover {
  color: var(--white);
  background: var(--blue-hover);
  border-color: var(--blue-hover);
}

.button-outline {
  background: var(--white);
  color: var(--navy);
  border-color: #bbcadd;
}

.button-outline:hover {
  color: var(--blue);
  background: var(--sky);
  border-color: var(--blue);
}

.button-small {
  min-height: 2.75rem;
  padding: .625rem .875rem;
  font-size: .875rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.text-link, .text-button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.75rem;
  color: var(--blue);
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.5;
}

.text-button {
  border: 0;
  background: transparent;
  padding: .5rem 0;
  text-align: left;
}

.text-link:hover, .text-button:hover {
  text-decoration: underline;
  text-underline-offset: .25em;
}

.skip-link {
  position: fixed;
  top: .5rem;
  left: .75rem;
  z-index: 100;
  padding: .75rem 1.5rem;
  transform: translateY(-160%);
  background: var(--navy);
  color: var(--white);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--white);
}

/* Navigation */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgb(255 255 255 / 98%);
  border-bottom: 1px solid #e9eef4;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  color: var(--navy);
  font-size: 1.125rem;
  font-weight: 750;
  letter-spacing: -.03em;
  white-space: nowrap;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 6px;
  background: var(--navy);
  color: var(--white);
  font-size: .875rem;
  letter-spacing: -.06em;
}

.brand-mark span {
  color: #a6ccff;
  margin-inline: 2px;
}

.brand-dot {
  color: var(--rose);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}

.site-nav > a:not(.button) {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-block: .5rem;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 550;
}

.site-nav > a:hover, .site-nav > a[aria-current]:not(.button) {
  color: var(--blue);
}

.site-nav > a[aria-current]:not(.button)::after {
  content: "";
  position: absolute;
  bottom: .25rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.language-toggle {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
}

.language-toggle:hover {
  color: var(--blue);
  background: var(--sky);
}

.menu-toggle {
  display: none;
  align-content: center;
  gap: 4px;
  width: 2.75rem;
  height: 2.75rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}

.menu-toggle span {
  width: 100%;
  height: 2px;
  background: var(--navy);
  transition: transform .18s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* A compact introduction gives the real projects priority. */

.hero {
  padding-block: clamp(3rem, 6vw, 4.75rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  align-items: center;
  gap: 3.5rem;
}

.hero-copy, .code-composition {
  min-width: 0;
}

.hero h1 {
  max-width: 42rem;
  margin-bottom: 1.375rem;
  font-size: clamp(2.5rem, 3.65vw, 3.375rem);
  font-weight: 750;
  line-height: 1.13;
}

.hero h1 > span {
  display: block;
}

.heading-accent {
  color: var(--rose);
}

.hero .eyebrow {
  color: var(--rose);
}

.hero-description {
  max-width: 35rem;
  margin-bottom: 1.75rem;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.code-composition {
  width: 100%;
  max-width: 27rem;
  justify-self: end;
}

.code-window {
  overflow: hidden;
  border: 1px solid #2b415e;
  border-radius: var(--radius);
  background: #10243e;
  color: #e4edf9;
  box-shadow: var(--shadow);
}

.code-tab {
  padding: .8125rem 1.125rem;
  border-bottom: 1px solid #2c415a;
  color: #cbd8e9;
  font: .8125rem/1.5 ui-monospace, Consolas, monospace;
}

.code-tab span {
  margin-right: .5rem;
  color: #9ac2ff;
}

.code-window pre {
  padding: 1.5rem 1rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font: .8125rem/2 ui-monospace, Consolas, monospace;
  counter-reset: line;
  tab-size: 2;
}

.code-line {
  counter-increment: line;
}

.code-line::before {
  content: counter(line);
  display: inline-block;
  width: 1.5rem;
  color: #8aa2bd;
  font-size: .75rem;
}

.syntax-tag {
  color: #a6cbff;
}

.syntax-key {
  color: #d4e5ff;
}

.syntax-value {
  color: #b5dce9;
}

.syntax-comment {
  color: #95aec9;
}

.code-bottom {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem 1.125rem;
  border-top: 1px solid #2c415a;
  color: #bfcee1;
  font-size: .75rem;
}

.code-bottom span span {
  padding-inline: .25rem;
  color: #95aec9;
}

/* Selected work: original screenshots, concise evidence, one main next step. */

.projects-section {
  background: var(--surface);
  border-block: 1px solid #e9eef4;
}

.project-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .875rem 1.5rem;
  margin-bottom: 1.75rem;
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .5rem .9375rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.5;
  transition: background .18s, border-color .18s, color .18s;
}

.filter-button:hover {
  border-color: var(--rose-line);
  background: var(--blush);
}

.filter-button[aria-pressed="true"] {
  border-color: var(--rose);
  background: var(--rose);
  color: var(--white);
}

.filter-count {
  min-width: 1.125rem;
  padding-inline: .25rem;
  border-radius: 999px;
  background: rgb(16 39 71 / 6%);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.filter-button[aria-pressed="true"] .filter-count {
  background: rgb(255 255 255 / 16%);
}

.project-results {
  color: var(--muted);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: box-shadow .18s, border-color .18s;
}

.project-card:hover, .project-card:focus-within {
  border-color: #b5c8e0;
  box-shadow: var(--shadow);
}

/* Projects without supplied screenshots use a complete text presentation. */
.project-card--text {
  grid-column: 1 / -1;
  border-top: 3px solid var(--rose);
}

@media (min-width: 42.501em) {
  .project-card--text .project-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "context focus" "title tags" "description actions";
    column-gap: 2.5rem;
    padding: 2rem;
  }
  .project-card--text .project-context { grid-area: context; }
  .project-card--text h3 { grid-area: title; }
  .project-card--text .project-description { grid-area: description; }
  .project-card--text .project-focus { grid-area: focus; }
  .project-card--text .tags { grid-area: tags; align-content: start; }
  .project-card--text .project-actions { grid-area: actions; }
}

.project-preview {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: #edf1f6;
  color: var(--navy);
  cursor: zoom-in;
  text-align: left;
}

.project-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1.7;
  padding: 1.25rem;
}

.project-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: inherit;
  object-fit: contain;
  /* No cropping, filters, transforms, or invented browser chrome. */
}

.preview-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 2.75rem;
  padding: .5rem 1.5rem;
  border-block: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 550;
}

.project-preview:hover .preview-label {
  color: var(--blue);
  background: var(--sky);
}

.project-preview:focus-visible {
  outline-offset: -5px;
}

.project-empty {
  padding: 1.5rem;
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .875rem;
  padding: 1.75rem;
}

.project-context, .project-category {
  color: var(--blue);
  font-size: .8125rem;
  font-weight: 650;
}

.project-card h3 {
  font-size: clamp(1.25rem, 1.7vw, 1.5rem);
  line-height: 1.3;
}

.project-card h3 a {
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

.project-card h3 a:hover {
  text-decoration: underline;
}

.project-description {
  font-size: 1rem;
  line-height: 1.65;
}

.project-focus {
  margin: 0;
  font-size: .9375rem;
  line-height: 1.6;
}

.project-focus span {
  color: var(--navy);
  font-weight: 650;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tags li {
  padding: .25rem .5rem;
  border: 1px solid #e4eaf1;
  border-radius: 4px;
  background: #f8fafc;
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.45;
}

.project-body > .tags {
  margin-block: .125rem .5rem;
}

.project-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.25rem;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}

.project-actions .case-link {
  color: var(--blue);
  font-weight: 700;
}

.project-actions > a:not(.case-link) {
  color: var(--muted);
  font-weight: 550;
}

.project-actions > a:hover {
  color: var(--blue);
}

/* DELICE leads the section, followed by two balanced rows of related work. */
.project-card--featured {
  grid-column: 1 / -1;
  border-color: var(--rose-line);
}

.project-card--featured .project-image-wrap {
  aspect-ratio: 2;
}

.project-card--featured .project-context {
  color: var(--rose);
}

.project-card--featured h3 {
  font-size: clamp(1.5rem, 2.2vw, 1.875rem);
}

@media (min-width: 56.251em) {
  .project-card--featured {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
  .project-card--featured > .project-preview {
    height: 100%;
    border-right: 1px solid var(--rose-line);
    background: var(--blush);
  }
  .project-card--featured .project-image-wrap {
    flex: 1;
    min-height: 18rem;
    aspect-ratio: auto;
    padding: 1.5rem;
  }
  .project-card--featured .preview-label {
    border-bottom: 0;
  }
  .project-card--featured .project-body {
    padding: 2rem;
  }
}

.gallery-count {
  font-weight: 400;
}

/* Official Devicon colors remain intact. Text is the fallback for unsupported tools. */

.skills-section {
  padding-block: 3.5rem;
  border-bottom: 1px solid var(--line);
}

.skills-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.skills-heading h2 {
  font-size: 1.5rem;
  letter-spacing: -.02em;
}

.skills-heading p {
  font-size: .9375rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .625rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.skills-grid li {
  display: flex;
  align-items: center;
  gap: .625rem;
  min-width: 0;
  min-height: 4.25rem;
  padding: .875rem .75rem;
  border: 1px solid #e5ebf2;
  border-radius: 6px;
  background: #fafbfd;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 550;
  line-height: 1.5;
}

.skill-icon {
  display: inline-flex;
  flex: 0 0 1.5rem;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.5rem;
  line-height: 1;
}

.skill-icon-pair {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: .25rem;
}

.skills-grid li > span:not(.skill-icon-pair) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.frameworks-group {
  margin-top: 1.75rem;
}

.frameworks-group h3 {
  margin-bottom: .75rem;
  font-size: 1rem;
  font-weight: 600;
}

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

.frameworks-grid li {
  border-color: var(--rose-line);
  background: var(--blush);
}

/* About: the supplied portrait remains at its original proportions. */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr);
  grid-template-areas: "portrait intro" "portrait copy";
  column-gap: 5rem;
  align-items: start;
}

.about-intro {
  grid-area: intro;
  margin-bottom: 1.25rem;
}

.about-portrait {
  grid-area: portrait;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 18rem;
}

.about-portrait img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--rose-line);
  border-radius: 1rem;
  box-shadow: .375rem .375rem 0 var(--blush);
}

.about-signature {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
  color: var(--navy);
  font-size: .875rem;
  font-weight: 600;
}

.signature-line {
  width: 1.75rem;
  height: 2px;
  background: var(--rose);
}

.about-copy {
  grid-area: copy;
  min-width: 0;
  max-width: 39rem;
}

.education {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.education div > * {
  display: block;
}

.education strong {
  margin-block: .25rem;
  color: var(--navy);
  font-size: 1rem;
}

.education div > span:last-child {
  color: var(--muted);
  font-size: .9375rem;
}

.small-label {
  color: var(--muted);
  font-size: .8125rem;
}

/* Supporting sections use the same spacing and type rhythm. */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.service {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  column-gap: .875rem;
  align-content: start;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.service-icon {
  grid-row: span 2;
  color: var(--blue);
  font-size: .8125rem;
  font-weight: 650;
  line-height: 1.75;
}

.service h3 {
  margin-bottom: .625rem;
}

.service p {
  grid-column: 2;
  font-size: 1rem;
}

.process-section {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.75rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.step-number {
  display: block;
  margin-bottom: 1rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid #ccd8e7;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 600;
}

.process-grid h3 {
  margin-bottom: .625rem;
  font-size: 1.0625rem;
}

.process-grid p {
  font-size: 1rem;
}

.why-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 4rem;
}

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.reasons-grid article {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.reasons-grid article > span {
  display: none;
}

.reasons-grid h3 {
  margin-bottom: .625rem;
}

.reasons-grid p {
  font-size: 1rem;
}

/* Contact prepares an email draft; it does not claim a message was sent. */

.contact-section {
  background: var(--blush);
  border-block: 1px solid var(--rose-line);
}

.contact-section .eyebrow {
  color: var(--rose);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 4rem;
}

.contact-links {
  display: grid;
  gap: .75rem;
  margin-top: 1.5rem;
}

.contact-links a {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 2.75rem;
  font-size: .9375rem;
  overflow-wrap: anywhere;
}

.contact-link-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #c2d4eb;
  border-radius: 5px;
  color: var(--blue);
  font-size: .875rem;
  font-weight: 650;
}

.contact-form {
  min-width: 0;
  padding: 2rem;
  border: 1px solid #d5e1ef;
  border-radius: var(--radius);
  background: var(--white);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  min-width: 0;
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: .5rem;
  color: var(--navy);
  font-size: .875rem;
  font-weight: 650;
}

.field input, .field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: .75rem .875rem;
  border: 1px solid #bdcddd;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.field input::placeholder, .field textarea::placeholder {
  color: #65768a;
  opacity: 1;
}

.field input:hover, .field textarea:hover {
  border-color: #8ca7c8;
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.form-note {
  margin-bottom: 1.25rem;
  font-size: .875rem;
  line-height: 1.6;
}

.form-feedback {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid #c7daf2;
  border-radius: 6px;
  background: var(--sky);
  font-size: .9375rem;
  overflow-wrap: anywhere;
}

.form-feedback .text-link {
  margin-top: .5rem;
}

.site-footer {
  padding-block: 2.5rem 1rem;
}

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

.footer-name {
  color: var(--navy);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.footer-name span {
  color: var(--rose);
}

.footer-top p {
  margin-top: .25rem;
  font-size: .875rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: .875rem;
}

.footer-nav a, .footer-bottom a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  color: var(--muted);
  font-size: .8125rem;
}

.footer-bottom [data-social-links] {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* Accessible screenshot viewer. Oversized originals scroll from their top-left. */

.lightbox {
  width: min(90rem, calc(100vw - 2.5rem));
  max-width: none;
  height: min(60rem, calc(100dvh - 2.5rem));
  max-height: calc(100dvh - 2.5rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #536278;
  border-radius: var(--radius);
  background: #101c2d;
  color: var(--white);
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
}

.lightbox::backdrop {
  background: rgb(6 16 30 / 86%);
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-shrink: 0;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #344358;
}

.lightbox-header h2 {
  margin-bottom: .25rem;
  color: var(--white);
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0;
  text-wrap: initial;
}

.lightbox-header p {
  color: #becbde;
  font-size: .875rem;
}

.icon-button {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid #53647b;
  border-radius: 6px;
  background: #1c2c42;
  color: var(--white);
  font-size: 1.25rem;
}

.icon-button:hover {
  background: #304762;
}

.lightbox-stage {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 1.25rem;
  overscroll-behavior: contain;
}

.lightbox-stage img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-stage.actual-size {
  display: block;
  text-align: left;
}

.lightbox-stage.actual-size img {
  display: block;
  max-width: none;
  max-height: none;
  margin-inline: auto;
}

.lightbox-stage p {
  color: #d5e3f6;
}

.gallery-thumbnails {
  display: flex;
  position: relative;
  flex-shrink: 0;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: .5rem 1.25rem .875rem;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #64748b transparent;
}

.gallery-thumbnail {
  display: flex;
  flex: 0 0 5rem;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-height: 3.125rem;
  padding: .375rem;
  border: 2px solid #45556b;
  border-radius: 6px;
  background: #1c2c42;
  color: #d5e3f6;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  transition: border-color .18s, background .18s;
}

.gallery-thumbnail img {
  width: 3.125rem;
  height: 2.125rem;
  object-fit: contain;
}

.gallery-thumbnail:hover {
  border-color: #a3b4c9;
}

.gallery-thumbnail[aria-current="true"] {
  border-color: #e8b9cd;
  background: #3d354c;
  color: var(--white);
}

.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 1rem;
  padding: .75rem 1.25rem;
  border-top: 1px solid #344358;
}

.gallery-navigation {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: .75rem;
}

.gallery-navigation span {
  min-width: 3rem;
  font-size: .875rem;
  text-align: center;
}

.lightbox-toolbar > p {
  color: #c8d4e5;
  font-size: .875rem;
  text-align: center;
}

.lightbox-toolbar .text-button {
  flex-shrink: 0;
  color: #abd1ff;
}

.lightbox :focus-visible {
  outline-color: #a7cfff;
}

/* The existing four case-study routes share this design system. */

.case-main {
  padding-bottom: 2rem;
}

.case-hero {
  padding-block: 2.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-bottom: 1.5rem;
  color: var(--blue);
  font-size: .9375rem;
}

.case-title {
  max-width: 57rem;
  margin-bottom: 1.25rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.16;
}

.case-description {
  max-width: 48rem;
  margin-bottom: 1.25rem;
  font-size: 1.125rem;
}

.case-hero .project-actions {
  justify-content: start;
  margin-top: 1.5rem;
}

.case-cover {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.case-cover .project-preview {
  background: transparent;
}

.case-cover .project-image-wrap {
  aspect-ratio: auto;
  padding: 0;
}

.case-cover img {
  position: static;
  width: 100%;
  height: auto;
  max-height: 40rem;
  object-fit: contain;
}

.case-details {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 4rem;
  padding-block: 3.5rem;
}

.case-details h2, .case-gallery h2, .case-video h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.65rem, 2.5vw, 2rem);
}

.feature-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.feature-list li + li {
  margin-top: .5rem;
}

.case-gallery {
  padding-block: 3.5rem;
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.case-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.gallery-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.gallery-item figcaption {
  padding: .875rem 1.125rem;
  color: var(--muted);
  font-size: .9375rem;
}

.case-video {
  padding-block: 3.5rem;
}

.case-video video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 45rem;
  margin-top: 1.5rem;
  border-radius: var(--radius);
  background: var(--navy);
}

.case-cta {
  padding-top: 1.5rem;
}

/* Tablet and enlarged-text layouts */

@media (max-width: 72em) {
  .site-nav {
    gap: 1rem;
  }
  .site-nav .nav-cta {
    display: none;
  }
  .hero-grid {
    gap: 2rem;
  }
  .skills-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .about-grid {
    column-gap: 3rem;
  }
  .contact-grid, .why-grid, .case-details {
    gap: 2.5rem;
  }
  .project-body {
    padding: 1.5rem;
  }
}

@media (max-width: 56.25em) {
  .container {
    width: calc(100% - 3rem);
  }
  .header-inner {
    flex-wrap: wrap;
    min-height: 4.5rem;
    gap: 0;
  }
  .header-controls {
    margin-left: auto;
  }
  .menu-toggle:not([hidden]) {
    display: grid;
  }
  .site-nav {
    order: 3;
    width: 100%;
    margin: 0;
    padding: .75rem 0 1rem;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
  }
  .js .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    max-height: calc(100dvh - 5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    gap: 0;
  }
  .js .site-nav.is-open {
    display: flex;
  }
  .site-nav > a:not(.button) {
    padding: .625rem .75rem;
    font-size: 1rem;
  }
  .site-nav > a[aria-current]:not(.button)::after {
    display: none;
  }
  .site-nav > a[aria-current]:not(.button) {
    border-radius: 5px;
    background: var(--sky);
  }
  .site-nav .nav-cta {
    display: inline-flex;
    align-self: start;
    margin-top: .75rem;
  }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-copy {
    max-width: 43rem;
  }
  .hero h1 {
    max-width: 40rem;
    font-size: clamp(2.5rem, 5.5vw, 3.25rem);
  }
  .hero-description {
    max-width: 38rem;
  }
  /* The code visual is decorative; project evidence takes priority on small screens. */
  .code-composition {
    display: none;
  }
  .skills-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .section-heading {
    align-items: start;
    gap: 1.5rem;
  }
  .section-heading > p {
    max-width: 22rem;
  }
  .projects-grid {
    gap: 1.5rem;
  }
  .project-body {
    padding: 1.25rem;
  }
  .project-image-wrap {
    padding: 1rem;
  }
  .preview-label {
    padding-inline: 1.25rem;
  }
  .about-grid {
    grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
    column-gap: 2rem;
  }
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .process-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
  .why-grid, .contact-grid, .case-details {
    grid-template-columns: 1fr;
  }
  .contact-form {
    width: 100%;
    max-width: 42rem;
  }
  .footer-top {
    flex-direction: column;
    align-items: start;
    gap: 1rem;
  }
  .lightbox-toolbar {
    flex-wrap: wrap;
  }
  .lightbox-toolbar > p {
    order: 3;
    width: 100%;
  }
}

/* Phone layouts: no fixed content heights, cropped images, or tiny controls. */

@media (max-width: 42.5em) {
  .container {
    width: calc(100% - 2.5rem);
  }
  .hero h1 {
    font-size: clamp(2.125rem, 8vw, 3rem);
  }
  .hero-description {
    font-size: 1rem;
  }
  .hero .button-row {
    align-items: stretch;
  }
  .hero .button {
    flex: 1 1 12rem;
  }
  .section-heading, .skills-heading {
    flex-direction: column;
    align-items: start;
    gap: .75rem;
  }
  .section-heading > p {
    max-width: 36rem;
  }
  .projects-grid, .case-gallery-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-body {
    padding: 1.5rem;
  }
  .project-card h3 {
    font-size: 1.375rem;
  }
  .skills-section {
    padding-block: 2.5rem;
  }
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "portrait" "copy";
    gap: 1.5rem;
  }
  .about-intro {
    margin: 0;
  }
  .about-portrait {
    max-width: 14rem;
    justify-self: start;
  }
  .services-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .process-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .process-grid li {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: .375rem 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
  }
  .step-number {
    grid-row: span 2;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .process-grid h3 {
    margin: 0;
  }
  .process-grid p {
    grid-column: 2;
  }
  .reasons-grid {
    gap: 1.5rem;
  }
  .contact-form {
    padding: 1.5rem;
  }
  .form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .footer-nav {
    column-gap: 1.25rem;
    row-gap: 0;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: start;
    gap: 0;
  }
  .lightbox {
    width: calc(100vw - 1rem);
    height: calc(100dvh - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 8px;
  }
  .lightbox-header {
    padding: .875rem .75rem;
  }
  .lightbox-header h2 {
    font-size: .9375rem;
  }
  .lightbox-header p {
    font-size: .8125rem;
  }
  .lightbox-stage {
    padding: .5rem;
  }
  .gallery-thumbnails {
    padding: .5rem .75rem .75rem;
  }
  .lightbox-toolbar {
    gap: .5rem;
    padding: .75rem;
  }
  .lightbox-toolbar > p {
    font-size: .8125rem;
  }
  .case-cover {
    padding: .75rem;
  }
  .case-description {
    font-size: 1rem;
  }
  .case-title {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 25em) {
  .container {
    width: calc(100% - 2rem);
  }
  .brand {
    font-size: 1rem;
  }
  .brand-mark {
    width: 1.875rem;
    height: 1.875rem;
  }
  .hero .button-row {
    flex-direction: column;
  }
  .hero .button {
    flex-basis: auto;
  }
  .project-body, .contact-form {
    padding: 1.125rem;
  }
  .preview-label {
    padding-inline: 1.125rem;
  }
  .project-actions {
    gap: .25rem .75rem;
  }
  .reasons-grid {
    grid-template-columns: 1fr;
  }
  .skills-grid li {
    padding: .75rem .5rem;
    gap: .5rem;
  }
}

/* Short, one-time entrances and restrained hover feedback. No looping motion.
   Scroll entrances use the Web Animations API, so content is visible by default. */
@keyframes soft-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media screen and (prefers-reduced-motion: no-preference) {
  .hero-copy > .eyebrow,
  .hero-copy > h1,
  .hero-copy > .hero-description,
  .hero-copy > .button-row,
  .code-composition {
    animation: soft-enter .52s cubic-bezier(.2, .7, .3, 1) both;
  }
  .hero-copy > h1 {
    animation-delay: .06s;
  }
  .hero-copy > .hero-description {
    animation-delay: .12s;
  }
  .hero-copy > .button-row,
  .code-composition {
    animation-delay: .18s;
  }
  .button {
    transition: background .18s, border-color .18s, transform .2s, box-shadow .2s;
  }
  .project-card {
    transition: border-color .2s, box-shadow .2s, transform .2s;
  }
  .text-link > span[aria-hidden="true"] {
    transition: transform .2s;
  }
}

@media screen and (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgb(16 39 71 / 10%);
  }
  .project-card:hover {
    transform: translateY(-3px);
    border-color: var(--rose-line);
  }
  .text-link:hover > span[aria-hidden="true"] {
    transform: translateX(2px);
  }
  .button:active {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .site-header, .code-composition, .contact-form, .lightbox, .project-toolbar, .project-actions, .preview-label, .footer-nav, .skip-link {
    display: none !important;
  }
  .container {
    width: 100%;
  }
  .section, .skills-section, .hero {
    padding-block: 1.5rem;
  }
  .hero-grid {
    display: block;
  }
  .hero h1 {
    font-size: 28pt;
  }
  h2 {
    font-size: 20pt;
  }
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
  .project-card {
    break-inside: avoid;
    box-shadow: none;
  }
  .project-body {
    padding: 1rem;
  }
  .process-section, .projects-section, .contact-section {
    background: var(--white);
  }
}
