/* =========================================================================
   Mago Block — design tokens
   tone: literary dark × tech OS. parchment on inky plum. tinted neutrals.
   ========================================================================= */

:root {
  /* surfaces (tinted neutrals — never pure black/gray) */
  --bg:        #0b0a10;
  --bg-lift:   #12111c;
  --bg-card:   #171625;
  --bg-inset:  #0f0e18;
  --border:    rgba(232, 227, 213, 0.08);
  --border-hi: rgba(232, 227, 213, 0.18);

  /* text (warm parchment, not #fff) */
  --fg:        #e8e3d5;
  --fg-soft:   #c9c3b3;
  --fg-mute:   #9a9386;
  --fg-dim:    #6a6456;

  /* accents — warm literary, cool tech, duality */
  --brass:     #c9a574;
  --brass-deep:#9a7a4c;
  --steel:     #8ba8d4;
  --plum:      #9d7cb5;
  --ember:     #d96e4a;
  --leaf:      #8ab387;

  /* typography */
  --f-serif:  "Fraunces", "Source Serif Pro", Georgia, serif;
  --f-sans:   "Manrope", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --f-mono:   "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* space (4px base, modular) */
  --s-1:  4px;  --s-2:  8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px;  --s-6: 24px;  --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;
  --s-32: 128px; --s-40: 160px;

  /* radii */
  --r-1: 4px; --r-2: 8px; --r-3: 12px; --r-4: 16px; --r-full: 999px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 180ms;
  --dur-2: 320ms;
  --dur-3: 560ms;

  /* content width */
  --w-narrow: 720px;
  --w-read:   860px;
  --w-wide:   1200px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(201, 165, 116, 0.28); color: var(--fg); }

img, canvas, svg { display: block; max-width: 100%; }

.mono { font-family: var(--f-mono); font-size: 0.78em; letter-spacing: 0.02em; }

a { color: var(--fg); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--brass); }

code {
  font-family: var(--f-mono);
  font-size: 0.86em;
  padding: 1px 6px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--brass);
}

/* skip link */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--fg); color: var(--bg);
  padding: 8px 12px; border-radius: 6px; z-index: 9999;
}
.skip:focus { left: 12px; top: 12px; }

/* focus ring */
:is(a, button, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =========================================================================
   Nav
   ========================================================================= */

.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-6);
  background: linear-gradient(180deg, rgba(11,10,16,0.72) 0%, rgba(11,10,16,0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-serif); font-weight: 500; font-size: 18px;
  text-decoration: none; color: var(--fg);
  letter-spacing: 0.01em;
}
.brand-mark {
  display: inline-grid;
  grid-template-columns: 6px 6px; grid-template-rows: 6px 6px;
  gap: 2px;
}
.brand-mark span {
  display: block; width: 6px; height: 6px; border-radius: 1px;
  background: var(--fg);
  transition: background var(--dur-2) var(--ease);
}
.brand-mark span:nth-child(2) { background: var(--brass); }
.brand-mark span:nth-child(3) { background: var(--steel); }
.brand-mark span:nth-child(4) { background: var(--plum); }
.brand-word { font-style: italic; }
.brand-word .dot { color: var(--brass); font-style: normal; }

.nav-links {
  display: flex; gap: var(--s-6);
  list-style: none; padding: 0; margin: 0;
}
.nav-links a {
  font-size: 14px;
  color: var(--fg-soft);
  text-decoration: none;
  padding: 6px 2px;
  position: relative;
}
.nav-links a::after {
  content: ""; position: absolute;
  left: 50%; bottom: -2px;
  width: 0; height: 1px;
  background: var(--brass);
  transition: width var(--dur-2) var(--ease), left var(--dur-2) var(--ease);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { left: 0; width: 100%; }

@media (max-width: 720px) {
  .nav { padding: 14px 18px; }
  .nav-links { gap: var(--s-4); }
  .nav-links a { font-size: 13px; }
}
@media (max-width: 520px) {
  .nav-links li:nth-child(4) { display: none; }
}

/* =========================================================================
   Hero + Shader gallery
   ========================================================================= */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 0 28px;
  overflow: hidden;
  isolation: isolate;
}
#shader-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: -1;
  /* soften */
  opacity: 0.95;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(11,10,16,0.6) 0%, transparent 60%),
    linear-gradient(180deg, rgba(11,10,16,0.2) 0%, rgba(11,10,16,0.0) 30%, rgba(11,10,16,0.7) 100%);
  z-index: -1;
  pointer-events: none;
}

