/* pabz.dev: Drawing Set. Mobile first; wider layouts are added at the bottom. */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("fonts/big-shoulders-display.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --sky: #162b66;        /* top of the page, just after sunset */
  --blue: #0f1f4b;       /* the sheet ground */
  --deep: #070e29;       /* bottom of the page, full dark */
  --line: #e3ebff;       /* every drawn line and all primary text */
  --dim: #aebdea;        /* secondary text, tinted from the blue */
  --grid: rgba(227, 235, 255, 0.055);
  --amber: #f5b46a;      /* afterglow: actions and status only */
  --on-amber: #0b1638;
  --ok: #9fe3b4;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Archivo", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --gutter: 16px;
  --pad: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--deep); scroll-behavior: smooth; scroll-padding-top: 1rem; scrollbar-color: var(--dim) var(--deep); }
body {
  margin: 0;
  background: linear-gradient(var(--sky), var(--blue) 28rem, var(--deep)) var(--blue);
  color: var(--line);
  font: 400 1rem/1.55 var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
}
::selection { background: var(--amber); color: var(--on-amber); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
h1, h2, h3, p, ol, ul, dl, dd, figure, pre, table { margin: 0; }
ol, ul { padding: 0; list-style: none; }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: var(--gutter); top: 0.5rem; z-index: 20; background: var(--amber); color: var(--on-amber); padding: 0.5rem 0.75rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.dim { color: var(--dim); }
.amber { color: var(--amber); }

/* The small tracked caps used for cell labels and table captions. */
.label, dt, th[scope="col"], figcaption {
  font: 500 0.75rem/1.3 var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  background: var(--amber); color: var(--on-amber);
  border: 1px solid var(--amber);
  font: 800 1.25rem/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { background: transparent; color: var(--amber); }
.btn:active { transform: translateY(1px); }

/* ---------- sheets ---------- */
main { padding: var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr); gap: 3.5rem; }
#work { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3.5rem; }
.sheet {
  border: 1px solid var(--line);
  background-color: var(--blue);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}
h1, h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; line-height: 0.88; letter-spacing: 0.01em; text-wrap: balance; }
h1 { font-size: clamp(6.5rem, 38vw, 12rem); margin-left: -0.03em; }
h2 { font-size: clamp(2.75rem, 12vw, 4.5rem); }
p { max-width: 62ch; text-wrap: pretty; }

/* ---------- cover ---------- */
.lead { padding: 1.5rem var(--pad) 2rem; }
.offer { margin-top: 1rem; font-size: 1.25rem; line-height: 1.4; max-width: 40ch; }
.offer span { display: inline-block; }
.actions { margin-top: 1.5rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }

/* The viewer is a sideways strip: swipe it on a phone, or point at an index row. */
.viewer {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  border-top: 1px solid var(--line);
  scrollbar-width: none;
}
.viewer::-webkit-scrollbar { display: none; }
.viewer figure { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; padding: var(--pad); display: flex; flex-direction: column; }
figcaption { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.6rem; }
figcaption span:first-child { color: var(--line); }

.frame { border: 1px solid var(--line); background: var(--deep); overflow: hidden; }
.browser::before {
  content: ""; display: block; height: 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, transparent 6px, var(--line) 6px, var(--line) 12px, transparent 12px, transparent 16px, var(--line) 16px, var(--line) 22px, transparent 22px) 0 4px / 100% 6px no-repeat var(--blue);
}
.viewer .frame { aspect-ratio: 1440 / 914; }
.plate { display: flex; align-items: center; justify-content: center; gap: 8%; padding: 3%; background: transparent; }
.plate .case { height: 100%; width: auto; min-width: 0; }
.plate .lcd { height: 100%; width: auto; min-width: 0; border: 1px solid var(--line); image-rendering: pixelated; }

