/* ==========================================================================
   Yassine Benomar — portfolio
   One family (Atkinson Hyperlegible Next, built for legibility at distance),
   a cool aluminium page, and LED amber reserved for the destination sign.
   ========================================================================== */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Colour */
  --paper: #f3f5f6;
  --surface: #ffffff;
  --ink: #17202b;
  --ink-2: #3b4654;
  --muted: #5b6673;
  --rule: #d6dce1;
  --rule-strong: #aeb7bf;
  --amber: #ffb000;
  --amber-ink: #8f5d00;
  --sign: #000000;

  /* Type — scale after Bringhurst: 14 / 16 / 18 / 21 / 24 / 36 / 48 / 60 */
  --font: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --t-sm: 0.875rem;
  --t-base: 1.125rem;
  --t-md: 1.3125rem;
  --t-lg: 1.5rem;
  --t-xl: clamp(1.75rem, 1.2rem + 2vw, 2.25rem);
  --t-2xl: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);

  /* Layout */
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(4rem, 3rem + 5vw, 7rem);
  --radius: 6px;
  --header-h: 72px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

img,
video,
svg,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* --------------------------------------------------------------------------
   Buttons and links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  background: #000;
}

.text-link {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
}

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

/* --------------------------------------------------------------------------
   Header and navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: var(--header-h);
}

.brand {
  display: grid;
  margin-right: auto;
  text-decoration: none;
  line-height: 1.25;
}

.brand-name {
  font-size: 1.0625rem;
  font-weight: 700;
}

.brand-role {
  color: var(--muted);
  font-size: 0.8125rem;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 1rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}

.header-cta:hover {
  background: var(--ink);
  color: var(--paper);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
}

.nav-toggle-icon {
  position: relative;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-icon::before {
  content: "";
  position: absolute;
  left: 0;
  top: -6px;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  padding: 0 var(--gutter) 2rem;
  background: var(--paper);
}

.mobile-nav.is-open {
  display: flex;
}

.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}

.mobile-nav-head .brand-text {
  display: grid;
}

.mobile-nav-close {
  min-height: 44px;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mobile-nav-links {
  display: grid;
  gap: 0.25rem;
  margin-top: 2rem;
}

.mobile-nav-links a {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 2rem;
  font-weight: 700;
  text-decoration: none;
}

.mobile-nav-links a span {
  display: none;
}

.mobile-nav-foot {
  margin-top: auto;
  font-weight: 700;
}

.mobile-nav-foot span {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Hero and destination sign
   -------------------------------------------------------------------------- */
.hero {
  padding: clamp(1rem, 2vw, 2rem) 0 var(--section);
}

.sign {
  display: block;
  width: 100%;
  margin: 0;
  padding: clamp(10px, 1.6vw, 22px);
  border: 0;
  border-radius: 12px;
  background: var(--sign);
  box-shadow: inset 0 0 0 1px #262626, inset 0 2px 0 #1a1a1a;
  cursor: pointer;
}

.sign:focus-visible {
  outline-color: var(--ink);
}

.sign canvas {
  width: 100%;
  height: auto;
}

.sign-fallback {
  display: block;
  padding: 0.5rem 0;
  color: var(--amber);
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

.js .sign-fallback {
  display: none;
}

html:not(.js) .sign canvas {
  display: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.hero h1 {
  max-width: 20ch;
  font-size: var(--t-2xl);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.hero-lede {
  max-width: 60ch;
  margin-top: 1.5rem;
  color: var(--ink-2);
  font-size: var(--t-md);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2rem;
}

.hero-actions .btn + .text-link {
  margin-left: 0.25rem;
}

/* "In service" board */
.board {
  padding: 1.25rem 1.5rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}

.board-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  letter-spacing: 0;
}

.board-title::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 176, 0, 0.22);
}

.board-lede {
  margin-top: 0.4rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.board table {
  width: 100%;
  margin-top: 0.9rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.board th {
  padding: 0.4rem 0;
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 600;
  text-align: left;
}

.board td {
  padding: 0.75rem 1rem 0.75rem 0;
  border-top: 1px solid var(--rule);
  vertical-align: top;
}

.board td:first-child {
  width: 38%;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
  padding: var(--section) 0;
}

.section--rule {
  border-top: 1px solid var(--rule);
}

.section-head {
  max-width: 62ch;
}

.section-head h2 {
  font-size: var(--t-xl);
}

.section-head p {
  margin-top: 0.75rem;
  color: var(--muted);
}

/* Projects: one layout, repeated, so the rhythm stays steady */
.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin-top: clamp(3rem, 5vw, 4.5rem);
  padding-top: clamp(3rem, 5vw, 4.5rem);
  border-top: 1px solid var(--rule);
}

.section-head + .project {
  border-top: 0;
  padding-top: 0;
}

.project-media {
  margin: 0;
}

.project-media img {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.project-media figcaption,
.case-cover figcaption,
.case-content figcaption,
.diagram figcaption,
.video-card figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: var(--t-sm);
  line-height: 1.45;
}

.project-copy h3 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

.project-summary {
  margin-top: 0.6rem;
  color: var(--ink-2);
  font-size: var(--t-md);
  line-height: 1.45;
}

.project-facts {
  margin: 1.5rem 0 0;
}

.project-facts div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}