.hero-inner {
  max-width: var(--w-wide);
  margin: 0 auto;
  width: 100%;
  padding: 140px 0 160px;
}
.hero-meta {
  display: flex; gap: var(--s-6); flex-wrap: wrap;
  color: var(--fg-mute);
  margin-bottom: var(--s-10);
  letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 11px;
}
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
}
.kicker::before {
  content: ""; width: 6px; height: 6px; background: var(--brass); border-radius: 50%;
}
.kicker.mono::before { background: var(--steel); }

.hero-title {
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: clamp(48px, 9vw, 128px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-8);
  color: var(--fg);
}
.hero-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--brass);
}
.hero-line {
  display: block;
}
.hero-line:nth-child(2) { padding-left: clamp(20px, 6vw, 120px); }

.hero-sub {
  max-width: var(--w-read);
  font-size: clamp(16px, 1.6vw, 20px);
  color: var(--fg-soft);
  line-height: 1.6;
  margin: 0 0 var(--s-10);
}
.hero-sub strong { color: var(--fg); font-weight: 600; }

.hero-actions {
  display: flex; gap: var(--s-3); flex-wrap: wrap;
  margin-bottom: var(--s-16);
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-sans);
  font-size: 14px; font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--r-full);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
  cursor: pointer;
}
.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover { background: var(--brass); color: var(--bg); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  border-color: var(--border-hi);
  color: var(--fg);
}
.btn-ghost:hover { border-color: var(--fg); transform: translateY(-1px); }

.shader-hint {
  color: var(--fg-dim);
  display: inline-flex; align-items: center; gap: 10px;
}
.shader-hint::before {
  content: ""; width: 18px; height: 1px; background: var(--fg-dim);
}

/* shader switcher — bottom rail */
.shader-switcher {
  position: absolute;
  left: 28px; right: 28px; bottom: 28px;
  max-width: var(--w-wide); margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-2);
  padding: 6px;
  border-radius: var(--r-4);
  background: rgba(11, 10, 16, 0.5);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.sw {
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 2px;
  padding: 10px 14px;
  border-radius: var(--r-3);
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-soft);
  cursor: pointer;
  transition: all var(--dur-1) var(--ease);
  text-align: left;
}
.sw:hover { background: rgba(232, 227, 213, 0.04); color: var(--fg); }
.sw[aria-selected="true"] {
  background: rgba(232, 227, 213, 0.08);
  border-color: var(--border-hi);
  color: var(--fg);
}
.sw-n { color: var(--fg-dim); font-size: 10px; }
.sw-name { font-size: 13px; font-weight: 500; letter-spacing: 0.01em; }

@media (max-width: 820px) {
  .shader-switcher { grid-template-columns: repeat(5, 1fr); gap: 2px; }
  .sw { padding: 8px 6px; }
  .sw-name { display: none; }
  .sw-n { font-size: 11px; }
  .sw[aria-selected="true"] .sw-n { color: var(--brass); }
}

/* =========================================================================
   Sections
   ========================================================================= */

.sec {
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: var(--s-32) 28px;
  border-top: 1px solid var(--border);
}
.sec-head {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--s-6);
  row-gap: var(--s-3);
  align-items: baseline;
  margin-bottom: var(--s-12);
}
.sec-num {
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  align-self: center;
}
.sec-title {
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
}
.sec-title::after {
  /* the period as an accent */
  content: ""; display: inline-block;
}
.sec-sub {
  grid-column: 2;
  color: var(--fg-mute);
  max-width: var(--w-read);
  margin: 0;
  font-size: 15px;
}

@media (max-width: 720px) {
  .sec { padding: var(--s-20) 20px; }
  .sec-head { grid-template-columns: 1fr; }
  .sec-sub { grid-column: 1; }
}

/* =========================================================================
   About
   ========================================================================= */

.about-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 2fr;
  gap: var(--s-12);
  align-items: start;
}
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; gap: var(--s-8); } }

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-8);
  position: relative;
}
.about-card::before {
  content: ""; position: absolute;
  top: 12px; right: 12px;
  width: 8px; height: 8px; background: var(--brass); border-radius: 50%;
  box-shadow: 0 0 12px var(--brass);
}

