/* ============================================================
   Ignatius Liu — site.css
   Minimal monochrome: black bg, glass surfaces, lofi grain,
   soft white/silver glow. One font, two weights.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg:        #0a0a0a;            /* true-ish black            */
  --bg-soft:   #111114;            /* card/canvas elevation     */
  --text:      #f4f4f5;            /* primary text              */
  --text-dim:  #a1a1aa;            /* secondary text            */
  --text-mute: #6b6b73;            /* tertiary / meta           */
  --line:      rgba(255,255,255,.10);
  --line-soft: rgba(255,255,255,.06);

  /* glass surfaces (translucent white) */
  --glass-bg:     rgba(255,255,255,.045);
  --glass-bg-hi:  rgba(255,255,255,.07);
  --glass-border: rgba(255,255,255,.12);
  --glass-hl:     rgba(255,255,255,.18);   /* top inner highlight  */

  /* the monochrome "gradient": white -> silver -> grey */
  --shine: linear-gradient(105deg,#fff 0%,#dcdcdf 45%,#8a8a90 100%);

  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      1120px;
  --nav-h:     64px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }

/* ---------- Background glow blobs ---------- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  background: radial-gradient(circle at center, rgba(255,255,255,.20), rgba(255,255,255,0) 70%);
}
.blob.b1 { width: 46vw; height: 46vw; top: -12vw; left: -8vw; animation: drift1 26s ease-in-out infinite; }
.blob.b2 { width: 38vw; height: 38vw; bottom: -10vw; right: -6vw; opacity: .4; animation: drift2 32s ease-in-out infinite; }
.blob.b3 { width: 26vw; height: 26vw; top: 40%; left: 55%; opacity: .25; animation: drift3 38s ease-in-out infinite; }

@keyframes drift1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(4vw,3vw)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-3vw,-2vw)} }
@keyframes drift3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-2vw,2vw)} }

/* cursor-following spotlight (all pages) */
.spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 40%),
    rgba(255,255,255,.10),
    rgba(255,255,255,0) 70%
  );
  opacity: 0;
  transition: opacity .6s ease;
}
.spotlight.is-on { opacity: 1; }

/* ---------- Lo-fi film grain ---------- */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 9999;
  pointer-events: none;
  opacity: .09;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 1.2s steps(6) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-4%, 3%); }
  40%  { transform: translate(3%, -2%); }
  60%  { transform: translate(-2%, -4%); }
  80%  { transform: translate(4%, 2%); }
  100% { transform: translate(0,0); }
}

/* ---------- Layout helpers ---------- */
/* Left-biased container: content shares one left edge across all pages,
   rather than floating in the horizontal center of wide screens. */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(24px, 6vw, 96px) 24px;
}
@media (max-width: 720px) {
  .wrap { padding-inline: 24px; }
}
.section { padding: 96px 0; }

/* shared eyebrow / section heading */
.eyebrow {
  font-size: .72rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 14px;
}
.h-section {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.section-lead {
  color: var(--text-dim);
  max-width: 52ch;
  margin-bottom: 44px;
}

/* ---------- Glass card primitive ---------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow:
    0 1px 0 0 var(--glass-hl) inset,        /* top inner highlight   */
    0 20px 50px -24px rgba(0,0,0,.7);       /* drop shadow           */
}

