/* ============================================================
   SHARED DESIGN SYSTEM — Jaeun Choi Lab
   ============================================================ */
:root {
  /* Cold Steel — blue-grey paper, deep navy ink, cool steel accent */
  --bg: #F3F5F8;
  --bg-alt: #E7EBF1;
  --bg-deep: #D6DCE5;
  --paper: #FAFBFD;
  --ink: #0B1220;
  --ink-soft: #2A3142;
  --ink-muted: #6E7689;
  --line: #CED4DF;
  --line-soft: #E1E5EC;
  --accent: #0B1220;         /* deep navy-black */
  --accent-soft: #4A5266;
  --ocher: #5B6B85;          /* cool steel — replaces any warm accent */
  --sans: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --serif: 'Fraunces', 'Pretendard', serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
:root[data-theme="cool"] {
  --bg: #F3F4F6; --bg-alt: #E9EBEF; --bg-deep: #D7DBE2; --paper: #F9FAFC;
  --ink: #0B0F16; --ink-soft: #2B3240; --ink-muted: #6F7685;
  --line: #CED3DB; --line-soft: #E0E4EA;
  --accent: #0F1521; --accent-soft: #3B4255; --ocher: #6B7A95;
}
:root[data-theme="mono"] {
  --bg: #F5F4F2; --bg-alt: #EAE9E6; --bg-deep: #D6D5D1; --paper: #FBFAF8;
  --ink: #0A0A09; --ink-soft: #2D2C2A; --ink-muted: #6F6D68;
  --line: #D3D1CC; --line-soft: #E4E2DD;
  --accent: #0A0A09; --accent-soft: #39372F; --ocher: #8C8983;
}
:root[data-dark="true"] {
  --bg: #0E0E0C; --bg-alt: #161513; --bg-deep: #1E1D1A; --paper: #131210;
  --ink: #F1ECDF; --ink-soft: #CFC7B4; --ink-muted: #8A8275;
  --line: #26241E; --line-soft: #1D1B16;
  --accent: #F1ECDF; --accent-soft: #CFC7B4; --ocher: #B9915D;
}
:root[data-dark="true"][data-theme="cool"] { --ocher: #9EAAC4; }
:root[data-dark="true"][data-theme="mono"] { --ocher: #BFBCB6; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
  word-break: keep-all; overflow-wrap: break-word;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.serif { font-family: var(--serif); font-optical-sizing: auto; }
.mono { font-family: var(--mono); letter-spacing: 0.05em; }

/* ======== KOREAN ITALIC FIX ========
   Fraunces has no Hangul glyphs — falls back to Pretendard and synthesizes
   oblique, which looks awful. For Korean emphasis, drop italic entirely and
   keep color+weight differentiation. Latin inside <em> still renders as
   true Fraunces italic. */
:lang(ko) em, em:lang(ko),
h1 em, h2 em, h3 em, h4 em, h5 em, blockquote em,
.sec-title em, .page-hero h1 em {
  font-style: normal;
}
/* But we still WANT Fraunces italic for obvious English words inside em.
   Use a dedicated .en-italic class for those. */
.en-italic { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }
/* .kr-italic: Korean emphasis — color + weight only, no slant */
.kr-italic { font-style: normal; font-weight: 500; color: var(--accent); }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 56px; }

/* ======== NAV ======== */
nav.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
nav.top.scrolled { border-bottom-color: var(--line); }
nav.top .row {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: 1320px; margin: 0 auto; padding: 0 56px;
}
nav.top .brand { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
nav.top .brand .mk { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--paper); display: grid; place-items: center; font-size: 14px; font-weight: 600; font-family: var(--serif); font-style: italic; }
nav.top .brand .nm { display: flex; flex-direction: column; line-height: 1.2; }
nav.top .brand .nm .k { font-weight: 600; letter-spacing: -0.02em; }
nav.top .brand .nm .e { font-size: 10px; color: var(--ink-muted); font-family: var(--serif); font-style: italic; letter-spacing: 0.02em; }
nav.top ul { list-style: none; display: flex; gap: 28px; font-size: 13px; }
nav.top ul li { white-space: nowrap; }
nav.top ul a { color: var(--ink-soft); transition: color 0.2s; position: relative; padding: 6px 0; white-space: nowrap; }
nav.top ul a:hover, nav.top ul a.active { color: var(--ink); }
nav.top ul a.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px; background: var(--accent);
}
nav.top .cta {
  font-family: var(--mono); font-size: 11px;
  padding: 9px 16px; border: 1px solid var(--ink);
  color: var(--ink); border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.08em;
  transition: all 0.2s;
}
nav.top .cta:hover { background: var(--ink); color: var(--bg); }

/* ======== FOOTER ======== */
footer.site { background: var(--ink); color: var(--bg); padding: 100px 0 40px; margin-top: 120px; }
footer.site .row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 80px; }
footer.site h2 {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(32px, 4vw, 48px); line-height: 1.15;
  letter-spacing: -0.035em; margin-bottom: 24px; word-break: keep-all;
}
footer.site h2 em { font-family: var(--serif); font-style: italic; color: var(--accent-soft); font-weight: 400; }
footer.site h2 .kr-italic { color: var(--accent-soft); font-weight: 500; }
footer.site .sub { font-size: 15px; line-height: 1.75; color: color-mix(in oklab, var(--bg) 65%, transparent); max-width: 460px; margin-bottom: 32px; word-break: keep-all; }
footer.site .email-link { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border: 1px solid color-mix(in oklab, var(--bg) 25%, transparent); color: var(--bg); font-family: var(--mono); font-size: 12px; cursor: pointer; background: transparent; transition: all 0.2s; }
footer.site .email-link:hover { background: var(--bg); color: var(--ink); }
footer.site h5 { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: color-mix(in oklab, var(--bg) 50%, transparent); margin-bottom: 22px; }
footer.site ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
footer.site ul li { font-size: 14px; color: color-mix(in oklab, var(--bg) 85%, transparent); }
footer.site ul li span { font-family: var(--mono); font-size: 10.5px; color: color-mix(in oklab, var(--bg) 48%, transparent); display: block; margin-top: 3px; letter-spacing: 0.04em; }
footer.site .copy {
  grid-column: 1 / -1; margin-top: 64px; padding-top: 28px;
  border-top: 1px solid color-mix(in oklab, var(--bg) 12%, transparent);
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: color-mix(in oklab, var(--bg) 42%, transparent);
}