.about-meta { margin: 0; display: grid; gap: var(--s-4); }
.about-meta div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px dashed var(--border);
}
.about-meta div:last-child { border-bottom: 0; padding-bottom: 0; }
.about-meta dt {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 3px;
}
.about-meta dd {
  margin: 0;
  font-family: var(--f-serif);
  font-size: 17px;
  color: var(--fg);
  letter-spacing: 0.01em;
}
.about-meta .slash { color: var(--brass); margin: 0 4px; font-style: italic; }

.about-body { max-width: var(--w-read); }
.about-body .lede {
  font-family: var(--f-serif);
  font-weight: 300;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.35;
  color: var(--fg);
  margin: 0 0 var(--s-6);
  letter-spacing: -0.01em;
}
.about-body .lede em { color: var(--brass); font-style: italic; font-weight: 500; }
.about-body p {
  font-size: 16px;
  color: var(--fg-soft);
  margin: 0 0 var(--s-6);
}
.about-tags {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  list-style: none; padding: 0; margin: 0;
}
.about-tags li {
  padding: 6px 12px;
  border: 1px solid var(--border-hi);
  border-radius: var(--r-full);
  color: var(--fg-soft);
  font-size: 11px;
  letter-spacing: 0.05em;
}

/* =========================================================================
   Novels
   ========================================================================= */

.novels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s-6);
}

.novel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-8);
  display: flex; flex-direction: column;
  gap: var(--s-4);
  transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.novel::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(201,165,116,0.08) 0%, transparent 50%);
  pointer-events: none; opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
}
.novel:hover {
  transform: translateY(-3px);
  border-color: var(--border-hi);
  background: var(--bg-lift);
}
.novel:hover::before { opacity: 1; }
.novel header { display: flex; flex-direction: column; gap: var(--s-2); }
.novel-status {
  color: var(--brass);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 10px;
}
.novel-title {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg);
}
.novel-logline {
  font-family: var(--f-serif);
  font-size: 16px;
  color: var(--fg-soft);
  line-height: 1.55;
  font-style: italic;
  margin: 0;
}
.novel-tags {
  list-style: none; padding: 0; margin: auto 0 0;
  display: flex; gap: var(--s-2); flex-wrap: wrap;
  color: var(--fg-mute);
}
.novel-tags li::before { content: "·"; margin-right: 6px; color: var(--fg-dim); }
.novel-tags li:first-child::before { display: none; }

.novel-ghost {
  background: transparent;
  border: 1px dashed var(--border-hi);
}
.novel-ghost .novel-title { color: var(--fg-mute); font-style: italic; }
.novel-ghost .novel-status { color: var(--fg-dim); }

/* =========================================================================
   Text Lab
   ========================================================================= */

.lab .sec-sub code {
  color: var(--fg);
  background: var(--bg-lift);
}

.lab-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  min-height: 480px;
}
@media (max-width: 900px) { .lab-shell { grid-template-columns: 1fr; } }

.lab-pane {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.lab-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-inset);
}
.lab-label { color: var(--fg-dim); }
.lab-btn {
  background: transparent;
  border: 1px solid var(--border-hi);
  color: var(--fg-soft);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-family: var(--f-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--dur-1) var(--ease);
}
.lab-btn:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.lab-count { color: var(--brass); }

#lab-editor {
  flex: 1;
  width: 100%;
  resize: vertical;
  min-height: 380px;
  padding: 24px 22px;
  background: transparent;
  border: 0;
  color: var(--fg-soft);
  font-family: var(--f-serif);
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.005em;
  outline: none;
  caret-color: var(--brass);
}
#lab-editor:focus { color: var(--fg); }

.lab-render {
  flex: 1;
  padding: 24px 22px;
  font-family: var(--f-serif);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: 0.005em;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  min-height: 380px;
}

/* =========================================================================
   Text FX — one class per keyword, safely attached via DOM, never innerHTML
   ========================================================================= */

.fx {
  position: relative;
  display: inline-block;
  padding: 0 2px;
  white-space: pre-wrap;
  vertical-align: baseline;
}
.fx-p {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  --i: 0;
}

