/* Rob Nguyen portfolio. Base stylesheet for the D1 "run sheet" design (Nov 13, UX plan stage 2):
   a coordinator's printed working document. White paper, ink and one gold accent; square corners;
   ruled rows instead of cards. Media-specific rules live in separate files linked with media
   attributes (wide, desk, narrow, small, dark, motion, forced, print and the show-* files).
   No external fonts: mono labels and body text use the device's own fonts; Inter (fonts.css) sets the headings.
   Every text colour pair was checked against WCAG 2.1 AA (4.5:1); see the stage 2 report. */

:root {
  --paper: #FFFFFF;
  --ink: #13233D;      /* text and rules */
  --ink-2: #3E4C63;    /* secondary text */
  --mute: #5E6B80;     /* small labels */
  --grid: #D6DEE9;     /* decorative grid lines only, never text */
  --gold: #8CCBFA;     /* sky: the only accent, the home H1 highlighter and the primary button */
  --on-gold: #0B2440;  /* text on gold, in both modes */
  --go: #1E7A45;       /* the "In use" status dot only */
  --wrap: 72rem;
  --label-w: 9.5rem;   /* the left label column (desk.css) */
  --mono: "Inter", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;  /* labels: Inter too, one font site-wide */
  --code: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --sans: "Inter", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --head: "Inter", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  overflow-wrap: break-word;
}
img, svg, video { max-width: 100%; height: auto; }
img, video { display: block; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); margin-top: 2em; }
h3 { font-size: 1.2rem; font-weight: 600; margin-top: 1.6em; letter-spacing: -.01em; }
h4 { font-size: 1.05rem; font-weight: 600; margin-top: 1.4em; letter-spacing: -.01em; }
p, ul, ol, dl, table, figure { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; }
li { margin: .25rem 0; }
li > ul, li > ol { margin: .25rem 0 .5rem; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .18em; }
strong { font-weight: 700; }
code { font-family: var(--code); font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--grid); margin: 2.5rem 0; }
figcaption { font: 500 .8125rem/1.55 var(--mono); color: var(--ink-2); margin-top: .5rem; }

/* Focus: a 3 px ink ring, 2 px out, square; gold on the dark lightbox */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
main:focus { outline: none; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.num { font-weight: 600; }

/* Skip link */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 1rem;
  background: var(--ink); color: var(--paper); font: 600 .9375rem/1.2 var(--mono); text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header: white, a 1 px ink rule under it, the ticket and "Rob Nguyen" in mono, the nav in mono */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--ink); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1.5rem; padding: .45rem 0; }
.brand { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; color: var(--ink); text-decoration: none; font: 600 1rem/1 var(--mono); letter-spacing: .01em; }
.brand:hover span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .35em; }
.brand svg.ticket { width: 42px; height: 42px; flex: none; }
.brand span { white-space: nowrap; } /* "Rob Nguyen" stays on one line beside the ticket, even at 320 px */
/* The ticket logo: fixed colours, the same in light and dark. Anton is loaded for these two letters only. */
.ticket .tix { fill: #8CCBFA; }
.ticket .tix-rn { fill: #0B2440; font-family: "Anton", Impact, "Arial Narrow", sans-serif; font-size: 13px; letter-spacing: .6px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 .2rem; }
.site-nav li { margin: 0; }
.site-nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 .7rem; color: var(--ink); text-decoration: none; font: 600 .9375rem/1 var(--mono); }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .5em; }
.site-nav { margin-left: auto; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .ico-sun, [data-mode="dark"] .theme-toggle .ico-moon { display: none; }
[data-mode="dark"] .theme-toggle .ico-sun { display: block; }
[data-mode="light"] { color-scheme: light; }
[data-mode="dark"] { color-scheme: dark; }
.menu-toggle { display: none; align-items: center; gap: .5rem; min-height: 44px; min-width: 44px; padding: 0 .8rem; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); font: 600 .875rem/1 var(--mono); cursor: pointer; }
.menu-icon { width: 1.1rem; height: .8rem; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; position: relative; }
.menu-icon::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 1px); border-top: 2px solid currentColor; }
.menu-toggle[aria-expanded="true"] { background: var(--ink); color: var(--paper); }

