/* ============================================================
   Editorial — polished v2
   Magazine-style personal site.  Color/type tokens live here.
   ============================================================ */
:root {
  /* paper palette */
  --bg:        #f6f3eb;
  --bg-2:      #ede8d9;
  --paper:     #fcfbf6;
  --ink:       #1a1816;
  --ink-2:     #4a4742;
  --muted:     #87827a;
  --rule:      #1a18161a;
  --rule-2:    #1a181638;
  --accent:    #c14b28;
  --accent-soft: #c14b2814;

  /* typography */
  --serif:    'Fraunces', 'Source Serif Pro', Georgia, serif;
  --serif-2:  'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --sans:     'Inter', -apple-system, system-ui, sans-serif;
  --mono:     'JetBrains Mono', ui-monospace, monospace;
  --display:  var(--serif);  /* swapped by tweaks */
  --italic-skew: 0deg;       /* tweaks: 0 / 4 for "theatrical" italics */
  --rhythm:   1;             /* tweaks: 0.85 compact / 1 normal / 1.18 spacious */

  /* overlay tokens (used by /shared/overlays.css) */
  --ov-bg: rgba(26,24,22,.5);
  --ov-panel: var(--paper);
  --ov-text: var(--ink);
  --ov-muted: var(--muted);
  --ov-border: var(--rule);
  --ov-soft: var(--bg-2);
  --ov-accent: var(--accent);
  --ov-mono: var(--mono);
}
:root[data-theme="dark"] {
  --bg:      #0f0e0b;
  --bg-2:    #1a1812;
  --paper:   #221e15;
  --ink:     #f1ecdf;
  --ink-2:   #c4bea9;
  --muted:   #8a8270;
  --rule:    #f1ecdf24;
  --rule-2:  #f1ecdf42;
  --accent-soft: #ff7a5222;
  --ov-bg: rgba(0,0,0,.6);
  --ov-panel: #1f1c15;
  --ov-text: var(--ink);
  --ov-muted: var(--muted);
  --ov-border: var(--rule);
  --ov-soft: #ffffff0c;
}