/* ---------- Top navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(10,10,10,.55);
  border-bottom: 1px solid var(--line-soft);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}
.brand .chip {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
}
.brand .name { font-size: .95rem; }
.brand .name b { font-weight: 700; }
.brand .name span { color: var(--text-mute); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .9rem;
  color: var(--text-dim);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--glass-bg-hi); }
.nav-links a.active { color: var(--text); background: var(--glass-bg-hi); }

/* mobile menu toggle */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  border-radius: 10px;
  color: var(--text);
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---------- buttons (shared) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 500;
  border: 1px solid var(--glass-border);
  transition: transform .2s, background .2s, border-color .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: #f4f4f5;
  color: #0a0a0a;
  border-color: #f4f4f5;
}
.btn-primary:hover { transform: translateY(-2px); background: #fff; }
.btn-ghost { background: var(--glass-bg); color: var(--text); backdrop-filter: blur(10px); }
.btn-ghost:hover { transform: translateY(-2px); background: var(--glass-bg-hi); border-color: var(--glass-hl); }

/* ---------- STAGE — editorial homepage ---------- */
/* corner meta labels */
.stage-label {
  position: fixed;
  z-index: 5;
  font-size: .68rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--text-mute);
  pointer-events: none;
}
.stage-label.tl { top: calc(var(--nav-h) + 22px); left: 28px; }
.stage-label.tr { top: calc(var(--nav-h) + 22px); right: 28px; }
.stage-label.bl { bottom: 26px; left: 28px; }
.stage-label.br { bottom: 26px; right: 28px; }
.stage-label [data-clock] { color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* ---------- STAGE — blueprint homepage ---------- */
/* the canvas / "drawing area": hero drawing up top, index + title block below */
.stage {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 40px 56px;
  padding: 32px 0 64px;
  position: relative;
}

/* blueprint hero — the name as a technical drawing */
.hero-drawing {
  grid-column: 1 / -1;            /* span full width across the top */
  margin-top: clamp(8px, 4vh, 56px);
  margin-bottom: 24px;
}
.hero-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: hidden;               /* keep glyphs inside the box */
}
/* default: show the single-line name, hide the stacked mobile version */
.hero-svg .name-1col { display: block; }
.hero-svg .name-2col { display: none; }

/* registration marks at the viewport corners */
.reg-marks { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.reg-marks .reg {
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
}
.reg-marks .reg::before, .reg-marks .reg::after {
  content: ""; position: absolute; background: rgba(255,255,255,.28);
}
.reg-marks .reg::before { left: 50%; top: -6px; bottom: -6px; width: 1px; transform: translateX(-50%); }
.reg-marks .reg::after  { top: 50%; left: -6px; right: -6px; height: 1px; transform: translateY(-50%); }
.reg-marks .tl { top: 24px; left: 24px; }
.reg-marks .tr { top: 24px; right: 24px; }
.reg-marks .bl { bottom: 24px; left: 24px; }
.reg-marks .br { bottom: 24px; right: 24px; }

/* the index — the real focal point */
.index {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  max-width: 620px;
}
.index a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 6px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding-left .35s cubic-bezier(.2,.8,.2,1);
}
.index .i-row {
  display: flex;
  align-items: baseline;
  gap: 22px;
}
.index .i-num {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-mute);
  letter-spacing: .08em;
  width: 32px;
}
.index .i-name {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  transition: color .25s;
}
.index .i-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--text-mute);
}
.index .i-desc {
  font-size: .92rem;
  color: var(--text-dim);
  padding-left: 54px; /* align under .i-name */
}
/* hover sweep bar */
.index a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  height: 1px; width: 0;
  background: var(--shine);
  transition: width .45s cubic-bezier(.2,.8,.2,1);
}
.index a:hover { padding-left: 22px; }
.index a:hover .i-name { color: #fff; }
.index a:hover::after { width: 100%; }

/* title block — the draftsman's name, demoted to the corner */
.title-block {
  align-self: end;
  width: 280px;
  border: 1px solid var(--line);
  padding: 18px 18px 16px;
  background: rgba(255,255,255,.02);
  position: relative;
}
.title-block::before {
  /* corner tick marks, like an engineering drawing */
  content: "";
  position: absolute;
  inset: -5px;
  background:
    linear-gradient(var(--line), var(--line)) top left/12px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) top left/1px 12px no-repeat,
    linear-gradient(var(--line), var(--line)) top right/12px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) top right/1px 12px no-repeat,
    linear-gradient(var(--line), var(--line)) bottom left/12px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) bottom left/1px 12px no-repeat,
    linear-gradient(var(--line), var(--line)) bottom right/12px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) bottom right/1px 12px no-repeat;
  pointer-events: none;
}
.tb-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
}
.tb-k { color: var(--text-mute); }
.tb-v { color: var(--text); text-align: right; }
.tb-tag {
  font-size: .8rem;
  color: var(--text-dim);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-style: italic;
}

