
/* =========================================
    DESIGN TOKENS — tweak these to reskin
    ========================================= */

@font-face {
  font-family: 'Pretendard Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 45 920;
  src: url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/woff2-dynamic-subset/PretendardVariable.subset.0.woff2') format('woff2-variations');
  unicode-range: U+f9ca-fa0b, U+ff03-ff05, U+ff07, U+ff0a-ff0b, U+ff0d-ff19, U+ff1b, U+ff1d, U+ff20-ff5b, U+ff5d, U+ffe0-ffe3, U+ffe5-ffe6;
}

:root {
  --bg: #0c0c0d;
  --bg-elevated: #141415;
  --text: #e8e4dc;
  --text-dim: #7a7670;
  --text-faint: #4a4844;
  --accent: #d4a574;
  --border: #222;

  --font-display: 'Instrument Serif', Georgia, 'Apple SD Gothic Neo', 'Malgun Gothic', serif;
  --font-sans: 'IBM Plex Sans', system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Apple SD Gothic Neo', 'Malgun Gothic', monospace;

  /* Korean stack — Pretendard is the modern standard on Korean studio sites.
      Hangul has no real italic and no uppercase, so we lean on weight + tracking
      instead of font-style. Used via the html[lang="ko"] overrides below. */
  --font-display-ko: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --font-sans-ko:    'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;

  --page-padding: clamp(24px, 4vw, 64px);

  /* ... existing tokens ... */
  --logo-scale: 3.2;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }

/* =========================================
    VIEW SWITCHING
    ========================================= */
.view { display: none; animation: fadeIn 0.4s ease; }
.view.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
    HOME — header + project grid
    ========================================= */
.site-header {
  padding: var(--page-padding);
  padding-bottom: clamp(20px, 2.5vw, 32px);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.site-title em {
  font-style: italic;
  color: var(--accent);
}

.identity {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  position: relative;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.95);
  transition: filter 0.3s ease, transform 0.6s ease;
}
.avatar:hover img {
  filter: saturate(1.1);
  transform: scale(1.06);
}

.site-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-top: 12px;
}

/* =========================================
    TOP NAV CLUSTER — unified button system
    All items share height (32px), font, and rhythm.
    Hierarchy: text-link (nav) → divider → accent pill (CTA) → segmented (toggle)
    ========================================= */
.site-nav {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Shared sizing for every interactive item in the nav.
    Font family/size/case are inherited from .site-nav (lets Korean override work). */
.site-nav .nav-link,
.site-nav .resume-btn,
.site-nav .lang-toggle {
  height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: 2px;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

/* About / Contact — text links with hit-target padding so they align with buttons */
.site-nav .nav-link {
  padding: 0 12px;
  color: var(--text-dim);
  border: 1px solid transparent;
}
.site-nav .nav-link:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

/* Vertical divider between nav links and action buttons */
.nav-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 8px;
  flex-shrink: 0;
}

/* Resume download button — accent-outlined pill (the primary CTA) */
.resume-btn {
  gap: 0.5em;
  padding: 0 14px;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.resume-btn:hover {
  background: var(--accent);
  color: var(--bg);
}
.resume-btn svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.resume-btn:hover svg { transform: translateY(2px); }

/* Larger resume CTA inside About page */
.resume-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-top: 40px;
  padding: 12px 28px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
}
.resume-cta:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}
.resume-cta svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform 0.2s ease;
}
.resume-cta:hover svg { transform: translateY(2px); }