/* accent palettes — set by tweaks */
:root[data-accent="terracotta"] { --accent: #c14b28; --accent-soft: #c14b2814; }
:root[data-accent="ink"]        { --accent: #1a1816; --accent-soft: #1a181612; }
:root[data-accent="forest"]     { --accent: #2f6a3f; --accent-soft: #2f6a3f14; }
:root[data-accent="royal"]      { --accent: #2742a3; --accent-soft: #2742a314; }
:root[data-theme="dark"][data-accent="terracotta"] { --accent: #ff7a52; }
:root[data-theme="dark"][data-accent="ink"]        { --accent: #f1ecdf; }
:root[data-theme="dark"][data-accent="forest"]     { --accent: #6dd089; }
:root[data-theme="dark"][data-accent="royal"]      { --accent: #7da3ff; }

* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
html { background: var(--bg); }
body {
  /* !important defeats the preview-pane's `html, body { background: transparent }` injection.
     Harmless in production where no such override exists. */
  background: var(--bg) !important;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .4s ease, color .35s ease;
}
a { color: inherit; }
::selection { background: var(--accent); color: var(--paper); }

/* —— Atoms —— */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 36px; }
.display { font-family: var(--display); font-weight: 400; }
.mono  { font-family: var(--mono); }
.italic { font-style: italic; font-variation-settings: 'opsz' 144; }
.italic.theatrical { transform: skewX(calc(-1 * var(--italic-skew))); display: inline-block; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.rule-orn {
  display:flex; align-items:center; gap: 12px; color: var(--muted);
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
}
.rule-orn::before, .rule-orn::after { content:''; flex:1; height:1px; background: var(--rule); }

/* —— Reveal —— */
[data-reveal] { opacity:0; transform: translateY(20px); transition: opacity .9s ease, transform .9s ease; }
[data-reveal][data-revealed] { opacity:1; transform: none; }

/* —— Scroll progress —— */
.scroll-progress {
  position: fixed; left:0; top: 0; height: 2px; width: 0;
  background: var(--accent); z-index: 200; transition: width .1s linear;
}

/* —— Masthead colophon —— */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.masthead-row {
  display:flex; align-items:center; justify-content:space-between;
  padding: 8px 36px; max-width: 1180px; margin: 0 auto;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.masthead-row .em { color: var(--ink-2); }
.masthead-row .sep { margin: 0 8px; color: var(--rule-2); }

/* —— Nav —— */
.nav {
  position: sticky; top:0; z-index: 50;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--rule);
}
.nav-row {
  display:flex; align-items:center; justify-content:space-between;
  height: 70px;
}
.nav-brand {
  display:flex; align-items:baseline; gap:12px;
  font-family: var(--display); font-weight: 600; font-size: 22px;
  letter-spacing: -.02em; text-decoration:none;
}
.nav-brand .monogram {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--paper);
  display:grid; place-items:center;
  font-family: var(--display); font-weight: 600; font-size: 13px;
  letter-spacing: 0; align-self: center;
}
.nav-brand .en { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; font-weight: 400; align-self: center; }
.nav-brand:focus { outline: none; box-shadow: none; }
.nav-brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; box-shadow: none; }
.nav-links { display:flex; gap: 28px; }
.nav-links a {
  font-size: 13px; color: var(--ink-2); text-decoration: none;
  padding: 4px 0; position: relative; transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-tools { display:flex; align-items:center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--rule); background: transparent;
  color: var(--ink); cursor: pointer; display:grid; place-items:center;
  transition: background .2s, border-color .2s;
  font-family: var(--mono); font-size: 11px;
}
.icon-btn:hover { background: var(--bg-2); border-color: var(--rule-2); }
.kbd-btn {
  display:flex; align-items:center; gap:8px;
  padding: 6px 12px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--rule);
  color: var(--muted); font-size: 12px; cursor: pointer;
  font-family: inherit;
}
.kbd-btn kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 3px; background: var(--paper); border:1px solid var(--rule); }

/* —— Hero —— */
.hero { padding: calc(48px * var(--rhythm)) 0 calc(140px * var(--rhythm)); border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.hero-grid {
  display:grid;
  grid-template-columns: 1fr 280px;
  gap: 80px;
  align-items: flex-start;
}
.hero-numeral {
  position: absolute;
  top: 60px; right: -30px;
  font-family: var(--display); font-style: italic;
  font-size: 360px; font-weight: 300; line-height: 1;
  color: var(--accent); opacity: .07; pointer-events: none;
  font-variation-settings: 'opsz' 144;
}
.hero-eyebrow {
  display:flex; align-items:center; gap:12px;
  margin-bottom: 36px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.hero-eyebrow .line { width: 36px; height:1px; background: var(--ink-2); }
.hero-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(48px, 6.4vw, 92px);
  line-height: 1.02;
  letter-spacing: -.025em;
  margin: 0 0 36px;
  max-width: 14ch;
}
.hero-title em {
  font-style: italic; font-variation-settings: 'opsz' 144;
  color: var(--accent);
  display:inline-block;
  transform: skewX(calc(-1 * var(--italic-skew)));
}
.hero-type {
  font-family: var(--mono); font-size: 13px;
  color: var(--ink-2);
  min-height: 1.4em;
  margin-bottom: 32px;
}
.hero-type::before { content: '— '; color: var(--accent); }
.hero-type::after {
  content: '▍'; color: var(--accent); margin-left: 2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-desc {
  max-width: 58ch; font-size: 17px; color: var(--ink-2); line-height: 1.65;
}
.hero-desc::first-letter {
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: 2.4em; float: left; line-height: 0.9;
  margin: 4px 8px 0 0; color: var(--accent);
}

.hero-meta {
  display:grid; grid-template-columns: repeat(4, 1fr);
  gap: 36px; margin-top: 64px;
  padding-top: 32px; border-top: 1px solid var(--rule);
}
.hero-meta-item .k { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.hero-meta-item .v { font-size: 14px; color: var(--ink); }
.hero-meta-item .v .pill { display:inline-block; width:6px; height:6px; border-radius:50%; background: #16B57F; box-shadow: 0 0 0 3px rgba(22,181,127,.16); margin-right:8px; vertical-align: middle; }

/* hero side column */
.hero-side { padding-top: 8px; }
.hero-portrait {
  width: 100%; aspect-ratio: 3/4;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  position: relative; overflow: hidden;
  margin-bottom: 18px;
}
.hero-portrait::before {
  /* abstract monogram backdrop */
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 30%, var(--accent-soft), transparent 70%),
    repeating-linear-gradient(135deg, transparent 0 8px, var(--rule) 8px 9px);
}
.hero-portrait .pm {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: 110px; color: var(--accent); letter-spacing: -.03em;
  font-variation-settings: 'opsz' 144;
}
.hero-portrait .caption {
  position: absolute; left: 16px; bottom: 14px; right: 16px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-2);
  display:flex; justify-content: space-between;
}

.now-card {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 18px 20px;
  font-size: 12px;
}
.now-card .head { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display:flex; justify-content: space-between; margin-bottom: 12px;}
.now-card .head .live::before { content:'● '; color: #16B57F; }
.now-card .row { display:flex; justify-content:space-between; padding: 6px 0; border-top: 1px dashed var(--rule); }
.now-card .row:first-of-type { border-top: 0; }
.now-card .row .lbl { color: var(--ink-2); }
.now-card .num { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--ink); font-style: italic; font-variation-settings: 'opsz' 144;}

/* —— Marquee —— */
.marquee {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden; padding: 14px 0;
  background: var(--bg);
  position: relative;
}
.marquee-track {
  display:flex; gap: 64px; width: max-content;
  animation: marquee 60s linear infinite;
  white-space: nowrap;
}
.marquee-track span {
  font-family: var(--display); font-style: italic; font-size: 26px;
  color: var(--ink-2); letter-spacing: -.01em;
}
.marquee-track span::after { content:' ✦ '; color: var(--accent); margin-left: 60px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* —— Section —— */
.sec { padding: calc(110px * var(--rhythm)) 0; border-bottom: 1px solid var(--rule); position: relative; }
.sec-num {
  position: absolute; top: 32px; right: 36px;
  font-family: var(--display); font-style: italic; font-size: 110px;
  color: var(--accent); opacity: .12;
  font-weight: 300; line-height: 1; pointer-events: none;
  font-variation-settings: 'opsz' 144;
}
.sec-head { display:flex; align-items:flex-end; justify-content:space-between; gap: 32px; margin-bottom: 56px; flex-wrap: wrap; }
.sec-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(34px, 4.4vw, 56px);
  letter-spacing: -.02em; margin: 0;
  line-height: 1.05; max-width: 16ch;
}
.sec-title em { font-style: italic; font-variation-settings: 'opsz' 144; color: var(--accent); }
.sec-eyebrow {
  display:block; margin-bottom: 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.sec-aside { color: var(--ink-2); font-size: 14px; max-width: 36ch; line-height: 1.6; }
.sec-link {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 4px;
  transition: color .2s, border-color .2s;
}
.sec-link:hover { color: var(--accent); border-color: var(--accent); }

/* —— Featured article —— */
.featured {
  display:grid; grid-template-columns: 1.1fr 1fr; gap: 56px;
  align-items: stretch; margin-bottom: 56px;
  border-top: 1px solid var(--ink); padding-top: 36px;
  cursor: pointer;
}
.featured:hover .f-title { color: var(--accent); }
.featured-art {
  background: var(--bg-2); background-size: cover; background-position: center;
  position: relative; overflow: hidden;
  min-height: 320px;
}
.featured-art::before {
  content: ''; position:absolute; inset:0;
  background:
    radial-gradient(ellipse 80% 70% at 70% 20%, var(--accent-soft), transparent 60%),
    repeating-linear-gradient(45deg, transparent 0 12px, var(--rule) 12px 13px);
}
/* Cover image mode */
.featured-art.has-cover { background-size: cover; background-position: center; }
.featured-art.has-cover::before {
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.35) 100%);
}
.featured-art.has-cover .glyph { display: none; }
.featured-art.has-cover .tag {
  color: #fff; background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
}
.featured-art.has-cover .caption { color: rgba(255,255,255,.85); }
.featured-art .glyph {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--display); font-style: italic; font-size: 200px;
  color: var(--accent); font-weight: 300; line-height: 1; letter-spacing: -.04em;
  font-variation-settings: 'opsz' 144;
}
.featured-art .tag {
  position: absolute; left: 18px; top: 18px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); background: var(--paper); padding: 5px 10px;
}
.featured-art .caption {
  position: absolute; left: 18px; bottom: 16px; right: 18px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-2); display: flex; justify-content: space-between;
}
.featured-body { display:flex; flex-direction:column; justify-content: center; padding: 12px 0; }
.f-flag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.f-flag::before { content: '★ '; }
.f-title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1; letter-spacing: -.018em; margin: 0 0 18px;
  transition: color .2s;
}
.f-excerpt {
  font-size: 16px; line-height: 1.65; color: var(--ink-2); max-width: 50ch;
  margin: 0 0 18px;
}
.f-excerpt::first-letter {
  font-family: var(--display); font-weight: 600; font-size: 3.2em;
  float: left; line-height: 0.85; margin: 4px 8px 0 0; color: var(--accent);
}
.f-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.f-meta .sep { margin: 0 8px; color: var(--rule-2); }

/* —— Article list —— */
.articles { display: grid; grid-template-columns: 1fr; gap: 0; }
.article {
  display: grid; grid-template-columns: 60px 100px 1fr 130px; gap: 32px;
  padding: 26px 0; border-top: 1px solid var(--rule);
  cursor: pointer; transition: padding .25s, background .25s;
  align-items: baseline;
}
.article:last-child { border-bottom: 1px solid var(--rule); }
.article:hover { background: var(--accent-soft); padding-left: 16px; padding-right: 16px; }
.article:hover .a-title { color: var(--accent); }
.article:hover .a-idx { color: var(--accent); }
.a-idx { font-family: var(--display); font-style: italic; font-size: 22px; color: var(--muted); transition: color .2s; font-variation-settings: 'opsz' 144; letter-spacing: -.01em; white-space: nowrap; }
.a-idx .hash { font-size: .7em; vertical-align: .15em; margin-right: 2px; opacity: .7; }
.a-date { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.a-title { font-family: var(--display); font-size: 23px; line-height: 1.25; letter-spacing: -.012em; margin: 0 0 8px; transition: color .2s; }
.a-excerpt { font-size: 14px; color: var(--ink-2); line-height: 1.55; max-width: 60ch; }
.a-tag-row { text-align: right; }
.a-tag { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); padding: 3px 8px; border:1px solid var(--rule); border-radius: 999px; display:inline-block; margin-bottom: 6px; white-space: nowrap; }
.a-time { display:block; font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; }

/* —— Pull quote —— */
.pullquote {
  padding: 130px 0; border-bottom: 1px solid var(--rule);
  text-align: center; background:
    radial-gradient(ellipse 700px 200px at center, var(--accent-soft), transparent 70%);
  position: relative;
}
.pullquote .mark {
  font-family: var(--display); font-style: italic; font-size: 100px;
  color: var(--accent); line-height: 0.6; margin-bottom: 18px;
  font-variation-settings: 'opsz' 144;
}
.pullquote blockquote {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(32px, 4.2vw, 56px);
  line-height: 1.16; letter-spacing: -.02em;
  max-width: 22ch; margin: 0 auto 28px; color: var(--ink);
}
.pullquote blockquote em { font-style: italic; color: var(--accent); font-variation-settings: 'opsz' 144; }
.pullquote cite {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-style: normal;
}
.pullquote cite::before { content: '— '; color: var(--accent); }

/* —— Skills —— */
.skills { display: grid; grid-template-columns: repeat(5, 1fr); gap: 28px; }
.skill-group h4 { font-family: var(--display); font-weight: 600; font-size: 19px; margin: 0 0 14px; letter-spacing: -.005em; display:flex; align-items:baseline; gap: 8px;}
.skill-group h4 .num { font-family: var(--mono); font-size: 11px; color: var(--accent); font-weight: 500; letter-spacing: .08em;}
.skill-chips { display:flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono); font-size: 11px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--rule); color: var(--ink-2);
  transition: border-color .2s, color .2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* —— Works —— */
