/* ============================================================
   Korean American Starter Pack
   "Hanji & Ink" — an editorial field guide
   Palette drawn from obangsaek (오방색), the five cardinal colors,
   set on warm hanji paper with a vermillion seal accent.
   ============================================================ */

:root {
  --paper:      #f6f1e6;   /* hanji cream */
  --paper-deep: #efe7d6;   /* recessed panels */
  --ink:        #211c17;   /* near-black ink */
  --ink-soft:   #574e43;   /* secondary text */
  --ink-faint:  #8c8172;   /* captions */
  --line:       #d9cfba;   /* hairlines */

  --seal:       #b5342a;   /* vermillion (jeok) */
  --celadon:    #5f8c7d;   /* Goryeo celadon jade */
  --indigo:     #2f4a67;   /* obangsaek blue (cheong) */

  --serif:  "Fraunces", "Nanum Myeongjo", Georgia, serif;
  --hangul: "Nanum Myeongjo", "Noto Serif KR", serif;
  --sans:   "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 6rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(120, 100, 70, 0.05) 1px, transparent 1px);
  background-size: 4px 4px;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

em { font-style: italic; color: var(--ink); }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--gutter);
  background: rgba(246, 241, 230, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__brand { text-decoration: none; color: var(--ink); line-height: 1.1; display: flex; flex-direction: column; }
.topbar__ko { font-family: var(--hangul); font-size: 1.05rem; font-weight: 700; letter-spacing: 0.02em; }
.topbar__en { font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-faint); }

.topbar__nav { display: flex; gap: clamp(0.75rem, 2vw, 1.75rem); overflow-x: auto; }
.topbar__nav a {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  white-space: nowrap;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.topbar__nav a:hover { color: var(--seal); border-color: var(--seal); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 14vh, 9rem) var(--gutter) clamp(3rem, 8vh, 5rem);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(246,241,230,0.72) 0%, rgba(246,241,230,0.80) 55%, rgba(246,241,230,0.94) 100%),
    url("../images/hero-boseong.jpg");
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero__inner { position: relative; z-index: 1; max-width: 60rem; margin: 0 auto; text-align: center; }

.hero__eyebrow {
  font-family: var(--hangul);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--celadon);
  margin: 0 0 1.5rem;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.8rem, 9vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
}
.hero__title em { font-style: italic; color: var(--seal); }

.hero__lede {
  max-width: 40rem;
  margin: 2rem auto 0;
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  color: var(--ink-soft);
}

/* Seal / dojang motif */
.seal {
  display: inline-grid;
  place-items: center;
  width: 76px; height: 76px;
  margin-top: 3rem;
  background: var(--seal);
  color: var(--paper);
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(181, 52, 42, 0.32);
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.seal:hover { transform: translateY(-3px) rotate(-2deg); box-shadow: 0 10px 30px rgba(181, 52, 42, 0.4); }
.seal__char { font-family: var(--hangul); font-size: 2.4rem; font-weight: 800; line-height: 1; }

/* ============================================================
   ENTRIES
   ============================================================ */
.entries { max-width: 68rem; margin: 0 auto; padding: 0 var(--gutter); }

.entry {
  position: relative;
  padding: clamp(3.5rem, 9vh, 6rem) 0;
  border-bottom: 1px solid var(--line);
}
.entry:last-child { border-bottom: none; }

.entry__index {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 12vw, 8rem);
  font-weight: 400;
  line-height: 1;
  color: var(--line);
  position: absolute;
  top: clamp(2rem, 5vh, 3.5rem);
  right: 0;
  pointer-events: none;
  z-index: 0;
}

.entry__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: clamp(1rem, 3vw, 2.25rem);
  margin-bottom: 2.75rem;
}

.entry__ko {
  font-family: var(--hangul);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 0.9;
  color: var(--indigo);
}

.entry__meta { display: flex; flex-direction: column; }
.entry__rom {
  order: -1;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--celadon);
  margin-bottom: 0.35rem;
}
.entry__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 4.5vw, 2.9rem);
  line-height: 1.05;
  margin: 0;
}
.entry__kind {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0.6rem 0 0;
}

/* image beside text — alternates side per entry */
.entry__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.75rem, 5vw, 4rem);
  align-items: start;
}
.entry:nth-of-type(even) .entry__figure { order: 2; }

.entry__figure {
  margin: 0;
  position: sticky;
  top: 5.5rem;
}
.entry__figure img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(33, 28, 23, 0.14);
}
.entry__figure figcaption {
  margin-top: 0.85rem;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  line-height: 1.5;
  color: var(--ink-faint);
  border-left: 2px solid var(--seal);
  padding-left: 0.75rem;
}

.entry__body {
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4vw, 2.75rem);
}

.entry__section h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--seal);
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.entry__section p {
  margin: 0 0 1.1rem;
  font-size: 1.01rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}
.entry__section p:last-child { margin-bottom: 0; }
.entry__section em { color: var(--ink); font-style: italic; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: clamp(3rem, 8vh, 5rem) var(--gutter);
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
}
.footer__ko { font-family: var(--hangul); font-size: 1.6rem; font-weight: 700; color: var(--indigo); margin: 0 0 0.75rem; }
.footer__note { font-size: 0.85rem; letter-spacing: 0.04em; color: var(--ink-faint); margin: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .entry__layout { grid-template-columns: 1fr; }
  .entry:nth-of-type(even) .entry__figure { order: 0; }
  .entry__figure { position: static; max-width: 30rem; }
  .entry__figure img { aspect-ratio: 3 / 2; }
}

@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .entry__index { opacity: 0.6; }
  .entry__head { flex-direction: column; gap: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .seal { transition: none; }
}

/* ============================================================
   IMAGE CREDITS
   ============================================================ */
.credits {
  max-width: 52rem;
  margin: clamp(2.5rem, 6vh, 4rem) auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  text-align: left;
}
.credits__title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1rem;
}
.credits__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink-faint);
}
.credits__list a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.credits__list a:hover { color: var(--seal); }