html[lang="ko"] .resume-btn,
html[lang="ko"] .resume-cta {
  font-family: var(--font-sans-ko);
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* Language toggle — segmented control echoing the Resume pill shape.
    Each language is its own clickable segment; the active one fills. */
.lang-toggle {
  background: none;
  padding: 0;
  cursor: pointer;
  border: 1px solid var(--border);
  overflow: hidden;
  color: var(--text-dim);
}
.lang-toggle:hover { border-color: var(--text-dim); }
.lang-toggle [data-lang] {
  height: 100%;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  color: var(--text-faint);
  transition: color 0.2s ease, background 0.2s ease;
}
.lang-toggle [data-lang].active {
  color: var(--text);
  background: var(--bg-elevated);
}
.lang-toggle:hover [data-lang]:not(.active) { color: var(--text-dim); }
/* Hide the slash separator — the segmented border tells the story now */
.lang-toggle .sep { display: none; }

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  padding: 0 var(--page-padding);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.section-label + .section-label {
  margin-top: 32px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.project-grid {
  padding: 0 32px 16px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;            /* Firefox: hide scrollbar */
  -ms-overflow-style: none;         /* old Edge/IE: hide scrollbar */
  cursor: grab;
  user-select: none;
  margin-bottom: 32px;
}
.project-grid.dragging { cursor: grabbing; scroll-behavior: auto; }
.project-grid.dragging .project-card { pointer-events: none; }
.project-grid::-webkit-scrollbar { display: none; }  /* WebKit: hide scrollbar */

.project-card {
  cursor: pointer;
  display: block;
  text-align: left;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  /* Per-row height: each .project-grid can set --card-h (driven by the variant's
     `heights` config in data.js); falls back to this default when unset. */
  height: var(--card-h, min(55vh, 480px));
  width: auto;               /* width follows the image's natural ratio */
  margin-right: 28px;
  border-radius: 12px;
}

/* Poster cards reuse .project-card but are display-only (no detail view) */
.poster-card { cursor: default; }

.project-thumb {
  width: auto;
  height: 100%;
  background: var(--bg-elevated);
  overflow: hidden;
  position: relative;
}
.project-thumb img,
.project-thumb video {
  width: auto;          /* keep the image's natural ratio at this height */
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.4s ease;
  filter: saturate(0.9);
  display: block;
}
.project-card:hover .project-thumb img,
.project-card:hover .project-thumb video {
  transform: scale(1.03);
  filter: saturate(1);
}

/* Square thumbnails: card width follows a 1:1 ratio at full card height, and the
   media is cropped (object-fit: cover) and centered on the subject. */
.project-thumb.square { aspect-ratio: 1 / 1; }
.project-thumb.square img,
.project-thumb.square video {
  width: 100%;
  object-position: center;
}

/* Meta now sits as an overlay so thumbnails stay edge-to-edge */
.project-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 24px 20px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.project-card:hover .project-meta {
  opacity: 1;
  transform: translateY(0);
}
.project-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
}
.project-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  white-space: nowrap;
}
.project-tag.wip { color: var(--accent); 
}
.project-logo {
  position: absolute;
  top: clamp(16px, 2vw, 28px);
  left: clamp(16px, 2vw, 28px);
  width: calc(clamp(52px, 7vw, 96px) * var(--logo-scale));
  height: auto;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.project-logo-right {
  left: auto;
  right: clamp(16px, 2vw, 28px);
}

/* digitalart variant only: shrink the Unreal / Star Wars fan-art logos on the
   fourth-row (Technical Projects) thumbnail cards. transform keeps the top-left
   anchor and overrides any inline --logo-scale. */
body[data-variant="digitalart"] #project-grid-4 .project-logo {
  transform: scale(0.5);
  transform-origin: top left;
}

/* 3dart variant only: the Unreal / Star Wars fan-art logos on the Technical
   Portfolio row (grid-2 in this variant) render at their natural inline size. */
body[data-variant="3dart"] #project-grid-2 .project-logo {
  transform: scale(1);
  transform-origin: top left;
}

/* =========================================
    SCROLL ARROWS — overlay buttons on horizontal galleries
    ========================================= */
.scroll-wrapper { position: relative; }

.scroll-arrow {
  position: absolute;
  top: calc(50% - 28px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(20, 20, 21, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.scroll-arrow.visible {
  opacity: 1;
  pointer-events: auto;
}
.scroll-arrow:hover {
  background: rgba(40, 40, 42, 0.85);
  border-color: var(--accent);
}
.scroll-arrow svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  transition: transform 0.25s ease;
}

.scroll-arrow-left { left: 24px; }
.scroll-arrow-right { right: 24px; }

/* Gentle nudge on the right arrow to draw the eye */
@keyframes nudge-right {
  0%, 70%, 100% { transform: translateX(0); }
  80%          { transform: translateX(5px); }
  90%          { transform: translateX(0); }
}
@keyframes nudge-left {
  0%, 70%, 100% { transform: translateX(0); }
  80%          { transform: translateX(-5px); }
  90%          { transform: translateX(0); }
}
.scroll-arrow-right.visible svg { animation: nudge-right 2.4s ease-in-out infinite; }
.scroll-arrow-left.visible  svg { animation: nudge-left  2.4s ease-in-out infinite; }
.scroll-arrow:hover svg { animation: none; }
.scroll-arrow-right:hover svg { transform: translateX(3px); }
.scroll-arrow-left:hover svg  { transform: translateX(-3px); }

/* =========================================
    PROJECT DETAIL — horizontal scroll
    ========================================= */
.project-header {
  padding: var(--page-padding);
  padding-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
}

.back-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--text); }
.back-btn .arrow {
  display: inline-block;
  transition: transform 0.2s;
}
.back-btn:hover .arrow { transform: translateX(-4px); }

