/* ============================================================
   Beckett Mazeau — Portfolio (Direction B: Product Grid)
   Themeable: [data-theme="dark"] default, [data-theme="light"]
   Type: Helvetica Neue (grotesk) + IBM Plex Mono (engineering meta)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --sans: "Helvetica Neue", Helvetica, "Arial Nova", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --maxw: 1240px;
  --pad: 56px;
  --radius: 14px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

/* ---- DARK (default) ---- */
[data-theme="dark"] {
  --bg: #0b0c0e;
  --panel: #131417;
  --panel2: #17191d;
  --text: #f4f4f2;
  --muted: #8b8f96;
  --faint: #5c6068;
  --line: rgba(255,255,255,0.10);
  --line2: rgba(255,255,255,0.06);
  --accent: #ff5a2a;
  --accent-ink: #140a06;
  --accent-soft: rgba(255,90,42,0.14);
  --frame-photo: #1c1e22;
  --frame-light: #f4f4f2;
  --led: #36d07f;
  color-scheme: dark;
}
/* ---- LIGHT ---- */
[data-theme="light"] {
  --bg: #f4f3ef;
  --panel: #ffffff;
  --panel2: #faf9f5;
  --text: #16150f;
  --muted: #6c6a61;
  --faint: #9a978d;
  --line: rgba(20,19,12,0.13);
  --line2: rgba(20,19,12,0.07);
  --accent: #ff4d1f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255,77,31,0.10);
  --frame-photo: #ece9e2;
  --frame-light: #ffffff;
  --led: #1c9c5c;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.accent { color: var(--accent); }

/* ============================ NAV ============================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad);
  height: 72px; display: flex; align-items: center; justify-content: space-between;
}
.nav .brand { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.nav .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.nav .right { display: flex; align-items: center; gap: 26px; }
.nav .links { display: flex; align-items: center; gap: 26px; }
.nav .links a { font-size: 14px; color: var(--muted); position: relative; }
.nav .links a:hover { color: var(--text); }
.nav .links a.active { color: var(--text); }
.nav .links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -26px; height: 2px; background: var(--accent);
}
.nav .tools { display: flex; align-items: center; gap: 14px; }
.toggle {
  width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
}
.toggle:hover { color: var(--text); border-color: var(--muted); }
.toggle svg { width: 17px; height: 17px; }
.toggle .ico-sun { display: none; }
[data-theme="light"] .toggle .ico-sun { display: block; }
[data-theme="light"] .toggle .ico-moon { display: none; }
.cta {
  font-size: 13px; font-family: var(--mono); color: var(--accent-ink); background: var(--accent);
  padding: 9px 16px; border-radius: 8px; font-weight: 500; transition: filter .2s, transform .2s; white-space: nowrap;
}
.cta:hover { filter: brightness(1.08); }
.hamburger { display: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--text); cursor: pointer; }
.hamburger span { display: block; width: 16px; height: 1.6px; background: currentColor; margin: 3px auto; transition: .25s; }

/* mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  display: flex; flex-direction: column; padding: 24px var(--pad);
  transform: translateY(-100%); transition: transform .4s var(--ease); visibility: hidden;
}
.mobile-menu.open { transform: translateY(0); visibility: visible; }
.mobile-menu .mhead { display: flex; align-items: center; justify-content: space-between; height: 48px; }
.mobile-menu .mlinks { display: flex; flex-direction: column; gap: 4px; margin-top: 40px; }
.mobile-menu .mlinks a { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mobile-menu .mlinks a .n { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-right: 14px; vertical-align: middle; }
.mobile-menu .mfoot { margin-top: auto; color: var(--muted); font-size: 14px; display: flex; gap: 18px; }

/* ============================ HERO (home) ============================ */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 60px; padding: 88px 0 76px; align-items: center; }
.hero .status { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); margin-bottom: 28px; font-size: 12px; }
.hero .status .led { width: 8px; height: 8px; border-radius: 50%; background: var(--led); box-shadow: 0 0 0 3px color-mix(in srgb, var(--led) 22%, transparent); }
.hero h1 { margin: 0; font-size: clamp(48px, 7vw, 92px); line-height: 0.94; font-weight: 600; letter-spacing: -0.035em; }
.hero h1 .tag { color: var(--accent); display: block; }
.hero p { margin: 30px 0 0; font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 460px; }
.hero .actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn { font-size: 14px; padding: 12px 20px; border-radius: 9px; font-weight: 500; transition: transform .2s, filter .2s; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border: 1px solid var(--line); color: var(--text); background: transparent; }
.btn.ghost:hover { border-color: var(--muted); }

