/* ─── Archive page specific styles ──────────────────────────── */

/* ─── Film-grain overlay ──────────────────────────────────────── */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* ─── Floating Island Nav ──────────────────────────────────────── */
.nav-island {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
}

.nav-pill-outer {
  display: flex;
  align-items: center;
  padding: 4px;
  background: rgba(253, 251, 247, 0.75);
  border: 1px solid var(--hairline-mid);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(26,22,18,0.04), 0 4px 16px rgba(26,22,18,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-pill-inner {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  background: rgba(255,255,255,0.6);
  border-radius: 999px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.9);
}

.nav-logo {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-mid);
  letter-spacing: 0.01em;
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 999px;
  transition: background 350ms var(--ease-expo), color 350ms var(--ease-expo);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-logo:hover { background: var(--bg-deep); color: var(--ink); }

.nav-divider {
  width: 1px;
  height: 1.2rem;
  background: var(--hairline-mid);
  margin: 0 0.25rem;
}

.archive-nav-link {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-mid);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
  transition: background 350ms var(--ease-expo), color 350ms var(--ease-expo);
}
.archive-nav-link:hover { background: var(--bg-deep); color: var(--ink); }

/* ─── ARCHIVE HERO ─────────────────────────────────────────── */
.archive-hero {
  padding: 10rem 8rem 5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.archive-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.archive-eyebrow::before {
  content: '';
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
}

.archive-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--ink);
  margin-bottom: 1.75rem;
}
.archive-title em { font-style: italic; color: var(--accent); }

.archive-lede {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--ink-mid);
  max-width: 52ch;
  margin-bottom: 1.25rem;
}

.archive-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.archive-hero-inner {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 900ms var(--ease-expo), transform 900ms var(--ease-expo);
}
.archive-hero-inner.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ─── TABLE CONTAINER ──────────────────────────────────────── */
.archive-table-wrap {
  padding: 0 8rem 8rem;
  max-width: 1200px;
  margin: 0 auto;
}

.table-outer {
  background: var(--bg-warm);
  border: 1px solid var(--hairline-mid);
  border-radius: 1.25rem;
  padding: 5px;
  box-shadow: var(--shadow-md);
}

.table-inner {
  background: var(--cream-card);
  border-radius: calc(1.25rem - 5px);
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.9);
}

/* ─── TABLE ────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; table-layout: fixed; }

col.col-year   { width: 7rem; }
col.col-title  { width: auto; }
col.col-type   { width: 9rem; }
col.col-tech   { width: 22rem; }
col.col-link   { width: 4rem; }

thead { border-bottom: 1px solid var(--hairline-mid); }

thead th {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 1.1rem 1.25rem;
  text-align: left;
  background: var(--bg-warm);
}
thead th.col-year-h { text-align: right; }
thead th.col-link-h { text-align: center; }

tbody tr {
  border-bottom: 1px solid var(--hairline-row);
  transition: background 250ms var(--ease-expo), transform 250ms var(--ease-expo);
  will-change: transform;
  cursor: default;
}
tbody tr:last-child { border-bottom: none; }

@media (prefers-reduced-motion: no-preference) {
  tbody tr:hover {
    background: var(--accent-row);
    transform: translateX(4px);
    box-shadow: -3px 0 0 0 rgba(10, 93, 79, 0.25);
  }
}
@media (prefers-reduced-motion: reduce) {
  tbody tr:hover { background: var(--accent-row); }
}

tbody tr.featured-row { background: var(--accent-feat); }
tbody tr.featured-row:hover { background: rgba(10, 93, 79, 0.07); }

td { padding: 1rem 1.25rem; vertical-align: middle; }

td.cell-year {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
}

td.cell-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.3;
}
td.cell-title .title-text { transition: color 250ms var(--ease-expo); }
tbody tr:hover td.cell-title .title-text { color: var(--accent); }
td.cell-title .title-ko {
  font-family: var(--font-kr);
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--ink-soft);
  display: block;
  margin-top: 0.1rem;
}

.feat-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: rgba(10, 93, 79, 0.1);
  border: 1px solid rgba(10, 93, 79, 0.18);
  font-size: 0.52rem;
  margin-left: 0.45rem;
  vertical-align: middle;
  line-height: 1;
  flex-shrink: 0;
}

td.cell-type {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

td.cell-tech { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.tech-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tech-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--bg-deep);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 0.18rem 0.55rem;
  white-space: nowrap;
}

td.cell-link { text-align: center; }
td.cell-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 250ms var(--ease-expo), color 250ms var(--ease-expo), transform 250ms var(--ease-expo);
}
td.cell-link a:hover {
  background: var(--accent-pale);
  color: var(--accent);
  transform: translate(1px, -1px);
}

/* ─── SCROLL REVEAL ─────────────────────────────────────────── */
.reveal-row {
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 600ms var(--ease-expo), transform 600ms var(--ease-expo);
}
.reveal-row.in-view { opacity: 1; transform: translateY(0); }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .archive-hero { padding: 9rem 4rem 4rem; }
  .archive-table-wrap { padding: 0 4rem 6rem; }
  col.col-tech { width: 16rem; }
}