.project-title-block { flex: 1; min-width: 260px; }
.project-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  word-break: keep-all;
}
.project-description {
  margin-top: 16px;
  max-width: 52ch;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
}
.project-specs {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-align: right;
  line-height: 2;
}
.project-specs span { color: var(--text); }

/* Korean "head word" emphasis — highlights the leading label of each
   paragraph in secondary-row project galleries (핵심 참여 내용:, 프로젝트 배경: …)
   so each contextual section is easy to distinguish. */
.gallery-text-head {
  font-weight: 600;
  color: var(--accent);
}

/* Vertical gallery (project sub-pages) — ArtStation-style stacked layout */
.gallery-wrapper {
  position: relative;
  padding: 0 var(--page-padding);
  margin-bottom: 32px;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-item {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.gallery-item img,
.gallery-item video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
.gallery-item .caption {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  padding: 6px 10px;
  opacity: 0;
  transition: opacity 0.3s;
}
.gallery-item:hover .caption { opacity: 1; }

/* Narrow modifier — caps width for media that shouldn't dominate the column
    (e.g. phone-shot AR captures, portrait video). Sits centered in the gallery. */
.gallery-item.narrow {
  max-width: 480px;
  margin: 24px auto;
}

/* Side-by-side text + image — image and text share a row */
.gallery-split {
  display: flex;
  gap: 16px;
  width: 100%;
  align-items: center;
}
.gallery-split .gallery-item { flex: 1 1 0; min-width: 0; margin: 0; }
.gallery-split-text {
  flex: 1 1 0;
  min-width: 0;
  padding: clamp(16px, 3vw, 40px) clamp(16px, 3vw, 32px);
  color: var(--text);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.5;
}
.gallery-split-text p + p { margin-top: 1.25em; }
html[lang="ko"] .gallery-split-text {
  font-size: clamp(14.5px, 1.2vw, 16px);
  line-height: 1.85;
  letter-spacing: -0.005em;
  word-break: keep-all;
}
@media (max-width: 640px) {
  .gallery-split { flex-direction: column; }
}

/* Side-by-side pair — two media items with zero gap between them */
.gallery-pair {
  display: flex;
  gap: 0;
  width: 100%;
  align-items: stretch;
}
.gallery-pair .gallery-item {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}
.gallery-pair .gallery-item img,
.gallery-pair .gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Side-by-side row of embeds (e.g. map + Instagram). Equal columns at a
   shared height so disparate iframes line up; stacks on narrow screens. */
.gallery-row {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 1200px;
  margin: 24px auto 8px;
  align-items: stretch;
}
.gallery-row > .gallery-embed {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  margin: 0;
  height: 720px;
}
.gallery-row > .gallery-embed iframe {
  height: 100% !important;
  aspect-ratio: auto !important;
}
@media (max-width: 720px) {
  .gallery-row { flex-direction: column; }
  .gallery-row > .gallery-embed { height: 600px; }
}

/* Text blocks interleaved with images in a project gallery */
.gallery-text {
  max-width: 64ch;
  margin: 24px auto;
  padding: clamp(16px, 3vw, 40px) clamp(16px, 3vw, 32px);
  color: var(--text);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.5;
}
.gallery-text p + p { margin-top: 1.25em; }
/* Drop-cap is a Latin-typography convention — only apply it when reading English.
    Korean syllable blocks don't sit as drop-caps, so html[lang="ko"] suppresses this. */
html[lang="en"] .gallery-text p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 2.4em;
  line-height: 1;
  float: left;
  padding: 0.05em 0.12em 0 0;
  color: var(--accent);
}

/* html[lang="ko"] .gallery-text.summary em {
  color: var(--accent);
} */


/* Summary variant — framed by oversized serif quotation marks */
.gallery-text.summary {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.5;
  color: var(--text);
  max-width: 70ch;
  padding-top: clamp(40px, 5vw, 64px);
  padding-bottom: clamp(40px, 5vw, 64px);
  position: relative;
}
.gallery-text.summary::before,
.gallery-text.summary::after {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: clamp(96px, 10vw, 160px);
  line-height: 0;
  display: block;
  font-style: normal;
}
.gallery-text.summary::before {
  content: '\201C';
  text-align: left;
  margin-left: -0.12em;
}
.gallery-text.summary::after {
  content: '\201D';
  text-align: right;
  margin-top: 0.5em;
  margin-right: -0.12em;
}
/* Disable drop-cap inside summary so it doesn't fight the quote marks */
  .gallery-text.summary p:first-child::first-letter {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  float: none;
  padding: 0;
  color: inherit;
}

/* External CTA — points visitors at a live deliverable */
.gallery-cta {
  max-width: 64ch;
  margin: 24px auto;
  padding: clamp(16px, 3vw, 40px) clamp(16px, 3vw, 32px);
  text-align: center;
}
.gallery-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(18px, 1.4vw, 22px);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.15em;
  transition: opacity 0.2s ease;
}
.gallery-cta a:hover { opacity: 0.7; }
.gallery-cta a .arrow { display: inline-block; transition: transform 0.2s ease; }
.gallery-cta a:hover .arrow { transform: translateX(4px); }

