/* Shared stylesheet for portfolio project pages (draft).
   Quiet, text-led, single narrow column; work shown in soft rounded cards. */

/* Site font: ABC Areal Semi Mono, the two weights the CSS uses (400, 500); no italics on the site.
   woff2 built from the desktop TTFs with every glyph and OpenType feature kept. */
@font-face {
  font-family: "ABC Areal Semi Mono";
  src: url("fonts/ABCArealSemiMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "ABC Areal Semi Mono";
  src: url("fonts/ABCArealSemiMono-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #ebebeb;      /* soft grey card behind work */
  --surface-2: #f5f5f5;    /* lighter fill for frames */
  --line: #ebebeb;
  --text: #000000;
  --text-2: #4d4d4d;       /* body copy */
  --text-3: #999999;       /* meta, breadcrumbs, captions */
  --phone: #111111;

  --font: "ABC Areal Semi Mono", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* the font's letter alternates: ss01 single-storey a, ss02 cross t, ss03 u without spur, ss04 straight-tail y,
     ss05 G, ss06 R, ss07 M W w, ss09 &. Left off: ss08 (slab i j l I 1, pushes it to full mono), ss10 schoolbook preset,
     ss11 round punctuation, ss12 black circled digits. `font` shorthands reset this, so they repeat it. */
  --font-features: "ss01", "ss02", "ss03", "ss04", "ss05", "ss06", "ss07", "ss09";
  --fs-body: 0.9375rem;   /* 15px: the semi-mono runs ~15% wider than Inter at the same size */
  --fs-small: 0.8125rem;  /* 13px: captions, labels, cards, counters */
  --col: 720px;
  --gutter: 24px;
  --gap: 16px;
  --radius: 10px;
  --section: 96px;
  --gallery: 960px;       /* gallery may run wider than the text column */
  --card-bg: #f5f5f5;
  --card-line: #ebebeb;
  --lb-bg: rgba(255, 255, 255, 0.97);
  --lb-btn: #f0f0f0;
  --lb-btn-hover: #e2e2e2;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  font-feature-settings: var(--font-features);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font-feature-settings: var(--font-features); }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--text); }

p { margin: 0; }
p + p { margin-top: 1em; }

.page {
  max-width: calc(var(--col) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 120px var(--gutter) 0;
}

/* Breadcrumb */
.crumbs { color: var(--text-3); }
.crumbs .sep { margin: 0 6px; }
.crumbs [aria-current] { color: var(--text); }

/* Project head */
.project-head { margin-top: 48px; }
.project-head h1,
.section-head h2 {
  margin: 0;
  font: inherit;
  color: var(--text);
  font-weight: 500;
}
.meta { color: var(--text-3); }
.intro { margin-top: 24px; max-width: 34em; }

/* Sections */
.section {
  margin-top: var(--section);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.section-head { margin-bottom: 32px; max-width: 34em; }
.section-head .meta { margin: 0 0 16px; }
.section-head h2 + .meta { margin-top: 0; }

.subhead {
  margin: 48px 0 16px;
  font: inherit;
  color: var(--text);
  font-weight: 500;
}
.note { margin-top: 16px; color: var(--text-3); max-width: 34em; }
.note-strong { margin-top: 40px; color: var(--text-2); max-width: 34em; }

/* Figures */
figure { margin: 0; }
figcaption { margin-top: 8px; color: var(--text-3); font-size: var(--fs-small); line-height: 1.5; }
.stack > * + * { margin-top: var(--gap); }

/* Card: rounded, hairline border, soft surface */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}
.card > img { width: 100%; }
.card.pad {
  background: var(--surface);
  padding: 40px;
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }

/* Browser frame (CSS only) */
.browser { background: var(--surface-2); }
.browser::before {
  content: "";
  display: block;
  height: 26px;
  background:
    radial-gradient(circle, #d4d4d4 3.5px, transparent 4px) 12px 50% / 10px 10px no-repeat,
    radial-gradient(circle, #d4d4d4 3.5px, transparent 4px) 26px 50% / 10px 10px no-repeat,
    radial-gradient(circle, #d4d4d4 3.5px, transparent 4px) 40px 50% / 10px 10px no-repeat;
  border-bottom: 1px solid var(--line);
}

/* Phone frames, shown in pairs on a grey card */
.phones {
  display: flex;
  justify-content: center;
  gap: 32px;
}
.phone {
  flex: 0 1 220px;
  border: 6px solid var(--phone);
  border-radius: 28px;
  overflow: hidden;
  background: var(--phone);
}
.phone img { border-radius: 22px; }

/* Horizontal carousel strip */
.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 38%;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 6px;
}
.strip > img {
  scroll-snap-align: start;
  border-radius: 6px;
}
.strip + .strip { margin-top: 8px; }

/* Posts inside cards keep a small radius */
.posts img { border-radius: 6px; }

/* Image gallery (project pages): even 6-col grid, images keep their own ratio.
   default = half width, .w = full width,
   .g-row = equal-height row of mixed ratios (each child sets --r = width/height). */
.g-group { margin-top: var(--section); }
.g-group + .g-group { padding-top: 32px; border-top: 1px solid var(--line); }
.g-label { color: var(--text-3); font-size: var(--fs-small); max-width: 40em; }
.gallery {
  --gw: min(var(--gallery), 100vw - var(--gutter) * 2);
  width: var(--gw);
  margin: 24px 0 0 calc((100% - var(--gw)) / 2);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}
.g-item {
  grid-column: span 3;
  display: block;
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  cursor: zoom-in;
  transition: opacity .2s ease;
}
.g-item:hover { opacity: .92; }
.g-item:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.g-item img { width: 100%; }
.g-item.w { grid-column: span 6; }
.g-row { grid-column: span 6; display: flex; gap: var(--gap); }
.g-row > .g-item { flex: var(--r) 1 0; min-width: 0; }

/* Gallery: three equal columns (.t), one shared aspect per item via --ar (w/h).
   Images are cropped to it so a "flat brand grid" lines up exactly. Phone: 2 columns. */
.g-item.t { grid-column: span 2; }
.g-item.t img { aspect-ratio: var(--ar, 0.8); height: auto; object-fit: cover; }

/* Lightbox (lightbox.js) */
.lb {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--lb-bg);
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s;
  touch-action: pan-y;
}
.lb.is-open { opacity: 1; visibility: visible; transition: opacity .2s ease; }
.lb-img {
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
  width: auto; height: auto;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--card-line);
  user-select: none; -webkit-user-drag: none;
}
.lb button {
  position: absolute;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  padding: 0; border: 0; border-radius: 50%;
  background: var(--lb-btn); color: var(--text);
  font: 20px/1 var(--font); font-feature-settings: var(--font-features); cursor: pointer;
}
.lb button:hover { background: var(--lb-btn-hover); }
.lb button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: var(--text-3); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
html.lb-lock { overflow: hidden; }

/* Footer */
.site-footer {
  margin-top: var(--section);
  padding: 32px 0 80px;
  border-top: 1px solid var(--line);
}
.site-footer .name { color: var(--text); }
.links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; }

/* Phone */
@media (max-width: 640px) {
  :root { --gutter: 20px; --gap: 12px; --section: 72px; }
  .page { padding-top: 56px; }
  .project-head { margin-top: 36px; }
  .card.pad { padding: 20px; }
  .phones { gap: 14px; }
  .phone { border-width: 4px; border-radius: 20px; }
  .phone img { border-radius: 16px; }
  .strip { grid-auto-columns: 68%; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter); }
  .gallery { grid-template-columns: 1fr 1fr; gap: 8px; }
  .g-item { grid-column: span 1; border-radius: 8px; }
  .g-item.w { grid-column: span 2; }
  .g-row { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .g-row > .g-item:last-child { grid-column: span 2; }
  .g-row-keep { display: flex; }
  .g-item.t { grid-column: span 1; }
  .lb-img { max-width: 100vw; max-height: calc(100dvh - 120px); border-radius: 0; box-shadow: none; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
  .lb-count { bottom: 22px; }
  .browser::before { height: 18px; background-size: 8px 8px; background-position: 9px 50%, 20px 50%, 31px 50%; }
}

/* video tiles */
.g-video { cursor: default; }
.g-video:hover { opacity: 1; }
.g-video video { display: block; width: 100%; height: auto; }