/* ======== COMMON PAGE HEADER ======== */
.page-hero {
  padding: 140px 0 80px;
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-muted);
  display: flex; align-items: center; gap: 14px; margin-bottom: 28px;
}
.page-hero .eyebrow::before { content: ''; width: 36px; height: 1px; background: var(--accent); }
.page-hero h1 {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(48px, 6vw, 80px); line-height: 1.08;
  letter-spacing: -0.045em; color: var(--ink);
  margin-bottom: 28px; word-break: keep-all; max-width: 900px;
}
.page-hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); font-size: 0.92em; }
.page-hero h1 .kr-italic { color: var(--accent); font-weight: 500; }
.page-hero .lead { font-size: 17px; line-height: 1.75; color: var(--ink-soft); max-width: 640px; word-break: keep-all; }

/* ======== TYPE helpers ======== */
.sec-num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--accent); text-transform: uppercase; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sec-num::before { content: ''; width: 24px; height: 1px; background: var(--accent); }
.sec-title { font-family: var(--sans); font-weight: 300; font-size: clamp(32px, 4vw, 52px); line-height: 1.1; letter-spacing: -0.035em; color: var(--ink); word-break: keep-all; }
.sec-title em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); font-size: 0.95em; }
.sec-title .kr-italic { color: var(--accent); font-weight: 500; }
.sec-sub { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; color: var(--ink-muted); text-transform: uppercase; margin-bottom: 24px; display: flex; align-items: center; gap: 14px; }
.sec-sub::before { content: ''; flex: 0 0 24px; height: 1px; background: var(--ink-muted); opacity: 0.4; }
.sec-sub::after { content: ''; flex: 1; height: 1px; background: var(--ink-muted); opacity: 0.4; }

/* ======== TWEAKS PANEL ======== */
#tweakTab { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: none; background: var(--ink); color: var(--bg); border: none; padding: 12px 18px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; border-radius: 999px; }
#tweakTab.show { display: block; }
.tweaks-panel { position: fixed; bottom: 80px; right: 24px; width: 300px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,0.2); z-index: 1001; padding: 22px; display: none; }
.tweaks-panel.open { display: block; }
.tweaks-panel h6 { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; }
.tweaks-panel h6 .x { cursor: pointer; color: var(--ink-muted); font-size: 16px; line-height: 1; }
.tw-grp { margin-bottom: 18px; }
.tw-grp label { font-size: 10px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.12em; font-family: var(--mono); display: block; margin-bottom: 10px; }
.swatches { display: flex; gap: 8px; }
.sw { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.sw:hover { transform: scale(1.1); }
.sw.active { border-color: var(--ink); }
.sw.warm { background: linear-gradient(135deg, #F3F5F8 50%, #0B1220 50%); }
.sw.cool { background: linear-gradient(135deg, #F3F4F6 50%, #0F1521 50%); }
.sw.mono { background: linear-gradient(135deg, #F5F4F2 50%, #0A0A09 50%); }
.tog-row { display: flex; justify-content: space-between; align-items: center; }
.tog-row span { font-size: 12px; color: var(--ink); }
.tog { width: 40px; height: 22px; background: var(--line); border-radius: 999px; position: relative; cursor: pointer; transition: background 0.2s; border: none; }
.tog::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.tog.on { background: var(--accent); }
.tog.on::after { transform: translateX(18px); }

/* ======== SECTION PADDING ======== */
section.block { padding: 100px 0; border-bottom: 1px solid var(--line); }
section.block:last-of-type { border-bottom: none; }
section.block.alt { background: var(--bg-alt); }
section.block.paper { background: var(--paper); }

.sec-head {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 72px; margin-bottom: 56px; align-items: start;
}
.sec-lead { font-size: 16px; line-height: 1.75; color: var(--ink-soft); max-width: 580px; padding-top: 12px; word-break: keep-all; }

/* ======== RESPONSIVE ======== */
@media (max-width: 1200px) {
  .wrap { padding: 0 40px; }
  nav.top ul { gap: 18px; font-size: 12px; }
}
@media (max-width: 1000px) {
  nav.top ul { gap: 14px; font-size: 11px; }
}
@media (max-width: 900px) {
  .wrap { padding: 0 24px; }
  nav.top .row { padding: 0 24px; }
  nav.top ul { display: none; }
  nav.top .cta { padding: 7px 12px; font-size: 10px; }
  .page-hero { padding: 112px 0 56px; }
  .sec-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
  footer.site .row { grid-template-columns: 1fr; gap: 40px; }
  footer.site .copy { flex-direction: column; gap: 8px; }
}