/* External link with optional poster thumbnail — used to point at a live deliverable.
    With `poster`: renders as a clickable thumbnail with play-icon overlay.
    Without `poster`: renders as a small inline italic CTA (see .gallery-cta). */
.gallery-embed {
  max-width: 1200px;
  margin: 24px auto 8px;
  position: relative;
  background: var(--bg-elevated);
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.gallery-embed-poster {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
  background: transparent;
  padding: 0;
  border: 0;
  overflow: hidden;
  display: block;
  color: inherit;
  font: inherit;
}
.gallery-embed-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.65);
  transition: filter 0.3s ease;
}
.gallery-embed-poster:hover img { filter: brightness(0.85); }
.gallery-embed-cta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8em;
  color: #fff;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(18px, 1.6vw, 24px);
  pointer-events: none;
  text-align: center;
  padding: 16px;
}
.gallery-embed-cta .play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4em;
  height: 2.4em;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.7em;
  padding-left: 0.2em;
  transition: transform 0.2s ease, background 0.2s ease;
}
.gallery-embed-poster:hover .gallery-embed-cta .play-icon {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.1);
}
.gallery-embed-fallback {
  max-width: 1200px;
  margin: 0 auto 24px;
  text-align: right;
  padding: 0 clamp(16px, 3vw, 32px);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.gallery-embed-fallback a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--text-faint);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.gallery-embed-fallback a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Article card — in-page preview of an external article (press/features).
    News sites block iframing, so we surface source/date, headline, and a
    short excerpt, then link out to the original. */
.gallery-article {
  max-width: 760px;
  margin: 32px auto;
  display: flex;
  gap: clamp(16px, 2.5vw, 32px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.gallery-article-thumb {
  flex: 0 0 38%;
  display: block;
  overflow: hidden;
}
.gallery-article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-article-thumb:hover img { transform: scale(1.04); }
.gallery-article-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: clamp(20px, 3vw, 36px) clamp(20px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.gallery-article-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 0.9em;
}
.gallery-article-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 0.6em;
  font-weight: 500;
}
.gallery-article-excerpt {
  color: var(--text);
  font-size: clamp(14.5px, 1vw, 16px);
  line-height: 1.6;
}
.gallery-article-excerpt p { margin: 0 0 0.8em; }
.gallery-article-cta {
  margin-top: auto;
  padding-top: 1em;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(16px, 1.3vw, 20px);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.15em;
  transition: opacity 0.2s ease;
}
.gallery-article-cta:hover { opacity: 0.7; }
.gallery-article-cta .arrow { display: inline-block; transition: transform 0.2s ease; }
.gallery-article-cta:hover .arrow { transform: translate(2px, -2px); }
@media (max-width: 640px) {
  .gallery-article { flex-direction: column; }
  .gallery-article-thumb { flex-basis: auto; aspect-ratio: 16/9; }
}
html[lang="ko"] .gallery-article-title,
html[lang="ko"] .gallery-article-cta {
  font-family: var(--font-display-ko);
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* =========================================
    ABOUT PAGE
    ========================================= */
.about-page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 64px) var(--page-padding) 96px;
  text-align: center;
}
.about-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.about-heading {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;        /* was 1 — gives room now that it's two lines */
  text-wrap: balance;      /* tidies the title if it wraps on narrow screens */
  margin-bottom: 40px;
}

