/* Colors: light by default, dark from the visitor's system setting, and either one
   when the visitor picks it with the header button (theme.js sets data-theme). */
:root {
  --fg: #111; --muted: #5c5c5c; --chip: #ececec; --line: #dcdcdc; --bg: #fff; --mark-bg: #111; --mark-fg: #fff;
  --acc: #c2410c; --acc-strong: #9a3412; --on-acc: #fff; --sel: #fed7aa;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fg: #ececec; --muted: #a3a3a3; --chip: #262626; --line: #333; --bg: #141414; --mark-bg: #ececec; --mark-fg: #141414;
    --acc: #fb923c; --acc-strong: #fdba74; --on-acc: #141414; --sel: #7c2d12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fg: #ececec; --muted: #a3a3a3; --chip: #262626; --line: #333; --bg: #141414; --mark-bg: #ececec; --mark-fg: #141414;
  --acc: #fb923c; --acc-strong: #fdba74; --on-acc: #141414; --sel: #7c2d12;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 "Inter", "Helvetica Neue", Arial, sans-serif; caret-color: var(--acc); }
::selection { background: var(--sel); color: var(--fg); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: .2rem; }
.wrap { max-width: 60rem; margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }

/* Header: logo home, then the site's pages and the theme button */
header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .8rem; font-weight: 600; letter-spacing: .14em; }
header a.home { display: flex; align-items: center; gap: .6rem; color: var(--fg); text-decoration: none; }
.glyph { width: 1.6rem; height: 1.6rem; border-radius: .35rem; background: var(--mark-bg); color: var(--mark-fg);
         display: grid; place-items: center; letter-spacing: 0; font-size: .78rem; }
.light { font-weight: 300; }
nav.site { display: flex; align-items: center; gap: 1.25rem; font-size: .9rem; font-weight: 500; letter-spacing: .01em; }
nav.site a { color: var(--fg); text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
nav.site a:hover { color: var(--acc); }
nav.site a[aria-current="page"] { border-bottom-color: var(--acc); }
button.theme { display: grid; place-items: center; width: 2rem; height: 2rem; margin-left: -.25rem; padding: 0; border: 1px solid var(--line);
               border-radius: .5rem; background: none; color: var(--fg); cursor: pointer; }
button.theme:hover { border-color: var(--acc); color: var(--acc); }
button.theme svg { width: 1rem; height: 1rem; }
button.theme .sun { display: none; }
:root[data-theme="dark"] button.theme .sun { display: block; }
:root[data-theme="dark"] button.theme .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) button.theme .sun { display: block; }
  :root:not([data-theme="light"]) button.theme .moon { display: none; }
}
@media (max-width: 26rem) {
  header .home > span { display: none; }
  nav.site { gap: 1rem; }
}