/* ---------- Projects grid ---------- */
.grid-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}
.project-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .25s, background .25s, border-color .25s;
}
.project-card:hover {
  transform: translateY(-4px);
  background: var(--glass-bg-hi);
  border-color: var(--glass-hl);
}
.project-card .pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.project-card .pc-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--glass-bg-hi);
  border: 1px solid var(--glass-border);
}
.project-card .pc-icon svg { width: 20px; height: 20px; color: var(--text-dim); }
.project-card .pc-type { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-mute); }
.project-card h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.project-card p { color: var(--text-dim); font-size: .95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.tag {
  font-size: .72rem;
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.project-card .pc-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .88rem; color: var(--text);
  margin-top: 4px;
}
.project-card .pc-link svg { width: 15px; height: 15px; transition: transform .2s; }
.project-card:hover .pc-link svg { transform: translate(2px,-2px); }

/* multi-link row (Live + GitHub, or Firefox + Chrome + GitHub) */
.project-card .pc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
/* primary link sits in a pill so the "Live" CTA reads as the main action */
.project-card .pc-links .pc-link {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: #f4f4f5;
  color: #0a0a0a;
  transition: transform .2s, background .2s;
}
.project-card .pc-links .pc-link:hover { transform: translateY(-2px); background: #fff; }
/* secondary links are ghost-styled (subtle, not competing) */
.project-card .pc-links .pc-link-ghost {
  background: var(--glass-bg);
  color: var(--text-dim);
  border-color: var(--line);
}
.project-card .pc-links .pc-link-ghost:hover {
  background: var(--glass-bg-hi);
  color: var(--text);
  border-color: var(--glass-border);
}

/* ---------- Photography: masonry + lightbox ---------- */
.masonry {
  columns: 3 280px;
  column-gap: 16px;
}
.masonry figure {
  break-inside: avoid;
  margin: 0 0 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--bg-soft);
  cursor: zoom-in;
  position: relative;
  transition: transform .25s, border-color .25s;
}
.masonry figure:hover { transform: translateY(-3px); border-color: var(--glass-border); }
.masonry img {
  width: 100%;
  height: auto;
  filter: grayscale(15%);
  transition: filter .3s;
}
.masonry figure:hover img { filter: grayscale(0%); }
.masonry figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 14px 11px;
  font-size: .78rem;
  color: var(--text);
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent);
  opacity: 0;
  transition: opacity .25s;
}
.masonry figure:hover figcaption { opacity: 1; }

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5,5,5,.92);
  backdrop-filter: blur(8px);
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.9);
}
.lb-btn {
  position: absolute;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  backdrop-filter: blur(10px);
  transition: background .2s;
}
.lb-btn:hover { background: var(--glass-bg-hi); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 22px; right: 22px; }
.lb-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 22px; top: 50%; transform: translateY(-50%); }
.lb-counter {
  position: absolute;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  font-size: .82rem;
  color: var(--text-dim);
  letter-spacing: .1em;
}

/* ---------- Socials ---------- */
.socials {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.social-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  transition: transform .25s, background .25s, border-color .25s;
}
.social-card:hover {
  transform: translateY(-3px);
  background: var(--glass-bg-hi);
  border-color: var(--glass-hl);
}
.social-card .sc-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--glass-bg-hi);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.social-card .sc-icon svg { width: 22px; height: 22px; color: var(--text); }
.social-card .sc-label { font-size: .72rem; color: var(--text-mute); letter-spacing: .12em; text-transform: uppercase; }
.social-card .sc-handle { font-weight: 600; }
.social-card .sc-arrow { margin-left: auto; color: var(--text-mute); transition: transform .2s, color .2s; }
.social-card:hover .sc-arrow { transform: translate(3px,-3px); color: var(--text); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 36px 0 48px;
  color: var(--text-mute);
  font-size: .85rem;
}
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text); }

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.fourofour {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 24px;
}
.fourofour .big {
  font-size: clamp(5rem, 22vw, 12rem);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1;
  background: var(--shine);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Page header (interior pages) ---------- */
.page-head { padding: 72px 0 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .section { padding: 72px 0; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10,10,10,.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
    padding: 8px;
    transform: translateY(-130%);
    transition: transform .3s ease;
    z-index: 99;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px 16px; border-radius: 10px; }
  .nav-toggle { display: inline-flex; }
  .masonry { columns: 2 140px; }

  /* blueprint homepage collapses to a single column */
  .stage { grid-template-columns: 1fr; gap: 40px; padding: 40px 0 64px; }
  .title-block { width: 100%; }
  .reg-marks .reg { display: none; }
  .index .i-desc { padding-left: 0; }

  /* hero name wraps to two stacked lines on mobile */
  .hero-svg .name-1col { display: none; }
  .hero-svg .name-2col { display: block; }
}

@media (max-width: 460px) {
  .masonry { columns: 1; }
}

/* ---------- Accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .grain { display: none; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 6px;
}