/* Break after the em-dash: name + dash on line 1, title on line 2 */
.about-heading em::after {
  content: "\A";
  white-space: pre;
}

.about-heading em {
  font-style: italic;
  color: var(--accent);
}

.about-avatar {
  width: 256px;
  height: 256px;
  margin: 0 auto 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95);
}
.about-intro {
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.75;
  color: var(--text);
  text-align: left;
  max-width: 56ch;
  margin: 0 auto;
}
footer {
  padding: 48px var(--page-padding);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  flex-wrap: wrap;
}

/* =========================================
    CONTACT PAGE
    ========================================= */
.contact-links {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  transition: padding 0.25s ease;
}
.contact-link:first-of-type { border-top: 1px solid var(--border); }
.contact-link:hover { padding-left: 8px; }
.contact-link .label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  flex-shrink: 0;
}
.contact-link .value {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.6vw, 22px);
  color: var(--text);
  transition: color 0.2s ease;
  text-align: right;
  word-break: break-all;
}
.contact-link:hover .value { color: var(--accent); }

/* =========================================
    KOREAN TYPOGRAPHY
    Reference: modern Korean studio sites (Studio fnt, Plus-X, Hi-Phen, etc.)
    consistently lean on Pretendard or similar geometric sans, drop the
    Latin drop-cap / italic conventions, and pull tracking in. Hangul is
    denser per character than Latin, so we also scale body text down a hair
    and tighten line-height to prevent the page from feeling "loose."
    ========================================= */