/* fire — 불 */
.fx-fire {
  background: linear-gradient(0deg, #ffdd6b 0%, #ff8f2b 45%, #d84a1e 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 6px rgba(255, 120, 40, 0.45));
  animation: fx-fire-flicker 0.55s infinite alternate ease-in-out;
}
@keyframes fx-fire-flicker {
  0%   { filter: drop-shadow(0 0 4px rgba(255,110,30,0.35)) brightness(0.95); }
  100% { filter: drop-shadow(0 0 14px rgba(255,190,70,0.75)) brightness(1.15); }
}
.fx-fire .fx-p {
  width: 3px; height: 3px;
  background: #ffc266;
  box-shadow: 0 0 6px #ff7a2b;
  left: calc(15% + var(--i) * 22%);
  bottom: 2px;
  animation: fx-ember-rise 1.6s ease-in infinite;
  animation-delay: calc(var(--i) * -0.35s);
}
@keyframes fx-ember-rise {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(calc((var(--i) - 1.5) * 8px), -34px) scale(0.2); opacity: 0; }
}

/* smoke — 연기 */
.fx-smoke {
  color: #b5ada0;
  filter: blur(0.3px);
  animation: fx-smoke-breathe 2.4s ease-in-out infinite alternate;
}
@keyframes fx-smoke-breathe {
  0%   { transform: translateY(0);    letter-spacing: 0.01em; filter: blur(0.3px) brightness(0.9); }
  100% { transform: translateY(-1px); letter-spacing: 0.08em; filter: blur(0.7px) brightness(1.05); }
}
.fx-smoke .fx-p {
  width: 8px; height: 8px;
  background: radial-gradient(circle, rgba(180,170,160,0.7), transparent 70%);
  filter: blur(3px);
  left: calc(10% + var(--i) * 22%);
  top: 0;
  animation: fx-smoke-rise 3s ease-out infinite;
  animation-delay: calc(var(--i) * -0.75s);
}
@keyframes fx-smoke-rise {
  0%   { transform: translate(0, 10px) scale(0.6); opacity: 0; }
  30%  { opacity: 0.55; }
  100% { transform: translate(calc((var(--i) - 1.5) * 6px), -44px) scale(2.2); opacity: 0; }
}

/* metal — 금속 */
.fx-metal {
  background: linear-gradient(100deg,
    #6b6b76 0%, #d4d0c4 35%, #f6f1e0 48%, #c6a878 52%, #d4d0c4 65%, #6b6b76 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: fx-metal-sweep 3.4s linear infinite;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.3));
}
@keyframes fx-metal-sweep {
  0%   { background-position: 220% 0; }
  100% { background-position: -120% 0; }
}

/* wind — 바람 */
.fx-wind {
  color: #c3d6ea;
  animation: fx-wind-sway 2.2s ease-in-out infinite;
}
@keyframes fx-wind-sway {
  0%, 100% { transform: translateX(0);  letter-spacing: 0.01em; }
  50%      { transform: translateX(2px); letter-spacing: 0.12em; }
}
.fx-wind .fx-p {
  background: transparent;
  border-radius: 0;
  width: 22px; height: 1px;
  border-top: 1px solid rgba(195, 214, 234, 0.7);
  left: 0;
  top: calc(18% + var(--i) * 20%);
  animation: fx-wind-streak 1.4s linear infinite;
  animation-delay: calc(var(--i) * -0.3s);
}
@keyframes fx-wind-streak {
  0%   { transform: translateX(-28px); opacity: 0; }
  30%  { opacity: 0.8; }
  100% { transform: translateX(calc(100% + 30px)); opacity: 0; }
}

/* water — 물 */
.fx-water {
  color: #7ab4d6;
  text-shadow: 0 0 6px rgba(122, 180, 214, 0.35);
  animation: fx-water-wave 2.4s ease-in-out infinite;
}
@keyframes fx-water-wave {
  0%,100% { transform: translateY(0); }
  25%     { transform: translateY(-2px); }
  75%     { transform: translateY(2px); }
}
.fx-water .fx-p {
  width: 4px; height: 4px;
  background: #7ab4d6;
  box-shadow: 0 0 6px #7ab4d6;
  left: calc(18% + var(--i) * 22%);
  top: -4px;
  animation: fx-water-drop 2.1s ease-in infinite;
  animation-delay: calc(var(--i) * -0.5s);
}
@keyframes fx-water-drop {
  0%   { transform: translateY(-6px) scale(0.6); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(26px) scale(1.4); opacity: 0; }
}

/* ice / frost */
.fx-ice, .fx-frost {
  color: #b8e6f2;
  text-shadow: 0 0 4px rgba(165, 229, 240, 0.55), 0 0 12px rgba(120, 200, 230, 0.25);
  animation: fx-ice-shimmer 2.6s ease-in-out infinite alternate;
}
@keyframes fx-ice-shimmer {
  0%   { filter: brightness(0.9) saturate(0.9); }
  100% { filter: brightness(1.2) saturate(1.1); }
}
.fx-ice .fx-p, .fx-frost .fx-p {
  width: 2px; height: 2px;
  background: #dffafc;
  box-shadow: 0 0 4px #b8e6f2;
  left: calc(20% + var(--i) * 22%);
  top: 30%;
  animation: fx-ice-glint 2s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.6s);
}
@keyframes fx-ice-glint {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50%      { opacity: 1; transform: scale(1.6); }
}

