:root {
  color-scheme: dark;
  --ink: #181816;
  --paper: #f8f4ea;
  --muted: #ddc49c;
  --lime: #b7ff00;
  --line: rgb(255 255 255 / .38);
  --header-height: 76px;
  --side: 5%;
  --dock-space: 135px;
  --action-height: 48px;
  --page-height: 44px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ink); color: var(--paper); font: 1rem/1.5 Arial, sans-serif; }
button, a { color: inherit; font: inherit; }
a { text-decoration: none; }
button { cursor: pointer; }
button:disabled { opacity: .38; cursor: default; }
:where(a, button):focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.75rem, 7vw, 5.75rem); letter-spacing: -.06em; line-height: .98; }
h1:focus { outline: none; }
.topbar {
  height: var(--header-height);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: max(var(--side), env(safe-area-inset-left)) max(var(--side), env(safe-area-inset-right));
}
.brand { display: flex; align-items: center; }
.brand img { width: 36px; height: auto; display: block; }
.button, .method {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgb(22 22 19 / .72);
  color: var(--paper); white-space: nowrap; line-height: 1.15;
  -webkit-tap-highlight-color: transparent;
}
.button { min-height: var(--page-height); padding: .55rem 1.1rem; }
.primary { background: var(--lime); color: var(--ink); font-weight: 650; border-color: var(--lime); }
@media (hover: hover) {
  :is(.button, .method):hover:not(:disabled) { border-color: var(--paper); }
  .primary:hover { background: #ceff52; color: var(--ink); }
  .detail-link:hover { color: var(--lime); }
}
.stage {
  position: relative; isolation: isolate;
  display: flex; align-items: flex-end;
  min-height: max(25rem, calc(100svh - var(--header-height)));
  padding: 1.75rem max(var(--side), env(safe-area-inset-right)) calc(var(--dock-space) + env(safe-area-inset-bottom)) max(var(--side), env(safe-area-inset-left));
}
.photo, .stage::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo { object-fit: cover; z-index: -2; }
.stage::after {
  content: ""; z-index: -1; pointer-events: none;
  background: linear-gradient(0deg, rgb(0 0 0 / .78), transparent 65%), linear-gradient(90deg, rgb(0 0 0 / .42), transparent 70%);
}
.stage-end {
  width: 100%; display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "copy copy" "actions utility";
  grid-template-rows: auto var(--action-height);
  gap: 1.4rem 1.5rem; align-items: center;
}
.hero-copy { grid-area: copy; max-width: 52rem; }
.eyebrow {
  color: var(--muted); font: .875rem/1.6 "IBM Plex Mono", ui-monospace, monospace;
  text-transform: uppercase; letter-spacing: .12em; margin-bottom: .75rem;
}
.actions { grid-area: actions; display: flex; gap: .65rem; align-items: center; }
.actions .button { height: var(--action-height); padding-inline: 1.25rem; }
.utility { grid-area: utility; display: flex; align-items: center; justify-content: flex-end; height: var(--page-height); }
.pager { display: flex; align-items: center; gap: .5rem; }
.pager .button { height: var(--page-height); font-variant-numeric: tabular-nums; }
.cover-note { color: rgb(248 244 234 / .84); font-size: .8125rem; }
.sections {
  position: fixed; z-index: 3; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  display: flex; max-width: 96%; overflow-x: auto;
  padding: 6px; background: rgb(24 24 22 / .94); backdrop-filter: blur(12px); border: 1px solid rgb(255 255 255 / .2); border-radius: 999px;
  scrollbar-width: none;
}
.sections::-webkit-scrollbar { display: none; }
.sections a { padding: .72rem 1.05rem; border-radius: 999px; white-space: nowrap; font-size: .875rem; text-align: center; }
.sections a[aria-current="page"] { background: #f3eddf; color: var(--ink); }
.sections a:focus-visible { outline-offset: -3px; }
.contact {
  min-height: calc(100svh - var(--header-height));
  padding: clamp(2.8rem, 7vh, 5rem) 7% calc(7.5rem + env(safe-area-inset-bottom));
}
.contact h1 { max-width: 56rem; }
.identity { font-size: 1.0625rem; margin-top: 1.4rem; }
.contact-methods { display: flex; gap: .75rem; flex-wrap: wrap; margin: 2rem 0 1.5rem; }
.method { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; min-width: 12rem; padding: .9rem 1.4rem; border-radius: 1.2rem; }
.method strong { font-size: 1.0625rem; }
.method span { opacity: .82; font-size: .875rem; font-weight: 400; }
.contact-note { font-size: 1rem; }
dialog { background: var(--ink); color: var(--paper); border: 1px solid var(--line); }
dialog::backdrop { background: rgb(0 0 0 / .76); backdrop-filter: blur(6px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.dialog-heading h2 { font-size: clamp(1.2rem, 3vw, 1.65rem); line-height: 1.15; letter-spacing: -.035em; }
#project-index { width: min(32rem, 92vw); max-height: 85svh; border-radius: 1.35rem; padding: 1.4rem; }
#index-list { display: grid; margin-top: 1rem; }
#index-list > * { padding: .9rem 0; border-top: 1px solid rgb(255 255 255 / .18); }
#index-list [aria-current] { color: var(--lime); }
.viewer {
  width: 100%; height: 100%; max-width: none; max-height: none; border: 0; margin: 0;
  padding: max(1rem, env(safe-area-inset-top)) 4% max(1rem, env(safe-area-inset-bottom)); background: #121211;
}
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 1rem; }
.viewer img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 760px) {
  :root { --header-height: 62px; --dock-space: 100px; --action-height: 44px; }
  .stage { min-height: max(28rem, calc(100svh - var(--header-height))); }
  .stage-end {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "actions" "utility";
    grid-template-rows: auto var(--action-height) var(--page-height);
    gap: 1.15rem;
  }
  .hero-copy h1 { font-size: clamp(2.5rem, 9vw, 4rem); }
  .photo { object-position: var(--focus, 65% center); }
  .eyebrow { font-size: .8125rem; }
  .actions { gap: .5rem; }
  .actions .button { padding-inline: .95rem; font-size: .875rem; }
  .cover-note { margin-right: auto; }
  .pager .button { padding-inline: .85rem; font-size: .875rem; }
  .sections { bottom: calc(10px + env(safe-area-inset-bottom)); width: 94%; }
  .sections a { flex: 1 0 auto; padding: .72rem .5rem; }
  .contact h1 { font-size: clamp(2.5rem, 9vw, 4rem); }
  .contact-methods { flex-direction: column; max-width: 27rem; gap: .6rem; margin: 1.6rem 0; }
  .method { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 56px; padding: .85rem 1.1rem; border-radius: 1.1rem; }
}
@media (max-width: 380px) {
  .sections a { padding-inline: .36rem; font-size: .8125rem; }
  .actions .button { padding-inline: .7rem; }
  .method { padding-inline: .8rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  :root { --header-height: 52px; --dock-space: 72px; --action-height: 42px; --page-height: 40px; }
  .brand img { width: 28px; }
  .stage { min-height: max(18rem, calc(100svh - var(--header-height))); padding-top: .75rem; }
  .stage-end { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "copy copy" "actions utility"; grid-template-rows: auto var(--action-height); gap: .65rem; }
  .hero-copy h1 { font-size: clamp(1.9rem, 5.3vw, 3rem); }
  .eyebrow { margin-bottom: .3rem; }
  .sections { bottom: calc(6px + env(safe-area-inset-bottom)); }
  .utility .cover-note { max-width: 13rem; }
}

.gallery-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; }
#gallery-count { min-width: 3rem; text-align: center; font-size: .875rem; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  #quote .quote-channel { display: block; }
}