/* Body + display swap to Pretendard when the page is Korean */
html[lang="ko"] body {
  font-family: var(--font-sans-ko);
  font-weight: 400;
  letter-spacing: -0.005em;
}
html[lang="ko"] .site-title,
html[lang="ko"] .project-name,
html[lang="ko"] .project-title,
html[lang="ko"] .about-heading,
html[lang="ko"] .contact-link .value,
html[lang="ko"] .gallery-cta a,
html[lang="ko"] .gallery-embed-cta {
  font-family: var(--font-display-ko);
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* Hangul has no true italic — switch <em> to a weight + color emphasis instead */
html[lang="ko"] em {
  font-style: normal;
  font-weight: 600;
}

/* Summary / pull-quote: keep an editorial feel via Pretendard medium, upright */
html[lang="ko"] .gallery-text.summary {
  font-family: var(--font-display-ko);
  font-style: normal;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* Body copy: a touch denser than English to match Hangul rhythm */
html[lang="ko"] .gallery-text {
  font-size: clamp(14.5px, 1.2vw, 16px);
  line-height: 1.85;
  letter-spacing: -0.005em;
}
html[lang="ko"] .about-intro,
html[lang="ko"] .project-description {
  line-height: 1.85;
  letter-spacing: -0.005em;
}

/* Mono-style labels read awkwardly in Korean — uppercase does nothing for
    Hangul and the wide tracking pulls syllable blocks apart. Switch to
    Pretendard with restrained letter-spacing. */
html[lang="ko"] .section-label,
html[lang="ko"] .site-tagline,
html[lang="ko"] .site-nav,
html[lang="ko"] .lang-toggle,
html[lang="ko"] .back-btn,
html[lang="ko"] .project-tag,
html[lang="ko"] .project-specs,
html[lang="ko"] .about-label,
html[lang="ko"] .contact-link .label,
html[lang="ko"] footer,
html[lang="ko"] .gallery-item .caption,
html[lang="ko"] .gallery-embed-fallback {
  font-family: var(--font-sans-ko);
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* Keep the EN/KO toggle in mono — it's pure Latin */
html[lang="ko"] .lang-toggle [data-lang] {
  font-family: var(--font-mono);
  letter-spacing: 0.15em;
}

/* Project-specs values stay tabular — keep mono for years, software lists */
html[lang="ko"] .project-specs span {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}


/* =========================================
    RESPONSIVE
    ========================================= */
@media (max-width: 640px) {
  .project-grid { grid-template-columns: 1fr; }
  .project-specs { text-align: left; }
  /* .gallery-item { height: 60vh; } */
}

/* =========================================
    KOREAN BULLET-LIST SUMMARY BLOCK
    Used when a gallery item has `koBullets` defined and lang is Korean.
    Renders a centred section title above centred bullet points.
    Suppresses the large quotation-mark pseudo-elements so they don't
    clash with the list layout.
    ========================================= */
 
/* Container: inherit the summary centring & padding */
.gallery-text.ko-bullet-list {
  text-align: center;
  font-style: normal;
}
 
/* Title line — accent colour, slightly larger than the bullets */
.ko-bullet-title {
  font-family: var(--font-display-ko);
  font-weight: 700;
  font-size: clamp(18px, 1.6vw, 24px);
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 1.4em;
  /* Disable drop-cap that the parent summary rule would otherwise apply */
  float: none !important;
}
.ko-bullet-title::first-letter {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  float: none !important;
  padding: 0 !important;
  color: inherit !important;
}
 
/* Bullet list wrapper — no browser default padding/indent */
.ko-bullet-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-block; /* shrink-wrap so it stays centred in the block */
  text-align: left;      /* items read left-to-right even though the block is centred */
  word-break: keep-all; /* prevent awkward breaks in Korean syllable blocks */
}
 
/* Individual bullet item */
.ko-bullet-items li {
  position: relative;
  padding-left: 1.2em;
  margin-bottom: 0.7em;
  font-family: var(--font-display-ko);
  font-weight: 400;
  font-size: clamp(16px, 1.2vw, 20px);
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: var(--text);
}
 
/* Decorative accent bullet */
.ko-bullet-items li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 300;
  font-size: 1.2em;
}

/* =========================================
    LABELED BLOCK
    Used when a gallery item's resolved text is an object of the shape
    { title, items, bulleted }. A centred accent-coloured title sits above
    a stack of line-broken items. When `bulleted` is true the block keeps
    the summary frame (oversized quote marks) and renders accent bullets;
    otherwise the items are plain line items with no markers.
    ========================================= */

.gallery-text.labeled-block {
  text-align: center;
  font-style: normal;
}

/* Non-summary labeled blocks have no quote-mark frame */
.gallery-text.labeled-block:not(.summary)::before,
.gallery-text.labeled-block:not(.summary)::after {
  display: none;
}

/* Title — accent colour, slightly larger than the body */
.labeled-title {
  font-family: var(--font-display-ko);
  font-weight: 700;
  font-size: clamp(18px, 2.0vw, 24px);
  letter-spacing: -0.02em;
  color: var(--accent);
  margin: 0 0 1em;
  float: none !important;
}
.labeled-title::first-letter {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  float: none !important;
  padding: 0 !important;
  color: inherit !important;
}

/* Item list — block centred, items read left-to-right */
.labeled-items {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 56ch;
  text-align: left;
  word-break: keep-all;
}
.labeled-items li {
  padding: 0;
  margin-bottom: 0.65em;
  line-height: 1.65;
  color: var(--text);
  font-size: clamp(15px, 1.2vw, 20px);
}
.labeled-items li::before { content: none; }

/* Bulleted variant — used inside summary blocks; shrink-wraps so the
    accent bullets stay aligned with the centred frame. */
.labeled-items.bulleted {
  display: inline-block;
}
.labeled-items.bulleted li {
  position: relative;
  padding-left: 1.2em;
}
.labeled-items.bulleted li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 300;
  font-size: 1.4em;
}

/* In the summary+labeled-block combo, the title should sit on its own
   full-width line above the bulleted items, not compete with the inline-block ul */
.gallery-text.summary.labeled-block .labeled-title {
  display: block;
  width: 100%;
}

/* Ensures title + bullets stack vertically inside summary quote frame */
.labeled-block-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.labeled-block-inner .labeled-title {
  margin-bottom: 0.8em;
}
.labeled-block-inner .labeled-items.bulleted {
  display: inline-block; /* keep left-aligned shrink-wrap */
}

.project-grid {
  /* ADD this — smooth scroll interferes with rAF-driven scrollLeft */
  scroll-behavior: auto;
}

@keyframes langHint {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0   rgba(200, 85, 61, 0.55),   /* ring  */
                0 0 0px 0px rgba(200, 85, 61, 0);      /* glow  */
  }
  35% {
    transform: scale(1.12);
    box-shadow: 0 0 0 4px rgba(200, 85, 61, 0.4),
                0 0 16px 4px rgba(200, 85, 61, 0.55);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 9px rgba(200, 85, 61, 0),
                0 0 22px 6px rgba(200, 85, 61, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0   rgba(200, 85, 61, 0),
                0 0 0px 0px rgba(200, 85, 61, 0);
  }
}

.lang-toggle {
  animation: langHint 1.6s ease-out 5;
}

@media (prefers-reduced-motion: reduce) {
  .lang-toggle { animation: none; }
}