.spec { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec .sh { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.spec .srow { display: flex; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line2); font-size: 14px; }
.spec .srow:last-child { border-bottom: 0; }
.spec .srow .v { color: var(--muted); font-family: var(--mono); font-size: 13px; }

/* ============================ SECTION HEAD ============================ */
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 56px 0 26px; gap: 16px; }
.section-head .label b { color: var(--accent); font-weight: 500; }
.section-head .all { font-size: 14px; color: var(--muted); }
.section-head .all:hover { color: var(--accent); }

/* ============================ PAGE HEAD (subpages) ============================ */
.pagehead { padding: 64px 0 40px; }
.pagehead .crumb { color: var(--muted); font-size: 13px; margin-bottom: 28px; display: inline-flex; gap: 8px; align-items: center; }
.pagehead .crumb:hover { color: var(--accent); }
.pagehead h1 { margin: 0; font-size: clamp(40px, 6vw, 76px); line-height: 0.96; font-weight: 600; letter-spacing: -0.035em; }
.pagehead p { margin: 24px 0 0; color: var(--muted); font-size: 18px; max-width: 620px; line-height: 1.6; }

/* ============================ CARD GRID ============================ */
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .32s var(--ease); display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--panel2); }
.card .frame { aspect-ratio: 16 / 10; background: var(--frame-photo); overflow: hidden; display: grid; place-items: center; position: relative; }
.card .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .frame img { transform: scale(1.04); }
.card.contain .frame { background: var(--frame-light); }
.card.contain .frame img { object-fit: contain; padding: 22px; transform: none !important; }
.card .body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.card .top { display: flex; justify-content: flex-start; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 12px; font-family: var(--mono); }
.card .top .num { color: var(--accent); }
.card h3 { margin: 0 0 8px; font-size: 23px; font-weight: 600; letter-spacing: -0.02em; }
.card .desc { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.card .arrow { margin-top: 16px; color: var(--accent); font-size: 13px; font-family: var(--mono); opacity: 0; transform: translateX(-6px); transition: .3s var(--ease); }
.card:hover .arrow { opacity: 1; transform: translateX(0); }

/* ============================ UPDATES ============================ */
.updates { padding: 18px 0 0; }
.urow { display: grid; grid-template-columns: 130px 1fr auto; gap: 24px; align-items: center; padding: 22px 4px; border-top: 1px solid var(--line); transition: padding-left .25s var(--ease); }
.urow:last-child { border-bottom: 1px solid var(--line); }
.urow:hover { padding-left: 14px; }
.urow .ud { color: var(--muted); font-size: 13px; }
.urow .ut { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.urow:hover .ut { color: var(--accent); }
.urow .ua { color: var(--muted); transition: transform .25s; }
.urow:hover .ua { color: var(--accent); transform: translateX(4px); }

/* ============================ PROJECT DETAIL ============================ */
.detail-meta { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 8px; }
.detail-meta .m { flex: 1; min-width: 160px; padding: 18px 22px; border-right: 1px solid var(--line2); }
.detail-meta .m:last-child { border-right: 0; }
.detail-meta .m .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.detail-meta .m .vv { margin-top: 6px; font-size: 16px; font-weight: 500; }

.body-sections { padding: 56px 0 8px; max-width: 760px; }
.body-sections .blk { padding: 28px 0; border-top: 1px solid var(--line2); }
.body-sections .blk:first-child { border-top: 0; }
.body-sections h2 { margin: 0 0 16px; font-size: 15px; font-family: var(--mono); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.body-sections p { margin: 0 0 16px; font-size: 18px; line-height: 1.7; color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.body-sections p:last-child { margin-bottom: 0; }

.gallery-head { padding: 40px 0 24px; }
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.gitem { grid-column: span 3; background: var(--frame-photo); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: zoom-in; position: relative; aspect-ratio: 3/2; }
.gitem.wide { grid-column: span 6; aspect-ratio: 2/1; }
.gitem.tall { grid-column: span 2; aspect-ratio: 3/4; }
.gitem.contain { background: var(--frame-light); }
.gitem img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gitem.contain img { object-fit: contain; padding: 20px; }
.gitem:hover img { transform: scale(1.03); }
.gitem.contain:hover img { transform: none; }
.gitem .zoom { position: absolute; bottom: 12px; right: 12px; width: 34px; height: 34px; border-radius: 8px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); display: grid; place-items: center; color: var(--text); opacity: 0; transition: .25s; border: 1px solid var(--line); }
.gitem:hover .zoom { opacity: 1; }
.gcap { margin-top: 10px; }

/* prev/next project nav */
.pn-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 64px 0; margin-top: 40px; border-top: 1px solid var(--line); }
.pn { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.pn:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--panel2); }
.pn .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.pn .t { margin-top: 8px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.pn.next { text-align: right; }

/* ============================ UPDATE DETAIL ============================ */
.post { max-width: 680px; margin: 0 auto; padding: 64px 0 8px; }
.post .crumb { color: var(--muted); font-size: 13px; margin-bottom: 28px; display: inline-flex; gap: 8px; }
.post .crumb:hover { color: var(--accent); }
.post .date { color: var(--accent); font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; }
.post h1 { margin: 14px 0 0; font-size: clamp(34px, 5vw, 56px); line-height: 1.02; font-weight: 600; letter-spacing: -0.03em; }
.post .lede { margin: 24px 0 0; font-size: 20px; line-height: 1.6; color: var(--muted); }
.post .content { margin-top: 40px; }
.post .content p { font-size: 18px; line-height: 1.75; margin: 0 0 22px; color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.post figure { margin: 36px 0; }
.post figure .ph { background: var(--frame-photo); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.post figure.contain .ph { background: var(--frame-light); }
.post figure .ph img { width: 100%; object-fit: cover; }
.post figure.contain .ph img { object-fit: contain; padding: 18px; }
.post figcaption { margin-top: 10px; }
.cap { color: var(--faint); font-family: var(--mono); font-size: 12px; }

/* ============================ FOOTER ============================ */
.foot { border-top: 1px solid var(--line); margin-top: 80px; }
.foot .inner { display: flex; justify-content: space-between; align-items: flex-end; padding: 72px 0 56px; gap: 40px; flex-wrap: wrap; }
.foot .big { font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; }
.foot .big .em { color: var(--accent); }
.foot .big a:hover { color: var(--accent); }
.foot .c { color: var(--muted); font-size: 13px; text-align: right; line-height: 1.9; font-family: var(--mono); }
.foot .c a:hover { color: var(--accent); }

/* ============================ LIGHTBOX ============================ */
.lightbox { position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, #000 86%, transparent); display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity .25s; }
.lightbox.open { display: flex; opacity: 1; }
.lightbox .lb-stage { position: relative; max-width: 92vw; max-height: 84vh; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lightbox .lb-imgwrap { background: #0e0e10; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; overflow: hidden; display: grid; place-items: center; max-width: 92vw; max-height: 78vh; }
.lightbox .lb-imgwrap.contain { background: #fff; }
.lightbox img { max-width: 92vw; max-height: 78vh; object-fit: contain; display: block; }
.lightbox .lb-imgwrap.contain img { padding: 24px; }
.lightbox .lb-cap { color: #cfd0d2; font-family: var(--mono); font-size: 13px; text-align: center; }
.lightbox .lb-cap .idx { color: #8b8f96; margin-left: 12px; }
.lb-btn { position: fixed; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-prev { left: 24px; } .lb-next { right: 24px; }
.lb-close { position: fixed; top: 22px; right: 24px; width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb-close:hover { background: rgba(255,255,255,.18); }
.lb-count { position: fixed; top: 28px; left: 28px; color: #8b8f96; font-family: var(--mono); font-size: 13px; }

/* ============================ REVEAL ============================ */
/* Entrance motion is intentionally stuck-proof: content is ALWAYS visible.
   A subtle one-time drift plays via transition when .in is added, but the
   resting (no-class) state is fully visible, so nothing can ever be hidden. */
.reveal { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* placeholder note */
.note { font-family: var(--mono); font-size: 12px; color: var(--faint); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; display: inline-block; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 1000px) {
  :root { --pad: 32px; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 56px 0 56px; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .gitem.tall { grid-column: span 3; aspect-ratio: 3/2; }
}
@media (max-width: 720px) {
  :root { --pad: 22px; }
  .nav .links, .nav .cta { display: none; }
  .hamburger { display: grid; place-items: center; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gitem, .gitem.wide, .gitem.tall { grid-column: span 2; aspect-ratio: 3/2; }
  .urow { grid-template-columns: 1fr auto; gap: 6px 16px; }
  .urow .ud { grid-column: 1 / -1; }
  .detail-meta .m { min-width: 50%; border-bottom: 1px solid var(--line2); }
  .pn-nav { grid-template-columns: 1fr; }
  .foot .inner { flex-direction: column; align-items: flex-start; }
  .foot .c { text-align: left; }
  .lb-prev { left: 10px; } .lb-next { right: 10px; }
}


/* --- appended: styling for sanitized verbatim content bodies --- */
.body-sections ul, .body-sections ol { margin: 0 0 16px; padding-left: 22px; }
.body-sections li { font-size: 18px; line-height: 1.7; margin: 6px 0; color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.body-sections a, .post .content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.body-sections strong, .post .content strong { color: var(--text); font-weight: 600; }
.body-sections img, .post .content img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin: 8px 0 20px; }
.body-sections h3, .body-sections h4 { margin: 22px 0 10px; font-size: 20px; letter-spacing: -0.01em; }
.post .content ul, .post .content ol { padding-left: 22px; margin: 0 0 16px; }
.post .content li { margin: 6px 0; line-height: 1.7; }
