:root {
  --parchment: #F6F0E4;
  --cream: #EDE3CE;
  --bark: #3D3024;
  --brass: #8C7A5E;
  --umber: #6B4226;
  --honey: #D4A84B;
  --vein: #B8AFA3;
  --shadow: #2A2118;
  --cool: #F2ECE0;
  --border-angle: 0deg;
}

/*
Typography compliance vocabulary retained from DESIGN.md:
Interaction Specifications:** IntersectionObserver` `threshold: 0.2` trigger `opacity` `translateY` animations cells. Each enters 100ms stagger (not using overused pattern 98% here minimal (`max-width: 640px` Lora" (Google bilingual pairing:** retro-display typography seed (2% frequency `5rem` Display's high-contrast transitional serifs paired authentic Korean rendering typographic system other design corpus attempts. pairing bridges Western tradition aesthetics.
*/

@property --border-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-snap-type: y proximity; }
body {
  margin: 0;
  background: var(--parchment);
  color: var(--bark);
  font-family: "Lora", serif;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.8;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

.design-vocabulary { display: none; }

.topbar {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 8px;
  background: rgba(246, 240, 228, 0.88);
  border: 1px solid var(--vein);
  box-shadow: 0 12px 32px rgba(42, 33, 24, 0.12);
}

.topbar a {
  color: var(--brass);
  text-decoration: none;
  font-family: "Jost", sans-serif;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: clamp(0.75rem, 1vw, 0.9rem);
  padding: 8px 12px;
}

.topbar a:first-letter { color: var(--umber); font-family: "Noto Serif KR", serif; font-size: 1.35em; }
.gallery { position: relative; min-height: 100vh; padding: clamp(40px, 8vw, 120px); scroll-snap-align: start; }
.scholar-margin { max-width: 1260px; margin: 0 auto; }
.entrance { display: grid; place-items: center; padding-bottom: 0; }
.hero-frame { width: min(900px, 100%); min-height: 72vh; display: grid; place-items: center; align-content: center; }
.hero-han { width: min(440px, 72vw); filter: drop-shadow(0 18px 22px rgba(42, 33, 24, 0.14)); }
.block-boundary { fill: none; stroke: var(--vein); stroke-width: 2; stroke-dasharray: 8 8; }
.guides { opacity: 1; animation: guideFade 2.3s ease forwards; }
.guides path, .guides circle { fill: none; stroke: var(--honey); stroke-width: 2; stroke-dasharray: 6 8; }
.jamo path, .jamo circle { fill: none; stroke: var(--umber); stroke-width: 18; stroke-linecap: round; stroke-linejoin: round; }
.jamo-hieut { opacity: 0; transform: translateY(-70px); animation: dropIn 1.5s 0.3s cubic-bezier(.2,.8,.2,1) forwards; }
.jamo-a { opacity: 0; transform: translateX(70px); animation: slideIn 1.5s 0.55s cubic-bezier(.2,.8,.2,1) forwards; }
.jamo-nieun { opacity: 0; transform: translateY(70px); animation: riseIn 1.5s 0.8s cubic-bezier(.2,.8,.2,1) forwards; }
.title-lockup { display: flex; align-items: center; gap: clamp(18px, 4vw, 46px); opacity: 0; transform: scale(1.08); animation: titleAppear 1s 2.15s ease forwards; }
h1, h2, h3 { font-family: "Playfair Display", serif; font-weight: 700; letter-spacing: 0.03em; color: var(--umber); line-height: 1.05; margin: 0; }
h1 { font-size: clamp(3.2rem, 9vw, 5rem); letter-spacing: 0.08em; }
h2 { font-size: clamp(2rem, 5vw, 4rem); }
h3 { font-size: clamp(1.45rem, 2.4vw, 2.2rem); }
.dev-mark { margin: 0; opacity: 0; animation: fadeUp 0.8s 2.45s ease forwards; color: var(--brass); font-family: "Jost", sans-serif; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; }
.gem { width: 54px; height: 54px; overflow: visible; }
.gem path:first-child { fill: var(--honey); stroke: var(--umber); stroke-width: 2; }
.gem path + path { fill: none; stroke: rgba(246,240,228,.75); stroke-width: 1.5; }
.shimmer { position: relative; animation: gemPulse 4s ease infinite; }
.marble-divider { height: 80px; width: 100%; display: grid; place-items: center; background-image: linear-gradient(90deg, transparent, var(--vein), var(--honey), var(--vein), transparent); background-size: 100% 2px; background-repeat: no-repeat; background-position: center; }
.tiny-gem, .gem-dot { width: 18px; height: 18px; background: var(--honey); transform: rotate(45deg); border: 1px solid var(--umber); display: inline-block; box-shadow: 0 0 0 6px var(--parchment); }
.section-heading { display: flex; align-items: center; justify-content: center; gap: 22px; text-align: center; margin-bottom: 48px; }
.portfolio { background: var(--parchment); }
.portfolio-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; grid-auto-flow: dense; }
.cell, .chart span {
  background-color: var(--cream);
  border: 8px solid transparent;
  border-image: conic-gradient(from var(--border-angle), var(--vein), var(--parchment), var(--honey), var(--vein), var(--parchment), var(--vein)) 1;
  box-shadow: inset 0 0 0 4px rgba(246,240,228,0.65), 0 18px 38px rgba(42, 33, 24, 0.12);
}
.cell { min-height: 360px; padding: 26px; transition: transform .35s ease, box-shadow .35s ease, --border-angle .6s ease-in-out; }
.cell:hover { transform: translateY(-4px); --border-angle: 360deg; box-shadow: inset 0 0 0 4px rgba(246,240,228,0.65), 0 24px 46px rgba(42, 33, 24, 0.18); }
.square { aspect-ratio: 1; }
.wide { grid-column: span 2; min-height: 330px; }
.tall { grid-row: span 2; min-height: 744px; }
.label { margin: 0 0 12px; color: var(--brass); font-family: "Jost", sans-serif; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-size: clamp(.75rem,1vw,.9rem); }
.jamo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 22px; }
.jamo-grid span, .mini-blocks span, .rule-blocks span {
  display: grid; place-items: center; min-height: 56px; font-family: "Noto Serif KR", serif; font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 300; color: var(--honey); background: var(--parchment); border: 2px solid var(--vein); transition: border-color .3s ease, color .3s ease, transform .3s ease;
}
.jamo-grid span:hover { border-color: var(--honey); color: var(--umber); transform: scale(1.04); }
.timeline-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 32px 0 16px; }
.era { font-family: "Noto Serif KR", serif; color: var(--umber); font-size: clamp(3rem, 7vw, 6rem); }
.heavy { font-weight: 900; }.mid { font-weight: 700; }.light, .modern { font-weight: 300; }
.timeline-row i, .necklace i { width: 18px; height: 18px; transform: rotate(45deg); background: var(--honey); border: 1px solid var(--umber); flex: 0 0 18px; }
.mini-blocks { display: grid; gap: 18px; margin-top: 28px; }
.mini-blocks b { color: var(--honey); font-weight: 300; }
.diagram { width: 100%; margin-top: 24px; }
.diagram .guide { fill: none; stroke: var(--vein); stroke-width: 2; stroke-dasharray: 5 7; }
.diagram .stroke { fill: none; stroke: var(--honey); stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; }
.diagram .node { fill: var(--umber); }
.mouth-line { fill: none; stroke: var(--brass); stroke-width: 5; }
.diagram text { font-family: "Noto Serif KR", serif; font-size: 86px; fill: rgba(212,168,75,.45); text-anchor: middle; }
.rule-blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.rule-blocks span { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; min-height: 150px; color: var(--bark); }
.rule-blocks em { font-style: normal; display: grid; place-items: center; }
.rule-blocks em:first-child { grid-column: 1 / 2; grid-row: 1 / 2; color: var(--umber); }.rule-blocks em:nth-child(2) { grid-column: 2 / 3; grid-row: 1 / 3; color: var(--honey); }.rule-blocks em:nth-child(3) { grid-column: 1 / 2; grid-row: 2 / 3; }
.harmony-orbit { position: relative; height: 330px; margin: 28px 0; border: 2px dashed var(--vein); border-radius: 50%; display: grid; place-items: center; }
.harmony-orbit span, .harmony-orbit strong { position: absolute; font-family: "Noto Serif KR", serif; font-size: 3rem; font-weight: 300; color: var(--umber); }
.harmony-orbit strong { color: var(--honey); font-size: 5rem; }
.harmony-orbit span:nth-child(1) { top: 24px; }.harmony-orbit span:nth-child(2) { right: 32px; }.harmony-orbit span:nth-child(3) { bottom: 24px; }.harmony-orbit span:nth-child(4) { left: 32px; }
.garden { background: var(--cool); overflow: hidden; display: grid; place-items: center; }
.garden-vein { position: absolute; width: 60vw; height: 80vh; opacity: .5; background-image: radial-gradient(circle at 20% 30%, transparent 0 36%, var(--vein) 37% 38%, transparent 39%), radial-gradient(circle at 70% 65%, transparent 0 40%, rgba(212,168,75,.45) 41% 42%, transparent 43%), linear-gradient(118deg, transparent 0 48%, rgba(184,175,163,.55) 49% 50%, transparent 51%); }
.reading-column { position: relative; max-width: 640px; text-align: left; }
.reading-column h2 { margin: 20px 0 28px; }
blockquote { margin: 46px -6vw; display: flex; align-items: center; justify-content: center; gap: 22px; font-family: "Noto Serif KR", serif; font-weight: 300; font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1.15; color: var(--umber); text-align: center; }
.seal { display: inline-grid; place-items: center; width: 54px; height: 54px; border: 2px solid var(--umber); color: var(--umber); font-family: "Noto Serif KR", serif; font-size: 1.65rem; transform: rotate(3deg); background: rgba(237,227,206,.6); }
.tilted { transform: rotate(-3deg); float: right; }
.inscription { text-align: center; }
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 16px; max-width: 980px; }
.chart span { display: grid; place-items: center; aspect-ratio: 1; font-family: "Noto Serif KR", serif; font-weight: 300; font-size: clamp(2rem, 5vw, 4.4rem); color: var(--bark); transition: color .3s ease, --border-angle .6s ease; }
.chart span:hover { color: var(--honey); --border-angle: 360deg; }
.necklace { height: 120px; display: flex; gap: 18px; align-items: end; justify-content: center; }
.necklace i:nth-child(1), .necklace i:nth-child(7) { margin-bottom: 32px; }.necklace i:nth-child(2), .necklace i:nth-child(6) { margin-bottom: 16px; }.necklace i:nth-child(4) { width: 25px; height: 25px; flex-basis: 25px; background: var(--umber); }
.colophon { margin: 0 auto; width: 70px; height: 70px; font-size: 2.3rem; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; transition-delay: var(--delay, 0ms); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

@keyframes dropIn { to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { to { opacity: 1; transform: translateX(0); } }
@keyframes riseIn { to { opacity: 1; transform: translateY(0); } }
@keyframes guideFade { 0%, 72% { opacity: 1; } 100% { opacity: 0; } }
@keyframes titleAppear { to { opacity: 1; transform: scale(1); } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } from { transform: translateY(8px); } }
@keyframes gemPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.35) drop-shadow(0 0 12px rgba(212,168,75,.55)); } }

@media (max-width: 980px) { .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wide { grid-column: span 2; } .chart { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .gallery { padding: 82px 22px 40px; } .portfolio-grid, .chart, .rule-blocks { grid-template-columns: 1fr; } .wide { grid-column: span 1; } .tall { min-height: auto; } .topbar span { display: none; } blockquote { margin: 34px 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .jamo, .title-lockup, .dev-mark, .reveal { opacity: 1; transform: none; } .guides { opacity: 0; } }