@media (max-width: 768px) {
  .archive-hero { padding: 7.5rem 1.5rem 3rem; }
  .archive-table-wrap { padding: 0 1.5rem 5rem; }

  thead th.col-type-h,
  thead th.col-tech-h { display: none; }

  table, thead, tbody, th, td, tr { display: block; }
  thead tr { display: none; }

  tbody tr {
    padding: 1rem 1.25rem 0.85rem;
    border-bottom: 1px solid var(--hairline-row);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transform: none !important;
  }
  tbody tr:hover {
    transform: none !important;
    box-shadow: -3px 0 0 0 rgba(10, 93, 79, 0.25);
  }

  td {
    padding: 0;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
  }

  td.cell-year {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    color: var(--ink-soft);
    text-align: left;
    min-width: 2.8rem;
    flex-shrink: 0;
  }
  td.cell-title { font-size: 0.95rem; flex: 1; }

  .mobile-row2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding-left: 3.4rem;
  }
  td.cell-type { font-size: 0.58rem; display: inline; }
  td.cell-tech { padding: 0; flex: 1; }
  .tech-pills { gap: 0.25rem; }
  .tech-pill { font-size: 0.55rem; padding: 0.14rem 0.45rem; }
  td.cell-link { margin-left: auto; text-align: right; }

  .archive-nav-link { display: none; }
}

@media (max-width: 480px) {
  .archive-title { font-size: clamp(2.2rem, 10vw, 3rem); }
  .archive-hero { padding-top: 7rem; }
  .nav-pill-outer { max-width: calc(100vw - 2rem); }
}

/* ─── KO mode overrides ─────────────────────────────────────── */
html[lang="ko"] .archive-title,
html[lang="ko"] .archive-eyebrow {
  font-family: var(--font-kr);
  letter-spacing: -0.01em;
}
html[lang="ko"] .archive-lede {
  font-family: 'IBM Plex Sans', 'Apple SD Gothic Neo', sans-serif;
}

/* ─── Archive filter buttons ─────────────────────────────────── */
.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 3rem;
  justify-content: center;
}

.archive-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--color-border, rgba(31, 29, 26, 0.15));
  border-radius: 999px;
  font-family: 'IBM Plex Mono', 'Pretendard Variable', monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-fg-muted, #665e54);
  text-decoration: none;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.archive-filter:hover {
  border-color: var(--color-fg, #1f1d1a);
  color: var(--color-fg, #1f1d1a);
}

.archive-filter.active {
  background: var(--color-fg, #1f1d1a);
  border-color: var(--color-fg, #1f1d1a);
  color: var(--color-bg, #FDFBF7);
}

.archive-filter .count {
  font-size: 0.75rem;
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .archive-filter { transition: none; }
}
