:root { --mono: "Geist Mono", ui-monospace, monospace; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
/* Keep the header still between pages: reserve the scrollbar's space even before the page is tall enough to scroll */
html { scrollbar-gutter: stable; }
/* Crossfade from page to page instead of a hard cut */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.45); outline-offset: 3px; border-radius: 2px; }

.page {
  min-height: 100vh;
  background-image: radial-gradient(rgba(var(--ink-rgb), var(--dot)) 1px, transparent 1px);
  background-size: 22px 22px;
  font-family: "Geist", system-ui, sans-serif;
}
.noscript { max-width: 560px; margin: 0 auto; padding: 0 28px 140px; color: var(--ink2); }

/* Header */
.head { box-sizing: content-box; max-width: 1240px; margin: 0 auto; padding: 72px 28px 56px; display: grid; gap: 28px; }
.head-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.brand { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--ink); }
.brand img { display: block; width: 22px; height: 22px; }
.brand .name { white-space: nowrap; }
.brand .role { color: var(--muted); padding-left: 12px; border-left: 1px solid rgba(var(--ink-rgb), 0.3); white-space: nowrap; }
.head-top nav { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.head-top nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 1px solid rgba(var(--ink-rgb), 0.18); border-radius: 999px; background: rgba(255, 255, 255, 0.35); color: var(--ink); text-decoration: none; line-height: 1; white-space: nowrap; transition: color 0.15s, border-color 0.15s, background-color 0.15s; }
.head-top nav a:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.45); background: rgba(var(--accent-rgb), 0.06); }
.head-top nav a:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.5); outline-offset: 2px; }
.head h1 { margin: 0; font-weight: 500; font-size: clamp(56px, 10vw, 128px); line-height: 0.92; letter-spacing: -0.05em; text-wrap: balance; }
.head h1 em { font-style: normal; color: var(--brick); }
.lede { margin: 0; max-width: 560px; font-size: 22px; line-height: 1.4; color: var(--ink2); text-wrap: pretty; }

/* Projects: image beside text, alternating sides on wide screens */
.projects { box-sizing: content-box; max-width: 1240px; margin: 0 auto; padding: 0 28px 140px; }
.project { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px 64px; align-items: center; padding: 56px 0; border-top: 1px solid rgba(var(--ink-rgb), 0.15); }
.frame-wrap { display: flex; justify-content: center; }
.project:nth-child(even) .frame-wrap { order: 2; }
.frame { position: relative; width: 100%; max-width: 100%; overflow: hidden; border-radius: 10px; background: rgba(var(--ink-rgb), 0.06); border: 1px solid rgba(var(--ink-rgb), 0.12); box-shadow: var(--frame-shadow); }
.frame.mobile { width: 300px; aspect-ratio: 9 / 19.5; border-radius: 28px; }
.frame.desktop { aspect-ratio: 16 / 10; }
.frame.photo { aspect-ratio: 4 / 3; }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* A phone screenshot over the frame's bottom-right corner (see `phone` in projects.js) */
.frame-wrap.has-phone { position: relative; padding: 0 6% 9% 0; }
.phone { position: absolute; right: 0; bottom: 0; width: 24%; padding: 4px; border-radius: 22px; background: #0b1220; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 24px 48px -18px rgba(30, 30, 40, 0.6); }
.phone img { display: block; width: 100%; height: auto; border-radius: 18px; }

.project-text { display: grid; gap: 14px; max-width: 520px; min-width: 0; }
.project-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.project h2 { margin: 0; font-weight: 500; font-size: clamp(30px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }
.project-link { white-space: nowrap; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); text-decoration: none; border-bottom: 1.5px solid var(--accent); padding-bottom: 2px; }
.project-link:hover { color: var(--ink); border-bottom-color: var(--ink); }
.story { margin: 0; font-size: 18px; line-height: 1.5; color: var(--ink2); text-wrap: pretty; }
.story a { color: var(--accent); }
.story a:hover { color: var(--ink); }
.how { display: grid; gap: 6px; padding-top: 14px; margin-top: 4px; border-top: 1px solid rgba(var(--ink-rgb), 0.1); }
.how span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.how p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink2); text-wrap: pretty; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 2px; }
.mau { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--ink2); }
.mau span { margin-right: 6px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tag { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; padding: 4px 9px; border-radius: 6px; background: rgba(var(--accent-rgb), 0.12); color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.22); }

@media (max-width: 339px) {
  /* Only on very narrow screens does the role drop under the name */
  .brand .role { flex-basis: 100%; padding-left: 34px; border-left: 0; }
}

/* One column: image above text */
@media (max-width: 759px) {
  .head { padding-top: 56px; }
  .head-top { font-size: 11px; letter-spacing: 0.08em; }
  .head-top nav { gap: 8px; }
  .head-top nav a { padding: 7px 11px; }
  .lede { font-size: 19px; }
  .project { grid-template-columns: minmax(0, 1fr); }
  .project:nth-child(even) .frame-wrap { order: 0; }
}

/* "See more": a dialog of extra screenshots and a "How it works" list (see `more` in projects.js) */
button.project-link { background: none; border-width: 0 0 1.5px; border-radius: 0; cursor: pointer; font-family: var(--mono); }
.more { width: min(1040px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid rgba(var(--ink-rgb), 0.15); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--card-shadow); }
.more::backdrop { background: rgba(var(--ink-rgb), 0.55); }
/* The padding sits on .more-body so a click on the backdrop is the only click that lands on the dialog itself */
.more-body { display: grid; gap: 28px; padding: 28px 32px 36px; }
.more-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.more h2 { font-size: clamp(26px, 3.4vw, 34px); }
.more-close { width: 40px; height: 40px; flex: none; display: grid; place-items: center; padding: 0; border: 1px solid rgba(var(--ink-rgb), 0.2); border-radius: 50%; background: none; color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.more-close:hover { color: var(--accent); border-color: var(--accent); }
.more-close:focus-visible, button.project-link:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.45); outline-offset: 3px; }
.shots { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; align-items: start; }
.shot { margin: 0; display: grid; gap: 10px; justify-items: center; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid rgba(var(--ink-rgb), 0.15); box-shadow: var(--frame-shadow); }
.shot.board img { aspect-ratio: 4 / 3; border-radius: 6px; background: #fff; }
.shot.mobile img { aspect-ratio: 599 / 1346; border-radius: 24px; }
.shot figcaption { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-align: center; }
.more .how { margin-top: 0; max-width: 720px; }
.more ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 16px; line-height: 1.55; color: var(--ink2); text-wrap: pretty; }
.more ol li::marker { font-family: var(--mono); font-size: 13px; color: var(--muted); }

@media (max-width: 759px) {
  .more-body { padding: 20px 16px 28px; gap: 22px; }
  .shots { grid-template-columns: minmax(0, 1fr); }
  .shot.mobile img { width: min(240px, 100%); }
  .more ol { font-size: 15px; }
}