.term { padding: 1rem; display: flex; align-items: center; }
.viewer .term pre { font-size: 0.6875rem; }
.term pre { font: 0.8125rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.term .p { color: var(--dim); }
.term b { color: var(--ok); font-weight: 400; }
.term i { color: var(--amber); font-style: normal; }

/* Project list: one row per project, any number of rows. */
.index > li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem 1rem; align-items: center;
  padding: 0.8rem var(--pad);
  border-top: 1px solid var(--line);
}
.index .name { font: 800 1.75rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; text-decoration: none; padding: 0.4rem 0; }
.index .tech { grid-column: 1; grid-row: 2; display: flex; gap: 0.9rem; color: var(--dim); }
.index .tech .tip { width: 1.75rem; height: 1.75rem; align-items: center; justify-content: center; }
.index .tech svg { display: block; width: 1.75rem; height: 1.75rem; fill: currentColor; }
.index .visit { grid-column: 2; grid-row: 1 / 3; justify-self: end; }
.index > li:is(:hover, :focus-within, .on) { background: var(--line); color: var(--on-amber); }
.index > li:is(:hover, :focus-within, .on) :is(.name, .tech) { color: var(--on-amber); }
.index > li:is(:hover, :focus-within, .on) .visit { border-color: var(--on-amber); color: var(--on-amber); }
.index > li:is(:hover, :focus-within, .on) .visit:hover { background: var(--on-amber); color: var(--line); }

