/* ===========================================================
   DREAM-THEATER — Gate (home)
   A split entry in the language of the /mcn/ gateway, one level up:
   App Contents (left) vs Creator Contents (right), two picks each.
   =========================================================== */

:root {
  --bg: #0a0812;
  --fg: #f5f2ea;
  --muted: rgba(245, 242, 234, 0.62);
  --faint: rgba(245, 242, 234, 0.42);
  --line: rgba(245, 242, 234, 0.14);

  /* Side palettes */
  --app-a: #1a140a;
  --app-b: #2a1f0e;
  --app-accent: #c9a96e;

  --cr-a: #070716;
  --cr-b: #0d0b25;
  --cr-accent: #d6ff3a;

  /* Intro loader tint (css/intro.css) */
  --intro-a: #c9a96e;
  --intro-b: #d6ff3a;

  --ease: cubic-bezier(0.6, 0.05, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Space Grotesk', 'Inter', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

:where(a):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Cursor ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 0; height: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  mix-blend-mode: difference;
}
.cursor__ring,
.cursor__dot {
  position: absolute;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
}
.cursor__ring {
  width: 36px; height: 36px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  transition: transform 0.28s var(--ease), background 0.28s var(--ease), border-color 0.28s var(--ease);
}
.cursor__dot {
  width: 5px; height: 5px;
  background: #fff;
  border-radius: 50%;
  transition: opacity 0.2s var(--ease);
}
/* No label inside any more, so the ring closes into a solid blob rather
   than a wide empty circle sized for text. */
.cursor.is-open .cursor__ring { transform: translate(-50%, -50%) scale(1.7); background: #fff; border-color: #fff; }
.cursor.is-open .cursor__dot { opacity: 0; }

@media (hover: none), (pointer: coarse) {
  .cursor { display: none; }
}

/* ---------- Top ---------- */
.gate-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 40px;
  z-index: 40;
  mix-blend-mode: difference;
  color: #fff;
}
.gate-top__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0;
}
.gate-top__logo {
  width: 28px; height: 28px;
  object-fit: contain;
  transition: transform 0.6s var(--ease-out);
}
.gate-top__brand:hover .gate-top__logo { transform: rotate(-8deg) scale(1.08); }
.gate-top__meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  opacity: 0;
}

/* ---------- Split ---------- */
.gate {
  --split-x: 50%;                    /* moves with the parallax band */
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-columns: var(--split-x) 1fr;
  overflow: hidden;
}

.half {
  position: relative;
  overflow: hidden;
  cursor: none;
}

.half__bg {
  position: absolute;
  /* over-scaled so the parallax translate never exposes an edge */
  inset: -6%;
  z-index: 0;
  transition: opacity 0.6s var(--ease);
  will-change: transform;
}
.half--app .half__bg {
  background:
    radial-gradient(1200px 800px at 20% 70%, rgba(201, 169, 110, 0.20), transparent 60%),
    linear-gradient(180deg, var(--app-a) 0%, var(--app-b) 100%);
}
.half--creator .half__bg {
  background:
    radial-gradient(1000px 700px at 80% 30%, rgba(214, 255, 58, 0.15), transparent 60%),
    linear-gradient(180deg, var(--cr-a) 0%, var(--cr-b) 100%);
}

.half__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 100%);
}

/* Dot matrix + sparse starfield, the ground the whole site shares. */
.half__dots {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(245, 242, 234, 0.11) 1.4px, transparent 1.4px),
    radial-gradient(rgba(245, 242, 234, 0.05) 1px, transparent 1px);
  background-position: 17px 23px, 0 0;
  background-size: 137px 137px, 34px 34px;
}

.half__noise {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0.06;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='1'/></svg>");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
}