/* ---------- Footer: paper, a 2 px ink rule on top, the contact block's buttons */
.site-footer { margin-top: 4rem; border-top: 2px solid var(--ink); padding: 1.4rem 0 2.6rem; color: var(--ink-2); font-size: .9375rem; background: var(--paper); }
.site-footer .wrap { display: grid; gap: .8rem; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink); }
.footer-contact { padding: .4rem 0 1.4rem; border-bottom: 1px solid var(--grid); }
.footer-contact h2 { font-size: 1.75rem; margin: 0 0 .3rem; }
.site-footer .footer-contact-text { margin: 0 0 1rem; }
.footer-sign { color: var(--ink-2); }
.wordmark { font: 600 1rem/1.4 var(--mono); color: var(--ink); margin-right: .6rem; }

/* ---------- Buttons: square. Primary gold with ink text; secondary paper. Both with a 2 px ink border. */
.btn-stage, .btn-line, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; min-width: 44px;
  padding: .6rem 1.2rem; border: 2px solid var(--ink); border-radius: 0; font: 600 .9375rem/1.2 var(--mono);
  text-decoration: none; cursor: pointer;
}
.btn-stage { background: var(--gold); color: var(--on-gold); }
.btn-line, .btn { background: var(--paper); color: var(--ink); }
.btn-stage:hover, .btn-line:hover, .btn:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 0; }
.hire-buttons { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .7rem; }
.hire-buttons li { margin: 0; }
.hire-more { margin: 1.2rem 0 0; }
.hire-more a, .ai-more a, .close-details a { display: inline-flex; align-items: center; min-height: 44px; font: 600 .9375rem/1.2 var(--mono); }

/* ---------- Status: a mono label. Only "In use" carries the green dot. */
.status { display: inline-flex; align-items: center; gap: .45rem; font: 600 .8125rem/1.3 var(--mono); color: var(--ink-2); white-space: nowrap; }
.status-in-use { color: var(--ink); }
.status-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--go); flex: none; }

/* ---------- Shared page heads (work, About, credits, 404): the title above a ruled line */
.page-top .project-head { padding: 2.2rem 0 1.6rem; margin: 0; border-bottom: 1px solid var(--ink); }
.eyebrow, .row-label { font: 500 .8125rem/1.4 var(--mono); letter-spacing: 0; color: var(--mute); margin: 0 0 .6rem; }
.project-head h1 { margin: 0 0 .6rem; max-width: 24ch; }
.lede { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 44rem; margin: 0; }
.page-body { padding-top: .4rem; }

/* ---------- Prose */
.prose > :where(p, ul, ol, h2, h3, h4, dl, blockquote) { max-width: 46rem; }
.prose > .table-wrap { max-width: 60rem; }
.prose > .gallery, .prose > .videos:not(.wide), .prose > .pair, .prose > .diagram { max-width: none; }
.prose > h2:first-child { margin-top: 1.6rem; }
.accent-figure { width: 120px; height: auto; float: right; margin: 0 0 1rem 1rem; }
.lost-links li { margin: .5rem 0; }
.steps { counter-reset: step; list-style: none; padding: 0; border-top: 1px solid var(--ink); }
.steps > li { counter-increment: step; position: relative; padding: .6rem 0 .6rem 2.4rem; margin: 0; border-bottom: 1px solid var(--grid); }
.steps > li::before { content: counter(step) / ""; position: absolute; left: 0; top: .6rem; font: 600 .875rem/1.7 var(--mono); color: var(--mute); }

/* ---------- Tables: ruled, no box */
.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 0; }
caption { text-align: left; font: 600 .875rem var(--mono); padding: .6rem 0 .2rem; }
th, td { text-align: left; vertical-align: top; padding: .55rem 1rem .55rem 0; border-bottom: 1px solid var(--grid); }
thead th { font: 600 .8125rem/1.4 var(--mono); color: var(--ink-2); border-bottom: 1px solid var(--ink); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }

/* ---------- Galleries, pairs and videos: every picture in a 1 px ink frame */
.gallery { list-style: none; padding: 0; margin: 1.25rem 0 2rem; display: grid; gap: 1.2rem 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); }
.gallery.compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr)); }
.gallery li { margin: 0; }
.gallery figure { margin: 0; height: 100%; display: flex; flex-direction: column; }
.gallery a.shot { display: block; position: relative; overflow: hidden; border: 1px solid var(--ink); background: var(--paper); aspect-ratio: 4 / 3; }
.gallery a.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.gallery a.shot.contain img { object-fit: contain; padding: .5rem; }
.gallery a.shot.r169 { aspect-ratio: 16 / 9; }
.gallery a.shot.r169 img { object-position: center; }
.gallery a.shot.r11 { aspect-ratio: 1 / 1; }
.gallery a.shot.r45 { aspect-ratio: 4 / 5; }
.gallery .zoom-hint { position: absolute; right: 0; bottom: 0; background: var(--ink); color: var(--paper); font: 600 .75rem/1 var(--mono); padding: .35rem .5rem; }
.gallery figcaption { font-size: .8125rem; }
.pair { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); margin: 1rem 0 2rem; }
.pair figure { margin: 0; }
.pair a.shot { display: block; overflow: hidden; border: 1px solid var(--ink); background: var(--paper); aspect-ratio: 4 / 3; }
.pair a.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.videos { list-style: none; padding: 0; margin: 1rem 0 2rem; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.videos.wide { grid-template-columns: 1fr; max-width: 52rem; }
.videos li { margin: 0; }
.videos figure { margin: 0; }
.videos video { width: 100%; background: var(--paper); border: 1px solid var(--ink); }
.videos figcaption strong { color: var(--ink); display: block; }

/* ---------- Lightbox (built by site.js): ink panel, white type, square buttons, gold focus */
dialog.lightbox { width: min(96vw, 1700px); max-height: 94vh; padding: 0; border: 1px solid #E8EEF7; border-radius: 0; background: #0E1726; color: #FFFFFF; }
dialog.lightbox::backdrop { background: rgba(8, 14, 26, .86); }
.lb-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; padding: .5rem .8rem; background: #0E1726; border-bottom: 1px solid #5E6B80; }
.lb-count { margin: 0; font: 500 .8125rem/1.4 var(--mono); color: #E8EEF7; }
.lb-buttons { display: flex; gap: .4rem; flex-wrap: wrap; }
.lb-buttons button, .lb-buttons a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 .9rem; border: 2px solid #FFFFFF; border-radius: 0; background: transparent; color: #FFFFFF; font: 600 .875rem/1 var(--mono); cursor: pointer; text-decoration: none; }
.lb-buttons button:hover, .lb-buttons a:hover { background: #FFFFFF; color: #0E1726; }
.lb-buttons [hidden] { display: none; }
dialog.lightbox :focus-visible { outline: 3px solid #8CCBFA; outline-offset: 2px; }
.lb-figure { margin: 0; padding: .8rem; }
.lb-figure img { margin: 0 auto; max-width: 100%; height: auto; touch-action: pan-y pinch-zoom; } /* swipes go to the script; pinch-zoom stays with the browser */
.lb-figure figcaption { max-width: 60rem; margin: .7rem auto 0; font: 400 .95rem/1.5 var(--sans); color: #E8EEF7; }

/* ---------- Diagrams (inline SVG): ink, muted, grid and gold only, square corners.
   The tall layout shows by default (and always in two-column sections); desk.css shows the wide one from 1024 px. */
.diagram { margin: 1.6rem 0 2rem; padding: 1.2rem 0 0; border-top: 1px solid var(--ink); }
.diagram svg { display: block; height: auto; }
.diagram .dg-wide { display: none; width: auto; max-width: 100%; }
.diagram .dg-tall { display: block; width: 100%; max-width: 26rem; }
.beat .diagram .dg-wide { display: none; }
.beat .diagram .dg-tall { display: block; }
.dg-box { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.dg-num { fill: var(--ink); }
.dg-num-t { fill: var(--paper); font: 700 14px var(--mono); }
.dg-t { fill: var(--ink); font: 700 15px var(--sans); }
.dg-n { fill: var(--ink-2); font: 400 13.5px var(--sans); }
.dg-tall .dg-t { font-size: 18px; }
.dg-tall .dg-n { font-size: 16px; }
.dg-tall .dg-num-t { font-size: 16px; }
.k-person .dg-box { stroke-width: 3.5; }                       /* a person's step: a heavier rule */
.k-check .dg-box { fill: var(--gold); }                        /* a check: gold, with ink type */
.k-check .dg-t, .k-check .dg-n { fill: var(--on-gold); }
.k-out .dg-box { fill: var(--ink); }                           /* the result: inverted */
.k-out .dg-t, .k-out .dg-n { fill: var(--paper); }
.k-out .dg-num { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.k-out .dg-num-t { fill: var(--ink); }
.k-stop .dg-box { stroke: var(--mute); stroke-dasharray: 6 4; } /* never allowed: dashed */
.dg-arrow { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.dg-head { fill: var(--ink-2); }
.diagram figcaption { margin-top: .8rem; }