.project-facts dt {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 700;
}

.project-facts dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

.project-facts .is-result dt {
  color: var(--amber-ink);
}

.project-facts .is-result dd {
  font-weight: 700;
}

.project-stack {
  margin: 0.25rem 0 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
}

.project-stack::before {
  content: "Stack: ";
  font-weight: 700;
}

/* Lead project: wide screenshot spans the row, copy splits beneath it */
.project--feature {
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.project--feature .project-copy {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.project--feature .project-facts {
  margin-top: 0;
}

.project--feature .project-facts div:first-child {
  border-top: 0;
  padding-top: 0;
}

/* Systems */
.systems {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.system {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.system:hover {
  border-color: var(--ink);
}

.system h3 {
  font-size: var(--t-md);
}

.system p {
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.55;
}

.system .system-result {
  padding-left: 0.85rem;
  border-left: 3px solid var(--amber);
  color: var(--ink);
  font-weight: 700;
}

.system-link {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
}

/* Experience */
.timeline {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}

.timeline-date {
  color: var(--muted);
  font-weight: 700;
}

.timeline h3 {
  font-size: var(--t-md);
}

.timeline-org {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 1rem;
}

.timeline-org + p {
  max-width: 68ch;
  margin-top: 0.75rem;
  color: var(--ink-2);
}

.education {
  max-width: 68ch;
  padding: 1.5rem 0 0 11.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
}

.education strong {
  color: var(--ink);
}

.skills {
  margin-top: clamp(3rem, 5vw, 4.5rem);
}

.skills h3 {
  font-size: var(--t-lg);
}

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

.skills dl div {
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}

.skills dt {
  font-weight: 700;
}

.skills dd {
  margin: 0.25rem 0 0;
  color: var(--ink-2);
}

/* Remote */
.remote {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}

.remote > div {
  padding-top: 1rem;
  border-top: 3px solid var(--ink);
}

.remote h3 {
  font-size: var(--t-md);
}

.remote p {
  margin-top: 0.6rem;
  color: var(--ink-2);
}

/* Contact */
.contact {
  padding: 0 0 var(--section);
}

.contact-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

.contact-inner > div {
  max-width: 64ch;
}

.contact-photo {
  width: clamp(120px, 16vw, 200px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
}

.contact h2 {
  font-size: var(--t-xl);
}

.contact-copy {
  margin-top: 0.85rem;
  color: var(--ink-2);
}

.contact-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 1rem;
}

.contact-details a {
  text-underline-offset: 0.25em;
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--t-sm);
}

.footer-inner,
.footer-top,
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.footer-bottom {
  margin-top: 1rem;
}

.footer-name {
  color: var(--ink);
  font-weight: 700;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  font-weight: 600;
  text-underline-offset: 0.25em;
}

/* --------------------------------------------------------------------------
   Case study pages
   -------------------------------------------------------------------------- */
.case-hero {
  padding: clamp(2rem, 4vw, 3.5rem) 0 clamp(2rem, 4vw, 3rem);
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 700;
  text-underline-offset: 0.25em;
}

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

.eyebrow {
  color: var(--amber-ink);
  font-size: 0.9375rem;
  font-weight: 700;
}

.case-hero h1 {
  max-width: 22ch;
  margin-top: 0.5rem;
  font-size: var(--t-2xl);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.case-lede {
  max-width: 62ch;
  margin-top: 1.25rem;
  color: var(--ink-2);
  font-size: var(--t-md);
  line-height: 1.55;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.case-meta dt {
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 700;
}

.case-meta dd {
  margin: 0.3rem 0 0;
  font-size: 1rem;
  line-height: 1.45;
}

.case-cover {
  margin: 0 0 var(--section);
}

.case-cover--narrow .container {
  max-width: 940px;
}

.case-cover img {
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.case-cover figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.case-body {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding-bottom: var(--section);
}

.case-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.case-aside h2 {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: var(--t-sm);
  letter-spacing: 0;
}

.case-aside ul {
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
}

.case-aside li {
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.aside-note {
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--t-sm);
  line-height: 1.5;
}

.case-content {
  max-width: 70ch;
}

.case-content h2 {
  margin: 3rem 0 0.85rem;
  font-size: var(--t-lg);
}

.case-content h2:first-child {
  margin-top: 0;
}

.case-content h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.1875rem;
}

.case-content p {
  margin: 0 0 1.15rem;
  color: var(--ink-2);
  line-height: 1.65;
}

.case-content ul {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.case-content ul li {
  position: relative;
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
  color: var(--ink-2);
  line-height: 1.55;
}

.case-content ul li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.case-content blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--amber);
  font-size: var(--t-lg);
  font-weight: 700;
  line-height: 1.3;
}

.case-content figure {
  margin: 2.25rem 0;
}

.case-content figure a {
  display: block;
  cursor: zoom-in;
}

.case-content figure img,
.case-gallery img {
  width: auto;
  max-width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.case-content .figure--portrait {
  max-width: 560px;
}

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

.case-gallery figure {
  margin: 0;
}

.case-gallery .wide {
  grid-column: 1 / -1;
}

.case-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.case-nav a {
  display: block;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}

.case-nav a:hover {
  border-color: var(--ink);
}

.case-nav .nav-label {
  display: block;
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 600;
}

.case-nav .nav-title {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.case-nav .next {
  text-align: right;
}

/* Config workflow (configuration case study) */
.config-workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 2rem 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.config-step {
  padding: 1.25rem;
}

.config-step + .config-step {
  border-left: 1px solid var(--rule);
}

.config-step .step-num {
  color: var(--amber-ink);
  font-size: var(--t-sm);
  font-weight: 700;
}

.config-step h4 {
  margin-top: 0.35rem;
  font-size: 1.0625rem;
}

.config-step p {
  margin: 0.35rem 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Diagrams */
.diagram {
  margin: 2.25rem 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}

.diagram svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.diagram .node rect {
  fill: var(--paper);
  stroke: var(--rule-strong);
  stroke-width: 1;
  rx: 6px;
}

.diagram .node text {
  fill: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
}

.diagram .node .node-sub {
  fill: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.diagram .line {
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.75;
}

.diagram .line-dashed {
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.diagram .line-muted {
  fill: none;
  stroke: var(--rule-strong);
  stroke-width: 1;
}

.diagram .dot {
  fill: var(--amber);
}

.diagram .label {
  fill: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
}

/* Video */
.video-card {
  position: relative;
  margin: 2.25rem 0;
}

.video-card video {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #000;
}

.video-play {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.video-play-icon {
  font-size: 0.75rem;
}

.video-card.is-playing .video-play {
  display: none;
}

/* Lightbox */
.lightbox {
  width: min(1180px, 94vw);
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
}

.lightbox::backdrop {
  background: rgba(10, 14, 18, 0.82);
}

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

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  font-size: var(--t-sm);
}

.lightbox-close {
  min-height: 40px;
  padding: 0 1rem;
  border: 1.5px solid currentColor;
  border-radius: var(--radius);
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Visually hidden */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .project--feature .project-copy {
    grid-template-columns: minmax(0, 1fr);
  }

  .project--feature .project-facts div:first-child {
    border-top: 1px solid var(--rule);
    padding-top: 0.85rem;
  }

  .hero-grid,
  .project,
  .contact-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-grid {
    align-items: start;
  }

  .systems,
  .remote {
    grid-template-columns: minmax(0, 1fr);
  }

  .remote {
    gap: 1.75rem;
  }

  .case-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .case-aside {
    position: static;
    order: 2;
  }

  .case-meta,
  .config-workflow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-step:nth-child(3) {
    border-left: 0;
  }

  .config-step:nth-child(n + 3) {
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 760px) {
  .site-nav,
  .header-cta {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .timeline li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  .education {
    padding-left: 0;
  }

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

  .project-facts div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
  }

  .case-gallery,
  .case-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .case-nav .next {
    text-align: left;
  }

  .contact-photo {
    width: 112px;
  }
}

@media (max-width: 480px) {
  .case-meta,
  .config-workflow {
    grid-template-columns: minmax(0, 1fr);
  }

  .config-step + .config-step {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .site-header,
  .sign,
  .site-footer,
  .video-play {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .section,
  .hero {
    padding: 1.5rem 0;
  }
}

/* Video captions: description left, provenance right */
.video-card figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

/* Small screens: icon-only play button so it covers as little of the frame as possible */
@media (max-width: 600px) {
  .video-play {
    top: 0.5rem;
    left: 0.5rem;
    width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
  }

  .video-play > span:not(.video-play-icon) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}
