/* ============================================================
   OFFNOISE — baseline-green
   Ported from the React/Tailwind skeleton: same dark ground,
   tight display type, tracked labels, pills, glows. Recolored
   to emerald. Hand-written CSS (no runtime Tailwind → no FOUC).
   ============================================================ */

:root {
  /* neutrals with a faint green bias (never pure grey) */
  --bg: #0A0B0A;
  --bg-deep: #060706;
  --bg-raise: #101210;
  --fg: #E7EBE8;
  --fg-muted: #9BA49E;
  --fg-dim: #757E78;
  --fg-faint: #4D554F;
  --line: rgba(231, 235, 232, 0.08);
  --line-strong: rgba(231, 235, 232, 0.18);

  /* one accent, used with discipline */
  --accent: #22C55E;
  --accent-2: #34D399;
  --accent-3: #A7F3D0;
  --accent-soft: rgba(34, 197, 94, 0.14);
  --accent-glow: rgba(34, 197, 94, 0.22);

  --font-display: 'Space Grotesk', 'Gothic A1', system-ui, -apple-system, sans-serif;
  --font-body: 'Gothic A1', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, 'Gothic A1', monospace;

  --gutter: clamp(1.5rem, 6vw, 6rem);
  --container: 1800px;
  --nav-h: 5.5rem;

  --ease-out: cubic-bezier(0.2, 1, 0.3, 1);
  --dur: 0.9s;

  color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
h1, h2, h3, h4, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }
canvas { display: block; }
::selection { background: rgba(34, 197, 94, 0.35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}
.skip {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 100;
  padding: 0.6rem 1rem; background: var(--accent); color: #05140A;
  font-weight: 700; font-size: 0.875rem; border-radius: 999px;
  transform: translateY(-200%); transition: transform 0.2s;
}
.skip:focus-visible { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* ---------- primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.br-wide { display: none; }
@media (min-width: 1024px) { .br-wide { display: inline; } }

.label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}
.label--accent { color: var(--accent); margin-bottom: 1rem; }

.kicker {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker--boxed {
  border: 1px solid rgba(34, 197, 94, 0.32);
  padding: 0.4rem 0.9rem 0.4rem 1.05rem; /* extra left compensates tracking */
  border-radius: 3px;
}
@media (max-width: 639px) {
  .kicker { letter-spacing: 0.3em; }
  .kicker--boxed { padding: 0.4rem 0.75rem 0.4rem 0.95rem; }
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.mono--accent { color: var(--accent); }

.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.75rem, 5vw, 6.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: #fff;
  text-wrap: balance;
}
.display--sm { font-size: clamp(2.25rem, 4.4vw, 5rem); }
.display__dim { color: var(--fg-dim); }

.grad-text, .hero__line--grad {
  background: linear-gradient(90deg, var(--accent-2) 0%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.pill--ghost { border: 1px solid var(--line-strong); color: var(--fg); }
.pill--ghost:hover { background: var(--fg); color: #05140A; border-color: var(--fg); }
.pill--solid { background: var(--fg); color: #05140A; padding: 0.85rem 2rem; font-size: 0.8125rem; }
.pill--solid:hover { background: #fff; box-shadow: 0 0 0 6px var(--accent-soft); }

/* ---------- reveal (IntersectionObserver-driven slide-up) ----------
   Only hidden when JS has taken over AND motion is allowed.
   Without JS / with reduced motion the page is fully visible at rest. */
.reveal { --delay: 0s; }
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity var(--dur) var(--ease-out) var(--delay), transform var(--dur) var(--ease-out) var(--delay);
    will-change: opacity, transform;
  }
  html.js .reveal.is-in { opacity: 1; transform: none; will-change: auto; }
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding-block: 2rem;
  transition: padding 0.6s var(--ease-out), background-color 0.6s, border-color 0.6s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding-block: 1rem;
  background: rgba(10, 11, 10, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.nav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.05em;
  color: var(--fg);
  position: relative; z-index: 60;
}
.nav__links { display: none; gap: 3rem; }
.nav__links a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg);
  transition: color 0.3s;
}
.nav__links a:hover { color: var(--accent); }
.nav__actions { display: flex; align-items: center; gap: 1.25rem; position: relative; z-index: 60; }
.nav__cta { display: none; }
.nav__toggle { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; color: var(--fg); }
.nav__icon--close { display: none; }
.nav__toggle[aria-expanded="true"] .nav__icon--open { display: none; }
.nav__toggle[aria-expanded="true"] .nav__icon--close { display: block; }
@media (min-width: 640px) { .nav__cta { display: inline-flex; } }
@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__toggle { display: none; }
}

.menu {
  position: fixed; inset: 0; z-index: 40;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  opacity: 1; transform: none;
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.menu[hidden] { display: flex; opacity: 0; transform: translateY(-2.5rem); pointer-events: none; visibility: hidden; }
.menu__links { display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.menu__links a:not(.pill) {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  transition: color 0.3s;
}
.menu__links a:not(.pill):hover { color: var(--accent); }
.menu__cta { margin-top: 1.5rem; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--bg);
  /* static fallback ground when no canvas is running */
  background-image:
    radial-gradient(60% 55% at 72% 38%, rgba(34, 197, 94, 0.22), transparent 70%),
    radial-gradient(45% 45% at 30% 80%, rgba(52, 211, 153, 0.10), transparent 70%);
  touch-action: pan-y;
  cursor: crosshair;
  display: flex; align-items: center;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.hero__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hero__shade {
  position: absolute; inset: 0; pointer-events: none;
  /* a dark stage behind the type (keeps AA contrast over the brightest smoke),
     a soft top fade under the nav, and a fade into the next section */
  background:
    radial-gradient(56% 46% at 40% 50%, rgba(10, 11, 10, 0.78) 0%, rgba(10, 11, 10, 0.58) 50%, rgba(10, 11, 10, 0.2) 82%, rgba(10, 11, 10, 0) 100%),
    linear-gradient(180deg, rgba(10, 11, 10, 0.5) 0%, rgba(10, 11, 10, 0) 22%, rgba(6, 7, 6, 0) 74%, var(--bg-deep) 100%);
}
@media (max-width: 767px) {
  /* portrait: keep the stage tight around the title so the smoke stays visible above and below */
  .hero__shade {
    background:
      radial-gradient(76% 27% at 50% 51%, rgba(10, 11, 10, 0.86) 0%, rgba(10, 11, 10, 0.68) 50%, rgba(10, 11, 10, 0.24) 82%, rgba(10, 11, 10, 0) 100%),
      linear-gradient(180deg, rgba(10, 11, 10, 0.5) 0%, rgba(10, 11, 10, 0) 18%, rgba(6, 7, 6, 0) 82%, var(--bg-deep) 100%);
  }
}
.hero__content {
  position: relative; z-index: 2;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: calc(var(--nav-h) + 3rem) var(--gutter) 8rem;
  pointer-events: none;
}
.hero__kicker { margin-bottom: 2rem; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 9.4vw, 9.5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: #fff;
  max-width: 14ch;
}
@media (max-width: 639px) {
  /* one sentence per line: 11.5vw keeps '노이즈를 끕니다.' inside the gutters from 320px up */
  .hero__title { font-size: clamp(2.25rem, 11.5vw, 3.25rem); max-width: none; }
}
.hero__line { display: block; }
.hero__line--grad { padding-bottom: 0.08em; /* keep descenders inside the clip box */ }

.hero__hint {
  position: absolute; z-index: 2;
  left: var(--gutter); bottom: 2.75rem;
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-muted);
  pointer-events: none;
}
.hero__hint-dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.4s ease-out infinite;
}
.hero__hint-word--touch, .hero__hint-word--off { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hero__hint-word--pointer { display: none; }
  .hero__hint-word--touch { display: inline; }
  .hero { cursor: default; }
}
/* noise fully off: the hint confirms it */
.hero.is-off .hero__hint { color: var(--accent); }
.hero.is-off .hero__hint-word--pointer, .hero.is-off .hero__hint-word--touch { display: none; }
.hero.is-off .hero__hint-word--off { display: inline; }
.hero.is-off .hero__hint-dot { background: var(--accent); animation: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.hero__kicker { transition: border-color 0.5s, background-color 0.5s; }
.hero.is-off .hero__kicker { border-color: var(--accent); background: rgba(34, 197, 94, 0.08); }
.hero__hint, .hero__hint-dot { transition: color 0.4s, background-color 0.4s, box-shadow 0.4s; }

.hero__scroll {
  position: absolute; z-index: 2;
  left: 50%; bottom: 2.75rem;
  transform: translateX(-50%);
  color: var(--fg-dim);
  padding: 0.5rem;
  animation: bounce 1.6s infinite;
  transition: color 0.3s;
}
.hero__scroll:hover { color: var(--accent); }
@media (max-width: 639px) { .hero__scroll { left: auto; right: var(--gutter); transform: none; } }

/* entrance — fill mode keeps the end state, reduced-motion disables it */
.hero__kicker, .hero__title { animation: slide-up 0.9s var(--ease-out) both; }
.hero__title { animation-delay: 0.12s; }
.hero__hint { animation: fade-in 1.2s ease-out 0.9s both; }

@keyframes slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: translateX(-50%) translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}
@media (max-width: 639px) {
  @keyframes bounce {
    0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
    50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
  }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---------- manifesto ---------- */
.manifesto {
  background: var(--bg-deep);
  padding-block: clamp(6rem, 12vw, 10rem);
  border-bottom: 1px solid var(--line);
}
.manifesto__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: start;
}
@media (min-width: 900px) {
  .manifesto__grid { grid-template-columns: 1.2fr 1fr; gap: clamp(3rem, 6vw, 7rem); }
}
p { text-wrap: pretty; }
.lead {
  text-wrap: balance;
  font-size: clamp(1.25rem, 1.75vw, 1.625rem);
  font-weight: 400;
  line-height: 1.55;
  color: var(--fg-muted);
  margin-bottom: 3.5rem;
}
.manifesto__blocks { display: grid; gap: 2.75rem; }
.block p { font-size: 1.125rem; line-height: 1.75; color: var(--fg-muted); max-width: 34rem; }
.statement {
  margin-top: 4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--accent);
}

/* ---------- fields ---------- */
.fields { background: var(--bg); padding-top: clamp(6rem, 12vw, 10rem); }
.fields__head { margin-bottom: clamp(3rem, 6vw, 5rem); }
.fields__list { border-top: 1px solid var(--line); }

.field {
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}
.field__glow {
  position: absolute; inset: -30% -10%;
  pointer-events: none; z-index: -1;
  background: radial-gradient(45% 60% at 78% 50%, var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity 1s var(--ease-out);
}
.field:hover .field__glow, .field:focus-within .field__glow { opacity: 1; }
.field__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem 3rem;
  padding-block: clamp(3.5rem, 7vw, 6.5rem);
  align-items: end;
}
.field__meta { display: flex; gap: 1.5rem; align-items: baseline; }
.field__en { color: var(--fg-dim); }
.field__word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.5rem, 8.2vw, 8.75rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: #fff;
  transition: transform 1s var(--ease-out);
}
.field:hover .field__word { transform: translateX(0.25rem); }
.field__latin { letter-spacing: -0.06em; }
.field__line {
  font-size: clamp(1.0625rem, 1.5vw, 1.375rem);
  line-height: 1.6;
  color: var(--fg-muted);
  max-width: 30rem;
}
@media (min-width: 1024px) {
  .field__inner {
    grid-template-columns: 9.5rem minmax(max-content, 1fr) minmax(14rem, 22rem);
    gap: 3rem;
  }
  .field__meta { flex-direction: column; gap: 0.5rem; align-self: end; padding-bottom: 0.6em; }
  .field__word { white-space: nowrap; }
  .field__line { justify-self: end; padding-bottom: 0.6em; }
}

/* ---------- contact ---------- */
.contact {
  position: relative;
  padding-block: clamp(8rem, 16vw, 14rem);
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}
.contact__glow {
  position: absolute; z-index: -1; inset: 0;
  background: radial-gradient(52% 70% at 88% 50%, rgba(34, 197, 94, 0.16) 0%, rgba(34, 197, 94, 0.07) 40%, rgba(34, 197, 94, 0) 72%);
  pointer-events: none;
}
.contact__mail {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 10vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  color: #fff;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 0.06em;
  text-decoration-skip-ink: none;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.4s, color 0.4s;
}
.contact__mail:hover { color: var(--accent-3); text-decoration-color: var(--accent); }
.contact .label { margin-bottom: 2.5rem; }

/* ---------- footer ---------- */
.footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
}
.footer__inner {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: center; justify-content: space-between;
}
.footer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.04em;
  color: var(--fg);
}
.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
}