/* Home: photo beside the intro, stacked on a phone */
.intro { display: grid; grid-template-columns: 30% 1fr; gap: 2.75rem; align-items: start; margin-top: 4rem; }
.intro img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: .6rem; background: var(--chip); }
.intro h1 .role { display: block; font-size: clamp(1.2rem, 3vw, 1.5rem); letter-spacing: -.01em; margin-top: .35rem; }
h1 { font-size: clamp(2rem, 5vw, 2.5rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 .role { font-weight: 300; color: var(--muted); }
.pitch { font-size: clamp(1.05rem, 2.2vw, 1.15rem); line-height: 1.6; margin: 1.1rem 0 0; max-width: 40rem; }
.pitch p { margin: 0 0 .85rem; }
@media (max-width: 36rem) {
  .intro { grid-template-columns: 1fr; gap: 1.5rem; margin-top: 2.5rem; }
  .intro img { width: 9rem; }
}

.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.25rem; }
.chip { background: var(--chip); border-radius: 999px; padding: .2rem .8rem; font-size: .8rem; }

.links { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.links a { color: var(--fg); text-decoration: none; border: 1px solid var(--line); border-radius: .55rem;
           padding: .55rem 1rem; font-size: .95rem; }
.links a:hover { border-color: var(--acc); color: var(--acc); }
.links a.primary { background: var(--acc); color: var(--on-acc); border-color: var(--acc); }
.links a.primary:hover { background: var(--acc-strong); border-color: var(--acc-strong); color: var(--on-acc); }

.contact { margin-top: 4.5rem; }
.contact p { margin: 0; }
.contact a { color: var(--fg); text-underline-offset: .2em; text-decoration-color: var(--line); }
.contact a:hover { color: var(--acc); text-decoration-color: var(--acc); }

footer { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* Portfolio rows on the Work page */
.page-title { margin-top: 4rem; }
.portfolio { margin-top: 2.5rem; }
.portfolio + .portfolio { margin-top: 3.5rem; }
.label { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; }
.row { display: flex; gap: 1.5rem; align-items: flex-start; padding: 1rem 0; border-top: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.row:hover b { color: var(--acc); }
.row img { width: 11rem; aspect-ratio: 16 / 10; object-fit: cover; border-radius: .4rem; background: var(--chip); flex: none; }
.row p { margin: .2rem 0 0; max-width: 44rem; }
.row .chips { margin-top: .5rem; }
.meta { color: var(--muted); }
.area { display: block; font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--acc); margin: 0 0 .2rem; }
@media (max-width: 30rem) {
  .row { flex-direction: column; }
  .row img { width: 100%; }
}

/* Project pages */
.work h1 { margin-top: 3rem; font-size: clamp(1.8rem, 5vw, 2.4rem); }
.work .area { margin: 3rem 0 0; }
.work .area + h1 { margin-top: .3rem; }
.work .meta { margin: .3rem 0 0; }
.work .role { font-size: 1.1rem; margin: 1rem 0 0; }
.work h2 { font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 2.5rem 0 .5rem; }
.work p, .work li { max-width: 40rem; }
.work ul { padding-left: 1.2rem; }
.work li { margin: .3rem 0; }
.work a { color: var(--fg); text-underline-offset: .2em; }
.work a:hover { color: var(--acc); }
.picture { margin: 2rem 0 0; }
.picture img, .picture svg { display: block; max-width: 100%; height: auto; border-radius: .5rem; }
.picture figcaption { color: var(--muted); font-size: .85rem; margin-top: .5rem; max-width: 40rem; }
.work svg { color: var(--fg); max-width: 100%; height: auto; }
.work code { font-size: .9em; background: var(--chip); border-radius: .25rem; padding: .05rem .3rem; }
.term, .code { border: 1px solid var(--line); background: #0b0b0b; color: #d8d8d8; font: .8rem/1.55 ui-monospace, Menlo, monospace; border-radius: .5rem; padding: 1rem 1.1rem; overflow-x: auto; white-space: pre; margin: 0; }
.term { background: #141729; }
.term-next { margin-top: .75rem; }
.term .ok { color: #7fd47f; } .term .warn { color: #e8c66a; } .term .err { color: #ef8a80; } .term .dim { color: #8a8a8a; }
.figure, .picture { overflow-x: auto; }
@media (max-width: 30rem) {
  .figure svg, .picture svg { min-width: 36rem; }
  /* The diagram is wider than the screen; say so, and keep the note in place while it scrolls. */
  .figure:has(> svg)::after, .picture:has(> svg)::after { content: "Scroll sideways for the whole diagram →"; display: block; position: sticky; left: 0; width: max-content; font-size: .78rem; color: var(--muted); margin-top: .4rem; }
}
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 1rem 0 0; }
@media (max-width: 30rem) {
  .shots { grid-template-columns: repeat(2, 1fr); }
}
.shots img { width: 100%; border-radius: .4rem; display: block; }
footer a { color: var(--muted); }
footer a:hover { color: var(--acc); }
