/* op.css — "Index" work archive (see scripts/gen-op.js)
   Uses the exact same font set as the home page (style.css). */

/* same as home: Space Mono (Latin sans) via Google; vendetta (Latin serif)
   comes from the Typekit kit loaded in <head>; Sanjan is Hangul-only. */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@font-face {
  font-family: 'Infinit Dingbats';
  src: url('../fonts/InfinitDingbats.ttf') format('truetype');
  font-weight: normal; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Sanjan';   /* Korean text only — Latin falls through to vendetta / Space Mono */
  src: url('../fonts/sanjan-regular.woff') format('woff');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+1100-11FF, U+3130-318F, U+A960-A97F, U+AC00-D7A3, U+D7B0-D7FF;
}

:root {
  --bg: #000000;
  --ink: #F2EFE6;
  --dim: #8F8D85;
  --rule: #2A2A27;
  /* identical to home's --serif / --sans: Sanjan catches Hangul, Latin falls through */
  --gara: 'Sanjan', 'vendetta', Georgia, serif;
  --sans: 'Sanjan', 'Space Mono', 'Courier New', monospace;
  --header-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }
body {
  font-family: var(--gara);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-h);   /* clear the fixed header */
}

a { color: inherit; text-decoration: none; }

/* ── top header — unified with the main site (fixed · mono · hamburger) ── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.site-header .brand { font-size: 15px; letter-spacing: 0.02em; }
.site-header .brand a { display: inline-flex; align-items: center; }
.brand-logo {                         /* KO → 생태제작소 logo; EN → "STstudio" wordmark */
  height: 20px;
  width: auto;
  display: none;
  filter: brightness(0) invert(1);    /* source colour → white for the dark header */
}
html[lang^="ko"] .brand:not(.no-logo) .brand-logo { display: block; }
html[lang^="ko"] .brand:not(.no-logo) .brand-text { display: none; }
.site-nav {
  grid-column: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(16px, 2.4vw, 30px);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.site-nav a { color: var(--ink); transition: opacity 0.2s ease; }
.site-nav a:hover { opacity: 0.55; }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.site-header .right {
  grid-column: 3;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
}
.header-contact { font-size: 12px; letter-spacing: 0.06em; }
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.menu-btn span { display: block; flex: none; width: 100%; height: 2px; background: var(--ink); transition: transform 220ms ease; }
body.menu-open .menu-btn span:first-child { transform: translateY(5px) rotate(45deg); }
body.menu-open .menu-btn span:last-child  { transform: translateY(-5px) rotate(-45deg); }
@media (max-width: 1280px) { .header-contact { display: none; } }

/* ── filter chips — vivid random fill (set as --c per load), black text ── */
.op-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.35rem;
  row-gap: 0.4rem;
  padding: 1.3rem clamp(1.25rem, 6vw, 6rem) 2.2rem;
}
/* .op-chip's own pill styling now lives in css/cards.css (shared with every
   work-page "More projects" grid). .op-tag (the filter buttons above the
   grid) only exists on this page, so it keeps a short duplicate of the same
   base pill look here — small, contained, intentional. */
.op-tag {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1;
  text-box: trim-both cap alphabetic;
  letter-spacing: 0.04em;
  color: #000;
  background: var(--c, var(--ink));
  border: 0;
  border-radius: 999px;
  padding: 4px 9px;
  cursor: pointer;
  transition: opacity 200ms ease;
}
.op-tag:hover { opacity: 0.75; }
/* one chip active → it stays loud, the rest recede */
.op-cloud.has-active .op-tag:not(.is-active) { opacity: 0.3; }
.op-cloud.has-active .op-tag.is-active { opacity: 1; }

/* ── work grid: CSS grid (JS sets --op-cols); card visuals are shared via
   css/cards.css (.op-card/.op-thumb/.op-title/.op-card-tags/.op-year/…) ── */
.op-grid {
  display: grid;
  grid-template-columns: repeat(var(--op-cols, 5), 1fr);
  grid-auto-flow: row dense;   /* pull small cards up into the gaps a wide card leaves */
  align-items: start;
  gap: 1.4rem clamp(0.9rem, 1.6vw, 1.5rem);
  padding: 0 clamp(1.25rem, 3vw, 2.5rem) 4rem;
}

/* ── footer ── */
.op-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 3vw, 2.5rem);
  border-top: 1px solid var(--rule);
  font-size: 14px;
  font-style: italic;
  color: var(--dim);
}

/* ── responsive (column count itself is set by JS) ── */
@media (max-width: 760px) {
  .op-cloud { column-gap: 0.3rem; }
  .op-tag { font-size: 12px; }
}

/* inline nav → hamburger dropdown (matches the main site) */
@media (max-width: 640px) {
  .menu-btn { display: inline-flex; }
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 59;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 0 clamp(1.25rem, 6vw, 2.5rem);
    font-size: 14px;
  }
  body.menu-open .site-nav { display: flex; }
  .site-nav a { padding: 15px 0; border-bottom: 1px solid var(--rule); }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a[aria-current="page"] { border: 0; border-radius: 0; padding: 15px 0; }
}