/* ---------- project sheets ---------- */
.project { display: grid; grid-template-columns: minmax(0, 1fr); }
.project .text { padding: 1.5rem var(--pad) 0; display: flex; flex-direction: column; }
.project .text p { margin-top: 1rem; }
.go { margin-top: 1.25rem; }
.visit { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; padding: 0.7rem 1rem; border: 1px solid var(--amber); color: var(--amber); font: 800 1.125rem/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.visit:hover { background: var(--amber); color: var(--on-amber); }
.visit svg { width: 0.8em; height: 0.8em; fill: none; stroke: currentColor; stroke-width: 1.5; }
.figs { padding: 1.5rem var(--pad) var(--pad); display: grid; gap: 1.25rem; align-content: start; order: 2; min-width: 0; }
.project .text { order: 1; }

.tb { display: grid; grid-template-columns: 1fr 1fr; margin: 1.75rem calc(-1 * var(--pad)) 0; border-top: 1px solid var(--line); }
.tb > div { padding: 0.7rem var(--pad) 0.8rem; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.tb > div:nth-child(odd):not(.wide) { border-right: 1px solid var(--line); }
.tb .wide { grid-column: 1 / -1; }
dt { margin-bottom: 0.2rem; }

.project h2 { display: flex; align-items: center; gap: 0.3em; flex-wrap: wrap; }
.logo { height: 0.82em; width: auto; flex: none; }
.tb.kit { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.25rem; padding: 0.9rem var(--pad); border-bottom: 1px solid var(--line); }
.kinds, .stack { display: flex; flex-wrap: wrap; gap: 1rem; }
.stack { padding-left: 1.25rem; border-left: 1px solid var(--line); }
.kit .tip { width: 2.25rem; height: 2.25rem; align-items: center; justify-content: center; }
.kit svg { display: block; width: 2.25rem; height: 2.25rem; }
.kinds svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.stack svg { fill: currentColor; }
/* Icon name on hover, keyboard focus, or tap. */
.tip { position: relative; display: inline-flex; cursor: default; }
.tip::after {
  content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 0.5rem); z-index: 5;
  padding: 0.35rem 0.55rem; background: var(--deep); color: var(--line); border: 1px solid var(--line);
  font: 500 0.75rem/1 var(--body); letter-spacing: 0.04em; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s var(--ease);
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; }
.duo { grid-template-columns: 1fr; }
.duo .phone { width: 72%; }
.screens { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 0.5rem; scrollbar-width: thin; }
.screens figure { flex: none; scroll-snap-align: start; }
.screens .frame { background: #fff; }
.casefig img { height: 402px; width: auto; max-width: none; }
.px { width: 240px; max-width: none; image-rendering: pixelated; }
.pair { display: grid; gap: 1.25rem; }
.board { width: 62%; }

/* ---------- contact ---------- */
.plain { padding: 1.5rem var(--pad) 2rem; min-width: 0; }
.cover { min-width: 0; }
.lead, .text { min-width: 0; }
.plain > h2 { margin-bottom: 1.5rem; }
.contact .offer { max-width: 46ch; }
.reach { grid-template-columns: 1fr; margin-bottom: -2rem; }
.reach > div:nth-child(odd):not(.wide) { border-right: 0; }
.reach > div:last-child { border-bottom: 0; }
.reach dd { font: 800 1.75rem/1.1 var(--display); letter-spacing: 0.02em; }
.reach dd a { text-decoration-color: var(--amber); }
.copy {
  margin-left: 0.5rem; min-height: 2.75rem; padding: 0.45rem 0.9rem; vertical-align: middle;
  background: transparent; color: var(--amber); border: 1px solid var(--amber);
  font: 500 0.75rem/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}
.copy:hover { background: var(--amber); color: var(--on-amber); }

.foot { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem var(--gutter) 2rem; color: var(--dim); font-size: 0.875rem; }

/* ---------- motion: the frame is there first, the picture registers in ---------- */
@keyframes register { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@media (prefers-reduced-motion: no-preference) {
  .viewer figure.redraw .frame > * { animation: register 0.55s var(--ease) both; }
  @supports (animation-timeline: view()) {
    .project .frame > :is(img, pre) { animation: register linear both; animation-timeline: view(); animation-range: entry 5% cover 32%; }
  }
}
@media (prefers-reduced-motion: reduce) { html { background: var(--deep); scroll-behavior: auto; } }

/* ---------- wider screens ---------- */
@media (min-width: 40rem) {
  :root { --gutter: 24px; --pad: 24px; }
  .duo { grid-template-columns: 3.3fr 1fr; align-items: end; }
  .duo .phone { width: auto; }
  .pair { grid-template-columns: 1fr 2.1fr; align-items: end; }
  .board { width: auto; }
  .reach { grid-template-columns: repeat(3, 1fr); }
  .reach > div { border-bottom: 0; }
  .reach > div:not(:last-child) { border-right: 1px solid var(--line) !important; }
  .index > li { grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) 9rem; }
  .index .tech { grid-column: 2; grid-row: 1; }
  .index .visit { grid-column: 3; grid-row: 1; }
  .term pre, .viewer .term pre { font-size: 0.9375rem; }
}

@media (min-width: 60rem) {
  :root { --gutter: 32px; --pad: 32px; }
  main, #work { gap: 5rem; }
  .cover { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .lead { padding-block: 2.5rem; align-self: center; }
  h1 { font-size: clamp(9rem, 17vw, 15rem); }
  .offer { font-size: 1.5rem; }
  .viewer { border-top: 0; border-left: 1px solid var(--line); }
  .index-wrap { grid-column: 1 / -1; }
  .index .name { font-size: 2rem; }

  .project { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  .project .text { padding-block: 2rem 0; border-right: 1px solid var(--line); }
  .project .tb { margin-top: auto; }
  .project .text > p:last-of-type { margin-bottom: 2rem; }
  .figs { padding-block: 2rem; }
  .flip { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .flip .text { order: 2; border-right: 0; border-left: 1px solid var(--line); }
  .flip .figs { order: 1; }
  .stagger { grid-template-columns: 1fr 1fr; }
  .stagger figure + figure { margin-top: 4rem; }
  .screens { gap: 1rem; }
  .project .term { padding: 2rem; }
  .project .term pre { font-size: 1.125rem; }
  .plain { padding-block: 2.5rem 3rem; }
  .reach { margin-bottom: -3rem; margin-top: 2.5rem; }
}