.works {
  display:grid; grid-template-columns: repeat(6, 1fr); gap: 1px;
  background: var(--rule); border: 1px solid var(--rule);
}
.work {
  background: var(--paper);
  padding: 28px 26px;
  cursor: pointer; transition: background .25s; position: relative;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 300px;
}
.work:nth-child(1), .work:nth-child(2) { grid-column: span 3; }
.work:nth-child(n+3) { grid-column: span 2; }
.work:hover { background: var(--bg-2); }
.work::before {
  content:''; position:absolute; left:0; top:0; width:3px; height:0;
  background: var(--w-accent, var(--accent));
  transition: height .35s ease;
}
.work:hover::before { height: 100%; }
.w-head { display:flex; align-items:flex-start; justify-content:space-between; gap: 16px; }
.w-mono {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--w-accent, var(--accent)); color: var(--paper);
  display:grid; place-items: center;
  font-family: var(--display); font-style: italic; font-weight: 600; font-size: 16px;
  flex-shrink: 0; font-variation-settings: 'opsz' 144;
}
.w-name { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 4px; }
.w-stage { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.w-stage .dot { display:inline-block; width:6px; height:6px; border-radius:50%; background: var(--w-accent, var(--accent)); margin-right: 6px; vertical-align: middle; }
.w-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; flex: 1; }
.w-foot { display:flex; align-items:center; justify-content:space-between; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--rule); }
.w-tags { display:flex; gap: 6px; flex-wrap: wrap; }
.w-tag { font-family: var(--mono); font-size: 10px; padding: 2px 7px; border-radius: 999px; background: var(--bg-2); color: var(--muted); }
.w-metric { font-family: var(--mono); font-size: 11px; color: var(--ink); white-space: nowrap; }
.w-metric::before { content:'→ '; color: var(--muted); }

