@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans-bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #163b52;
  --muted: #4e6374;
  --blue: #005bd6;
  --paper: #f7fafb;
  --surface: #fff;
  --line: #d6e2e8;
  --tint: #e9f4f6;
  --active: #e8f1ff;
  --mint: #5ff4c5;
  --green: #167c68;
  --frame: #102e42;
  --shadow: 0 2px 3px #11364c08, 0 18px 42px -24px #11364c50;
  --radius: 20px;
}
html[data-theme="dark"] {
  --ink: #eff9ff;
  --muted: #b9cdd9;
  --blue: #8fc4ff;
  --paper: #091a27;
  --surface: #112a3b;
  --line: #2c485a;
  --tint: #0e2434;
  --active: #193e5a;
  --green: #5ff4c5;
  --frame: #113449;
  --shadow: 0 18px 42px -22px #0009;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 "DM Sans", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
a:hover { color: var(--blue); }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.05; letter-spacing: -.045em; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 6vw, 5.5rem); }
h2 { font-size: clamp(2.15rem, 4.2vw, 3.65rem); }
h3 { font-size: clamp(1.55rem, 3vw, 2.2rem); }
h1 em { font: italic 400 1em Georgia, serif; color: var(--green); }
p { color: var(--muted); }
::selection { background: var(--mint); color: #102e42; }

.wrap { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }
.skip { position: absolute; top: -100px; left: 16px; z-index: 5; padding: 10px 20px; background: var(--surface); }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.header { display: flex; gap: 24px; align-items: center; min-height: 83px; border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; margin-right: auto; font-size: 1.2rem; font-weight: 700; letter-spacing: -.045em; }
.logo img { width: 44px; height: 44px; object-fit: contain; background: white; border: 1px solid #d6e2e8; border-radius: 10px; padding: 3px; }
.header nav { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 700; }
.header nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 13px; border-radius: 9px; }
.header nav a:hover, .header nav .current { color: var(--blue); background: var(--active); }
.nav-contact { border: 1px solid var(--line); background: var(--surface); }
#theme-toggle { display: flex; align-items: center; justify-content: space-evenly; flex: 0 0 64px; min-height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); cursor: pointer; }
#theme-toggle span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; font-size: 16px; }
html[data-theme="light"] #theme-toggle span:first-child,
html[data-theme="dark"] #theme-toggle span:last-child { background: #005bd6; color: white; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(220px, 1fr);
  align-items: end;
  gap: 9px clamp(24px, 4vw, 62px);
  padding-block: clamp(32px, 5vw, 68px) clamp(32px, 4.5vw, 60px);
}
.hero .eyebrow { grid-column: 1 / -1; }
.hero h1 { font-size: clamp(2.9rem, 7.15vw, 6.75rem); line-height: .94; }
.hero h1 em { display: block; }
.hero-summary { align-self: end; padding-bottom: 3px; }
.hero-summary .lead { margin: 0 0 17px; max-width: 31ch; }
.detail-hero {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 4vw, 60px);
  padding-block: clamp(32px, 4.5vw, 62px);
}
.eyebrow { color: var(--blue); font-size: .875rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.detail-hero .eyebrow { margin-bottom: 12px; }
.lead { font-size: clamp(1.125rem, 2vw, 1.35rem); max-width: 34rem; margin: 20px 0 24px; text-wrap: pretty; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: 10px 20px; border: 1px solid transparent; border-radius: 10px; background: #005bd6; color: #fff; font-weight: 700; box-shadow: 0 6px 16px #005bd62b; }
.button:hover { background: #004ab5; color: #fff; }
.button.secondary { color: var(--blue); background: var(--surface); border-color: var(--line); box-shadow: none; }
.button.secondary:hover { background: var(--active); }
.button, .project, .screen img, .project-preview img { transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }

.hero-feature { padding: clamp(12px, 2vw, 24px); border-radius: var(--radius); background: radial-gradient(ellipse at top right, #27766a, transparent 78%), var(--frame); border: 1px solid #407285; box-shadow: var(--shadow); }
.screen, .project-preview { display: block; overflow: hidden; }
.screen:focus-visible, .project-preview:focus-visible { outline-offset: -4px; }
.hero-feature .screen { border: 1px solid #b7e2e04d; border-radius: 9px; background: #0e2637; }
.hero-feature img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: var(--frame); }
.hero-feature figcaption { display: grid; gap: 3px; margin-top: 14px; color: #c5dce6; font-size: .9rem; }
.hero-feature figcaption a, .hero-feature figcaption strong { color: white; font-size: 1rem; font-weight: 700; }
.hero-feature figcaption a:hover { color: var(--mint); text-decoration: underline; }
.screen:hover img, .project-preview:hover img { transform: scale(1.02); }

.projects-section, .detail-gallery { padding-block: clamp(28px, 4.6vw, 62px); border-block: 1px solid var(--line); background: var(--tint); }
.project-grid, .gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.project { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.project:hover, .project:target { border-color: var(--blue); }
.project-preview { background: var(--frame); border-bottom: 1px solid var(--line); }
.project-preview img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.project-content { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 20px 24px 24px; }
.project-content h3 { margin-top: 6px; }
.tagline { margin: 9px 0 19px; }
.project-link, .back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--blue); font-weight: 700; }
.project-link { margin-top: auto; padding: 5px 13px; background: var(--active); border-radius: 8px; }
.project-link:hover, .back-link:hover { text-decoration: underline; text-underline-offset: .2em; }
.contact, .detail-next { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: clamp(40px, 6vw, 70px); }
.contact h2, .detail-next h2 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
.contact p { margin-top: 9px; }
.contact .button, .detail-next .button { flex-shrink: 0; }
footer { background: #102e42; color: #c5dce6; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 22px; padding-block: 20px; }
.footer-inner > * { display: inline-flex; align-items: center; min-height: 44px; }
footer a:hover { color: var(--mint); }

.detail-hero h1 { font-size: clamp(2.85rem, 5.25vw, 4.9rem); overflow-wrap: anywhere; }
.detail-hero .back-link { margin-bottom: 12px; }
.detail-hero .lead { margin-bottom: 12px; color: var(--ink); }
.detail-intro { max-width: 57ch; }
.detail-hero .button { margin-top: 22px; }
.case-study { padding-block: 25px clamp(30px, 5vw, 56px); border-top: 1px solid var(--line); }
.case-study-heading { display: grid; gap: 12px; margin-bottom: 16px; }
.case-study-heading h2 { font-size: clamp(1.85rem, 3.5vw, 3rem); }
.case-study-nav { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--tint); }
.case-study-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 13px; border-radius: 8px; color: var(--ink); font-size: .9rem; line-height: 1.3; }
.case-study-nav a:hover, .case-study-nav a[aria-current="location"] { background: var(--active); color: var(--blue); text-decoration: underline; text-underline-offset: .2em; }
.case-study-copy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 16px; background: var(--line); overflow: clip; }
.case-study-copy section { padding: clamp(19px, 2.5vw, 32px); background: var(--surface); }
.case-study-copy section:first-child, .case-study-copy section:last-child { grid-column: 1 / -1; }
.case-study-copy section:first-child p, .case-study-copy section:last-child p { max-width: 92ch; }
.case-study-copy section:target { box-shadow: inset 0 3px var(--blue); }
.case-study-copy h3 { font-size: clamp(1.27rem, 2.15vw, 1.65rem); line-height: 1.2; }
.case-study-copy p { max-width: 68ch; margin-top: 11px; line-height: 1.65; }
.gallery-grid { max-width: 1080px; }
.gallery-grid:has(> :only-child) { grid-template-columns: minmax(0, 760px); }
.gallery-grid figure { overflow: hidden; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.gallery-grid .screen { border-radius: 8px; border: 1px solid var(--line); }
.gallery-grid img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: var(--frame); }
.gallery-grid figcaption { display: grid; gap: 3px; padding: 12px 4px 4px; color: var(--muted); }
.gallery-grid strong { color: var(--ink); }

@media (max-width: 900px) {
  .wrap { width: calc(100% - 48px); }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 36px); }
  .header { min-height: 70px; gap: 8px; }
  .header nav { gap: 4px; }
  .header nav a { padding-inline: 8px; }
  .logo img { width: 37px; height: 37px; }
  .logo { gap: 6px; font-size: 1.05rem; }
  #theme-toggle { flex-basis: 57px; }
  .hero, .detail-hero, .case-study-copy { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 14px; }
  .hero-summary .lead { margin-bottom: 12px; }
  .case-study-nav a { padding-inline: 8px; }
  .project-grid, .gallery-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .contact, .detail-next { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 365px) {
  .logo span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}