/* lightning — 번개 */
.fx-lightning {
  color: #fff6a8;
  text-shadow:
    0 0 2px #ffffff,
    0 0 8px #ffd93d,
    0 0 18px #ff9f1c;
  animation: fx-light-flash 1.2s steps(6, end) infinite;
}
@keyframes fx-light-flash {
  0%, 70%  { filter: brightness(1); }
  72%      { filter: brightness(2.2) hue-rotate(-15deg); }
  74%      { filter: brightness(0.8); }
  76%      { filter: brightness(2.6); }
  78%,100% { filter: brightness(1); }
}

/* ember — 불씨 */
.fx-ember {
  color: #e27d4a;
  text-shadow: 0 0 6px rgba(216, 67, 21, 0.6);
  animation: fx-fire-flicker 0.85s infinite alternate;
}

/* spark / glow — secondary */
.fx-spark { color: #fff6a8; animation: fx-light-flash 1.4s steps(6, end) infinite; }
.fx-glow  { color: #f5d470; text-shadow: 0 0 10px rgba(245, 212, 112, 0.6); animation: fx-ice-shimmer 3s ease-in-out infinite alternate; }
.fx-mist  { color: #b5c7c9; filter: blur(0.4px); animation: fx-smoke-breathe 3s ease-in-out infinite alternate; }

/* =========================================================================
   Works
   ========================================================================= */

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s-4);
}

.work {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-8);
  display: flex; flex-direction: column; gap: var(--s-3);
  transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
  position: relative; overflow: hidden;
}
.work:hover { transform: translateY(-2px); border-color: var(--border-hi); }
.work-feature { grid-column: span 1; background: linear-gradient(160deg, var(--bg-card), var(--bg-lift)); }
.work-tag {
  color: var(--steel);
  letter-spacing: 0.12em;
  font-size: 10px;
  text-transform: uppercase;
}
.work-feature .work-tag { color: var(--brass); }
.work-title {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 0;
}
.work-desc {
  color: var(--fg-soft);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}
.work-stack {
  list-style: none; padding: 0; margin: auto 0 0;
  display: flex; gap: var(--s-2); flex-wrap: wrap;
  color: var(--fg-mute);
}
.work-stack li {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 0.06em;
}

/* =========================================================================
   Contact + Footer
   ========================================================================= */

.contact-body {
  max-width: var(--w-read);
  display: flex; flex-direction: column; gap: var(--s-8);
}
.contact-lede {
  font-family: var(--f-serif);
  font-size: clamp(20px, 2.2vw, 28px);
  color: var(--fg);
  line-height: 1.45;
  margin: 0;
  font-weight: 300;
}
.contact-mail {
  font-size: clamp(24px, 4vw, 44px);
  color: var(--brass);
  text-decoration: none;
  letter-spacing: -0.01em;
  padding: var(--s-3) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: color var(--dur-1) var(--ease), letter-spacing var(--dur-2) var(--ease);
  word-break: break-all;
}
.contact-mail:hover { color: var(--fg); letter-spacing: 0.01em; }

.foot {
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: var(--s-8) 28px var(--s-10);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
  color: var(--fg-dim);
}
.foot-right { color: var(--fg-mute); }

/* =========================================================================
   Reveal
   ========================================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
[data-reveal].in {
  opacity: 1; transform: none;
}