/* —— Docs —— */
.docs-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.doc {
  display:grid; grid-template-columns: 64px 1fr auto; gap: 24px;
  align-items: flex-start;
  padding: 28px 30px; border-bottom: 1px solid var(--rule);
  cursor: pointer; transition: background .2s;
}
.doc:nth-child(odd) { border-right: 1px solid var(--rule); }
.doc:hover { background: var(--accent-soft); }
.doc:hover .doc-title { color: var(--accent); }
.doc-num {
  font-family: var(--display); font-style: italic; font-size: 22px;
  color: var(--accent); line-height: 1; padding-top: 4px;
  font-variation-settings: 'opsz' 144;
  text-align: right; white-space: nowrap;
  letter-spacing: -.01em;
}
.doc-num .hash { font-size: .7em; vertical-align: .15em; margin-right: 2px; opacity: .7; }
.doc-body { min-width: 0; }
.doc-kind { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.doc-title { font-family: var(--display); font-size: 19px; font-weight: 600; line-height: 1.3; margin: 0 0 6px; letter-spacing: -.005em; transition: color .2s; }
.doc-desc  { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.doc-updated { font-family: var(--mono); font-size: 10px; color: var(--muted); white-space: nowrap; padding-top: 6px; }

/* —— Contact —— */
.contact { padding: 130px 0 60px; border-bottom: 1px solid var(--rule); position: relative; }
.contact-grid { display:grid; grid-template-columns: 1.4fr 1fr; gap: 80px; align-items: flex-end; }
.contact h2 {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(48px, 6.2vw, 88px);
  letter-spacing: -.025em; line-height: 1.04;
  margin: 0 0 28px; max-width: 16ch;
}
.contact h2 em { font-style: italic; color: var(--accent); font-variation-settings: 'opsz' 144; }
.contact-desc { font-size: 17px; color: var(--ink-2); line-height: 1.6; max-width: 52ch; }
.contact-links { display:flex; flex-direction: column; gap: 2px; }
.contact-links a {
  display:flex; align-items:baseline; justify-content: space-between;
  font-family: var(--display); font-weight: 400; font-size: 24px;
  text-decoration: none; color: var(--ink); padding: 14px 0;
  border-bottom: 1px solid var(--rule); transition: color .2s, padding .2s;
}
.contact-links a:hover { color: var(--accent); padding-left: 8px; }
.contact-links a .arrow { font-family: var(--mono); font-size: 12px; color: var(--muted); transition: color .2s; }
.contact-links a:hover .arrow { color: var(--accent); }
.contact-links a .handle { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; }

/* WeChat QR hover popup (wechat uses same <a> styling) */
.contact-links a[data-no-link] { position: relative; cursor: default; }
.wechat-qr-img {
  display: none; position: absolute; right: 0; bottom: 100%;
  width: 160px; height: 160px; border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15); z-index: 10;
  background: #fff; padding: 6px;
}
.contact-links a[data-no-link]:hover .wechat-qr-img { display: block; }

/* —— Footer —— */
.foot { padding: 32px 0; font-family: var(--mono); font-size: 11px; color: var(--muted); display:flex; justify-content:space-between; gap: 20px; flex-wrap: wrap; }
.foot .sig { color: var(--ink-2); }

/* Lang */
[data-lang="zh"] .en-only, [data-lang="en"] .zh-only { display: none; }

/* —— Tweaks panel —— */
.tweaks {
  position: fixed; right: 24px; top: 96px; z-index: 8500;
  width: 280px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.2);
  font-family: var(--sans);
  display: none;
}
.tweaks.open { display: block; }
.tweaks-head {
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--rule);
}
.tweaks-head h4 { font-family: var(--display); font-weight: 600; font-size: 15px; margin: 0; }
.tweaks-head .small { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tweaks-close { width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--bg-2); cursor: pointer; color: var(--ink); font-size: 14px; }
.tweaks-body { padding: 16px; display:flex; flex-direction: column; gap: 18px; }
.tweak-group { }
.tweak-label { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display:block; }
.swatches { display:grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch {
  aspect-ratio: 1/1; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--rule); transition: transform .15s;
}
.swatch.on { border-color: var(--ink); transform: scale(1.1); }
.swatch:hover { transform: scale(1.06); }
.segment {
  display:flex; background: var(--bg-2); border-radius: 999px; padding: 3px; gap: 2px;
}
.segment button {
  flex:1; border:0; background: transparent; cursor: pointer;
  padding: 8px 10px; border-radius: 999px; font-size: 12px; color: var(--ink-2);
  font-family: inherit; transition: background .2s, color .2s;
}
.segment button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.06); }

@media (max-width: 1000px) {
  .wrap { padding: 0 22px; }
  .hero { padding: 80px 0 90px; }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-side { display:grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: flex-end; }
  .hero-portrait { aspect-ratio: 1/1; }
  .hero-meta { grid-template-columns: 1fr 1fr; gap: 22px; }
  .featured { grid-template-columns: 1fr; gap: 28px; }
  .featured-art { min-height: 220px; }
  .article { grid-template-columns: 40px 80px 1fr; gap: 16px; }
  .article .a-tag-row { display: none; }
  .works { grid-template-columns: 1fr; }
  .work, .work:nth-child(n) { grid-column: span 1; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .docs-grid { grid-template-columns: 1fr; }
  .doc:nth-child(odd) { border-right: 0; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; align-items: flex-start; }
  .tweaks { right: 12px; top: auto; bottom: 80px; width: calc(100vw - 24px); max-width: 320px; }
}