/* Creator side: grid overlay */
.half__grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    linear-gradient(to right, rgba(214, 255, 58, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(214, 255, 58, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mix-blend-mode: screen;
  pointer-events: none;
}

/* ---------- Half content ---------- */
.half__inner {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  padding: 120px clamp(28px, 4.4vw, 64px) 84px;
  gap: 14px;
}

.half__num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  opacity: 0;
}
.half--app .half__num { color: var(--app-accent); }
.half--creator .half__num { color: var(--cr-accent); }

.half__title {
  margin: 4px 0 0;
  font-size: clamp(40px, 5.6vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: #fff;
}
.half__title .row { display: block; overflow: hidden; }
.half__title .row > * {
  display: inline-block;
  transform: translateY(110%);
  will-change: transform;
}

.half__desc {
  max-width: 34ch;
  margin: 8px 0 0;
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.68);
  opacity: 0;
}

/* ---------- Picks (the two destinations per side) ---------- */
.half__picks {
  width: min(100%, 460px);
  margin-top: clamp(16px, 2.6vh, 34px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
}

.pick {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 4px;
  border-top: 1px solid var(--line);
  transition: padding 0.4s var(--ease-out), border-color 0.4s var(--ease);
}
.pick:last-child { border-bottom: 1px solid var(--line); }
.pick:hover { padding-left: 14px; }
/* Picks open in a new tab, so the page never navigates away — this press
   state is the only feedback it can give on click. */
.pick:active { opacity: 0.72; }
/* A hovered pick lights the rule above AND below it, so the row reads as a
   bounded band. Only the last pick owns a border-bottom, so the rule under
   any other pick is really the border-top of the pick below it — hence the
   sibling selector, which must set border-top-color only (border-color would
   also light that sibling bottom rule and turn on a third line). */
.half--app .pick:hover { border-color: rgba(201, 169, 110, 0.6); }
.half--app .pick:hover + .pick { border-top-color: rgba(201, 169, 110, 0.6); }

.half--creator .pick:hover { border-color: rgba(214, 255, 58, 0.55); }
.half--creator .pick:hover + .pick { border-top-color: rgba(214, 255, 58, 0.55); }

.pick__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pick__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 12px;
}
.pick__name {
  font-family: 'Noto Sans KR', 'Space Grotesk', sans-serif;
  font-size: clamp(16px, 1.5vw, 21px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #fff;
}
.pick__en {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}
.pick__desc {
  font-family: 'Noto Sans KR', 'Inter', sans-serif;
  font-size: clamp(11.5px, 0.95vw, 13.5px);
  font-weight: 300;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.6);
}

.pick__go {
  flex: 0 0 auto;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.4s var(--ease), transform 0.4s var(--ease-out);
}
.pick:hover .pick__go { transform: translateX(6px); }
.half--app .pick:hover .pick__go { color: var(--app-accent); }
.half--creator .pick:hover .pick__go { color: var(--cr-accent); }

/* ---------- Divider ---------- */
.gate__divider {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--split-x);
  width: min(720px, 44vw);
  margin: 0;
  translate: -50% 0;
  z-index: 10;
  pointer-events: none;
  will-change: transform;
  background:
    linear-gradient(90deg,
      transparent 0%,
      transparent calc(50% - 0.5px),
      rgba(255, 255, 255, 0.28) calc(50% - 0.5px),
      rgba(255, 255, 255, 0.28) calc(50% + 0.5px),
      transparent calc(50% + 0.5px),
      transparent 100%),
    radial-gradient(closest-side at 50% 50%,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0.05) 35%,
      rgba(255, 255, 255, 0.015) 60%,
      transparent 78%);
  mix-blend-mode: screen;
  transition: opacity 0.4s var(--ease);
}

/* Hover state: dim the opposite side */
.gate.is-hover-app .half--creator .half__bg { opacity: 0.55; }
.gate.is-hover-creator .half--app .half__bg { opacity: 0.55; }

/* ---------- Bottom ---------- */
.gate-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 40px;
  z-index: 40;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  opacity: 0;
}
.gate-bottom__copy { mix-blend-mode: difference; }

.gate-bottom__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.doc {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: rgba(255, 255, 255, 0.45);
}
.doc a {
  color: rgba(255, 255, 255, 0.68);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.doc a:hover { color: #fff; border-bottom-color: currentColor; }
.doc__sep { margin: 0 4px; color: rgba(255, 255, 255, 0.25); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /* One screen, no scroll: lock to the small viewport where supported so both
     halves and all four picks stay above the fold. */
  html { height: 100%; overflow: hidden; }
  body {
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    height: 100vh; max-height: 100vh;
    height: 100dvh; max-height: 100dvh;
    height: 100svh; max-height: 100svh;
  }

  .gate {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }

  .half {
    flex: 1 1 0;
    min-height: 0;
  }

  .half__inner {
    height: 100%;
    min-height: 0;
    gap: clamp(4px, 0.9vh, 10px);
    padding-left: calc(20px + env(safe-area-inset-left, 0px));
    padding-right: calc(20px + env(safe-area-inset-right, 0px));
    overflow: hidden;
  }
  .half--app .half__inner {
    padding-top: calc(58px + env(safe-area-inset-top, 0px));
    padding-bottom: 8px;
  }
  .half--creator .half__inner {
    padding-top: 10px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }

  .half__num { font-size: 9px; letter-spacing: 0.18em; }
  .half__title { font-size: clamp(24px, 7.6vw, 40px); }
  .half__desc {
    max-width: 100%;
    font-size: 11px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .half__picks { width: 100%; margin-top: clamp(6px, 1.4vh, 14px); }
  .pick { padding: clamp(8px, 1.4vh, 14px) 2px; gap: 10px; }
  .pick__text { gap: 3px; }
  .pick__name { font-size: 14px; }
  .pick__en { font-size: 8px; }
  .pick__desc {
    font-size: 10.5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .pick__go { font-size: 15px; }

  .gate__divider {
    top: 50%;
    left: 0; right: 0;
    width: auto;
    height: 1px;
    translate: 0 -50%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 35%, rgba(255,255,255,0.18) 65%, rgba(255,255,255,0) 100%);
  }

  .gate-top {
    padding: calc(12px + env(safe-area-inset-top, 0px)) calc(18px + env(safe-area-inset-right, 0px)) 12px calc(18px + env(safe-area-inset-left, 0px));
  }
  .gate-top__meta { display: none; }

  .gate-bottom {
    padding: 6px calc(16px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
    font-size: 8px;
    letter-spacing: 0.12em;
    z-index: 45;
  }
  .gate-bottom__legal { gap: 4px 12px; }
  .doc { gap: 5px; }
}

/* Extra-tight: short viewports (landscape phones, small SE) */
@media (max-width: 900px) and (max-height: 640px) {
  .half__desc { display: none; }
  .half__title { font-size: clamp(20px, 6.4vw, 32px); }
  .pick__desc { -webkit-line-clamp: 1; }
  .gate-bottom__legal { display: none; }
}
