:root {
  color-scheme: light;

  --page-bg: #f4f1ef;
  --text-main: #111111;
  --text-muted: rgba(0, 0, 0, 0.6);

  --footer-bg: #111111;
  --footer-text: #f5f0e8;

  --card-bg: #ffffff;

  --font-headline: "Changa One", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-body: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;

  --radius-card: 12px;

  --shadow-soft: 0 14px 30px rgba(0, 0, 0, 0.16);
  --shadow-subtle: 0 10px 22px rgba(0, 0, 0, 0.12);

  /* Shared layout */
  --container-pad: clamp(1.5rem, 5vw, 4.5rem);
  --header-h: 72px;
}

/* ===================================================== */
/* RESET + BASE                                          */
/* ===================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text-main);
  font-family: var(--font-body);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

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

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===================================================== */
/* UTILITIES                                             */
/* ===================================================== */

.container {
  padding-inline: var(--container-pad);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ===================================================== */
/* SHARED HEADER / NAV                                   */
/* ===================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(244, 241, 239, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.site-header__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.35rem;
}

.site-brand__img {
  height: 30px;
  width: auto;
}

.site-brand__name {
  font-family: var(--font-headline);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.9rem;
  line-height: 1;
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-nav__link {
  position: relative;
  padding-block: 0.2rem;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0;
  height: 1px;
  background: var(--text-main);
  transition: width 0.23s ease;
}

.site-nav__link:hover::after {
  width: 100%;
}

.site-nav__link.is-active::after {
  width: 100%;
}

/* ===================================================== */
/* SHARED FOOTER                                         */
/* ===================================================== */

.site-footer {
  margin-top: auto;
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 3.25rem var(--container-pad) 1.8rem;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.8rem, 4vw, 3rem);
  align-items: flex-start;
}

.site-footer__brand {
  font-family: var(--font-headline);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 1.1rem;
}

.site-footer__subtitle {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.site-footer__text {
  margin: 0.8rem 0 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(245, 240, 232, 0.82);
}

.site-footer__heading {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.site-footer__link {
  display: inline-block;
  font-size: 0.9rem;
  margin-top: 0.1rem;
  position: relative;
}

.site-footer__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 0;
  height: 1px;
  background: var(--footer-text);
  transition: width 0.23s ease;
}

.site-footer__link:hover::after {
  width: 100%;
}

.site-footer__bottom {
  margin-top: 2.25rem;
  border-top: 1px solid rgba(245, 240, 232, 0.16);
  padding-top: 0.9rem;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.75);
}

/* ===================================================== */
/* RESPONSIVE                                            */
/* ===================================================== */

@media (max-width: 960px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-nav {
    gap: 0.9rem;
    font-size: 0.62rem;
  }

  .site-brand__name {
    display: none; /* keep it clean on mobile */
  }
}

/* =========================================
   WARM CRT v2 (NO VISIBLE CIRCLE, HIGH 색수차, NO FLICKER)
   Use: <div class="crt crt--warm">
   ========================================= */

.crt.crt--warm {
  background: #0b0b0b;
  padding: 3.6vh 2.2vw;
}

.crt.crt--warm .crt-screen {
  position: relative;
  border-radius: 36px;
  overflow: hidden;
  background: #f6f2ee;

  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,0.28),
    inset 0 0 140px rgba(0,0,0,0.16),
    0 38px 120px rgba(0,0,0,0.55);

  transform: perspective(1200px) rotateX(1deg) scale(0.985);
  transform-origin: 50% 50%;
}

/* ✅ REMOVE THE “CIRCLE”: do NOT use a big round pseudo element */
.crt.crt--warm .crt-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  /* subtle edge darkening (rectangular, not circular) */
  background:
    linear-gradient(180deg, rgba(0,0,0,0.06), transparent 20%),
    linear-gradient(0deg, rgba(0,0,0,0.08), transparent 26%),
    linear-gradient(90deg, rgba(0,0,0,0.08), transparent 18%),
    linear-gradient(-90deg, rgba(0,0,0,0.08), transparent 18%);

  opacity: 0.9;
  z-index: 6;
}

/* CRT overlays: scanlines + light grille + static grain */
.crt.crt--warm .crt-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background:
    /* scanlines (stronger but still clean) */
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0.14),
      rgba(0,0,0,0.14) 1px,
      transparent 1px,
      transparent 4px
    ),
    /* aperture grille (more visible) */
    repeating-linear-gradient(
      to right,
      rgba(255, 90, 90, 0.040),
      rgba(255, 90, 90, 0.040) 1px,
      rgba(120, 255, 210, 0.028) 1px,
      rgba(120, 255, 210, 0.028) 2px,
      rgba(90, 160, 255, 0.034) 2px,
      rgba(90, 160, 255, 0.034) 3px,
      transparent 3px,
      transparent 6px
    ),
    /* STATIC grain (no fps/flicker) */
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.06), transparent 45%),
    radial-gradient(circle at 80% 60%, rgba(0,0,0,0.05), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(255, 230, 200, 0.04), rgba(0,0,0,0.12) 92%);

  mix-blend-mode: multiply;
  opacity: 0.60;
  z-index: 8;
}

/* warm phosphor balance */
.crt.crt--warm .site {
  position: relative;
  filter: contrast(1.08) brightness(0.975) saturate(0.92);
}

/* =========================================
   HIGH 색수차 (chromatic aberration)
   - apply strongly to headings and UI edges
   - keep body text readable
   ========================================= */

/* Default text: mild (readable) */
.crt.crt--warm .site,
.crt.crt--warm .site p,
.crt.crt--warm .site li,
.crt.crt--warm .site input,
.crt.crt--warm .site textarea,
.crt.crt--warm .site button {
  text-shadow:
    0.8px 0 0 rgba(255, 70, 70, 0.18),
   -0.8px 0 0 rgba(90, 220, 255, 0.14);
}

/* Headlines / nav / big labels: HIGH 색수차 */
.crt.crt--warm .site h1,
.crt.crt--warm .site h2,
.crt.crt--warm .site h3,
.crt.crt--warm .site .hero__tagline,
.crt.crt--warm .site .hero__typing,
.crt.crt--warm .site .site-nav__link,
.crt.crt--warm .site .gb-card__title,
.crt.crt--warm .site .gb-entry__name {
  text-shadow:
    2.8px 0 0 rgba(255, 70, 70, 0.44),
   -2.8px 0 0 rgba(90, 220, 255, 0.36),
    0 0 10px rgba(255, 240, 220, 0.10);
}

/* Edges of cards feel “screened” without scary */
.crt.crt--warm .site .gb-card,
.crt.crt--warm .site .site-header,
.crt.crt--warm .site .site-footer {
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.06),
    0 18px 50px rgba(0,0,0,0.08);
}

/* ✅ NO FLICKER, NO JITTER */
.crt.crt--warm .site::after { content: none !important; }

/* mobile */
@media (max-width: 768px) {
  .crt.crt--warm { padding: 0; }
  .crt.crt--warm .crt-screen {
    border-radius: 0;
    transform: none;
  }
}
