/* ===== Tokens ===== */
:root {
  --bg: #06080d;
  --bg-2: #0a0e16;
  --surface: #0f141f;
  --surface-2: #131a27;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);

  --text: #eaf0fb;
  --text-dim: #9aa6bd;
  --text-mute: #647189;

  --accent: #2f6bff;
  --accent-bright: #5e93ff;
  --accent-cyan: #34e0ff;
  --glow: rgba(47, 107, 255, 0.55);

  --maxw: 1120px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--nav-h);
}
body {
  font-family:
    "Pretendard",
    "Pretendard Variable",
    -apple-system,
    system-ui,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
}
::selection {
  background: var(--accent);
  color: #fff;
}

/* ===== Ambient background ===== */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
#bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}
.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(74px);
  will-change: transform;
}
.orb--1 {
  width: 640px;
  height: 640px;
  margin-left: -320px;
  top: -14%;
  left: 50%;
  background: radial-gradient(circle, rgba(47, 107, 255, 0.3), transparent 68%);
  opacity: 0.7;
  animation: drift1 32s ease-in-out infinite;
}
.orb--2 {
  width: 520px;
  height: 520px;
  top: 36%;
  left: -9%;
  background: radial-gradient(circle, rgba(52, 224, 255, 0.2), transparent 68%);
  opacity: 0.5;
  animation: drift2 41s ease-in-out infinite;
}
.orb--3 {
  width: 580px;
  height: 580px;
  top: 66%;
  right: -11%;
  background: radial-gradient(circle, rgba(47, 107, 255, 0.24), transparent 68%);
  opacity: 0.55;
  animation: drift3 37s ease-in-out infinite;
}
@keyframes drift1 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(36px, 48px);
  }
}
@keyframes drift2 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(58px, -38px);
  }
}
@keyframes drift3 {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-48px, -52px);
  }
}

/* content sits above the ambient layer */
#top {
  position: relative;
  z-index: 1;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition:
    background 0.35s var(--ease),
    border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(6, 8, 13, 0.72);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__logo {
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
}
.nav__logo span {
  color: var(--accent-bright);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav__links a {
  font-size: 0.92rem;
  color: var(--text-dim);
  font-weight: 500;
  transition: color 0.2s;
}
.nav__links a:hover {
  color: var(--text);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 110px 24px 250px;
  overflow: hidden;
  background: transparent;
}
.hero__glow {
  position: absolute;
  top: -18%;
  left: 50%;
  transform: translate(-50%, 0);
  width: 900px;
  height: 900px;
  max-width: 130vw;
  background: radial-gradient(circle, var(--glow) 0%, transparent 62%);
  filter: blur(30px);
  opacity: 0.28;
  pointer-events: none;
  will-change: transform;
}
.ambient__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}
.hero__content {
  position: relative;
  z-index: 2;
  max-width: 860px;
}
.hero__eyebrow {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--accent-cyan);
  margin-bottom: 26px;
}
.hero__title {
  font-size: clamp(2.7rem, 8vw, 5.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin-bottom: 30px;
}
.hero__title .accent {
  background: linear-gradient(120deg, var(--accent-bright), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px var(--glow);
}
.hero__sub {
  font-size: clamp(0.9rem, 2.3vw, 1.2rem);
  color: var(--text-dim);
  margin-bottom: 40px;
  word-break: keep-all;
}
.hero__domains {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  color: var(--text-mute);
}
.hero__domains span {
  color: var(--accent);
  margin: 0 4px;
}
.hero__sketch {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}
.sketch {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.sketch__ink {
  color: #9cacc2;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.68;
}
.sketch__solid {
  fill: #090e17;
}
.sketch__glass {
  fill: #162333;
  stroke: #91afce;
}
.sketch__blue {
  stroke: #76b5db;
}
.sketch__gold {
  stroke: #c3b181;
}
.sketch__orange {
  stroke: #eaa064;
}
.sketch__red {
  stroke: #df8086;
}
.sketch__mint {
  stroke: #7fc7ab;
}
.sketch__city {
  opacity: 0.55;
}
.sketch__layer {
  transform-box: fill-box;
  transform-origin: center bottom;
}
.street__motion {
  transition: transform 0.18s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .street__motion {
    transition: none;
  }
}
@media (max-width: 600px) {
  .hero {
    padding: 100px 20px 190px;
  }
  .sketch__ink {
    stroke-width: 2.1;
    opacity: 0.74;
  }
  .hero__domains {
    font-size: 0.66rem;
    letter-spacing: 0.22em;
  }
}
@media (max-height: 650px) and (min-width: 601px) {
  .hero {
    padding-top: 100px;
    padding-bottom: 190px;
  }
}
.hero__scroll {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 26px;
  height: 42px;
  border: 2px solid var(--line-2);
  border-radius: 16px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.hero__scroll span {
  width: 4px;
  height: 8px;
  border-radius: 4px;
  background: var(--accent-bright);
  animation: scrolldot 1.7s var(--ease) infinite;
}
@keyframes scrolldot {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ===== Stats ===== */
.stats {
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}
.stats__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat {
  text-align: center;
  position: relative;
}
.stat:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -12px;
  top: 12%;
  height: 76%;
  width: 1px;
  background: var(--line);
}
.stat__num {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  background: linear-gradient(120deg, #fff, var(--accent-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label {
  color: var(--text-mute);
  font-size: 0.92rem;
  margin-top: 8px;
}

/* ===== Section base ===== */
.section {
  padding: clamp(80px, 12vw, 140px) 24px;
}
.section--alt {
  background: rgba(255, 255, 255, 0.018);
  border-block: 1px solid var(--line);
}
.section__inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.section__head {
  max-width: 720px;
  margin-bottom: 64px;
}
.section__eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}
.section__title {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.18;
}
.section__desc {
  margin-top: 18px;
  color: var(--text-dim);
  font-size: 1.08rem;
}

/* ===== Tech (sticky rail) ===== */
.tech__grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 64px;
  align-items: start;
}

.tech__rail {
  position: sticky;
  top: calc(var(--nav-h) + 48px);
}
.rail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 22px;
}
.rail::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--line);
}
.rail::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 2px;
  height: calc((100% - 20px) * var(--rail-progress, 0));
  background: linear-gradient(var(--accent), var(--accent-cyan));
  transition: height 0.4s var(--ease);
}
.rail__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  cursor: default;
  opacity: 0.5;
  transition: opacity 0.3s var(--ease);
}
.rail__item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-2);
  transition: all 0.3s var(--ease);
}
.rail__item.is-active {
  opacity: 1;
}
.rail__item.is-active::before {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan);
}
.rail__num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}
.rail__item.is-active .rail__num {
  color: var(--accent-cyan);
}
.rail__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.rail__text b {
  font-size: 1.02rem;
  font-weight: 700;
}
.rail__text i {
  font-style: normal;
  font-size: 0.82rem;
  color: var(--text-mute);
}

.tech__panels {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 8vw, 88px);
}
.panel {
  scroll-margin-top: calc(var(--nav-h) + 40px);
  padding: 36px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.panel__head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.panel__num {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-cyan);
  border: 1px solid rgba(52, 224, 255, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
}
.panel__name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.panel__tag {
  color: var(--text-mute);
  font-size: 0.92rem;
}
.panel__headline {
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  line-height: 1.4;
}
.panel__headline::after {
  content: "";
}
.panel__body {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 24px;
}
.panel__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel__list li {
  position: relative;
  padding-left: 24px;
  color: var(--text-dim);
  font-size: 0.98rem;
}
.panel__list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow);
}

/* ===== Clients ===== */
.clients {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 56px;
}
.clients li {
  background: var(--bg-2);
  padding: 30px 14px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.25s,
    background 0.25s;
}
.section--alt .clients li {
  background: var(--bg);
}
.clients li:hover {
  color: var(--text);
  background: var(--surface);
}

/* ===== Cases ===== */
.cases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.case {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s,
    border-color 0.3s;
}
.case:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 60px -26px var(--glow);
  border-color: var(--line-2);
}
.case__visual {
  aspect-ratio: 2 / 1;
  display: grid;
  place-items: center;
  background: #f3f4f6;
}
.case__visual img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.case__body {
  padding: 22px 24px 26px;
}
.case__title {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.case__client {
  color: var(--text-mute);
  font-size: 0.92rem;
}

/* ===== Closing ===== */
.closing {
  position: relative;
  text-align: center;
  padding: clamp(100px, 15vw, 170px) 24px;
  overflow: hidden;
  background: transparent;
}
.closing__glow {
  position: absolute;
  bottom: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 700px;
  max-width: 140vw;
  background: radial-gradient(circle, var(--glow), transparent 60%);
  filter: blur(40px);
  opacity: 0.3;
  pointer-events: none;
}
.closing__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}
.closing__eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: var(--accent-cyan);
  margin-bottom: 20px;
}
.closing__title {
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

/* ===== Footer ===== */
.footer {
  position: relative;
  z-index: 1;
  background: rgba(9, 12, 19, 0.82);
  border-top: 1px solid var(--line);
  padding: 60px 24px 40px;
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.footer__top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.footer__logo {
  font-weight: 600;
  font-size: 1.2rem;
}
.footer__logo span {
  color: var(--accent-bright);
}
.footer__tagline {
  color: var(--text-mute);
  font-size: 0.9rem;
  margin-top: 12px;
  max-width: 320px;
}
.footer__contact {
  color: var(--text-mute);
  font-size: 0.92rem;
  text-align: right;
}
.footer__contact p {
  margin: 4px 0;
}
.footer__contact a {
  color: var(--text-dim);
  transition: color 0.2s;
}
.footer__contact a:hover {
  color: var(--accent-bright);
}
.footer__copy {
  color: var(--text-mute);
  font-size: 0.84rem;
  margin-top: 28px;
}

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .tech__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .tech__rail {
    display: none;
  }
  .cases {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .clients {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 880px) {
  .stats__inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 24px;
  }
  .stat:nth-child(2)::after {
    display: none;
  }
}
@media (max-width: 560px) {
  .br-pc {
    display: none;
  }
  .nav__links {
    gap: 18px;
  }
  .stat:not(:last-child)::after {
    display: none;
  }
  .clients {
    grid-template-columns: 1fr;
  }
  .footer__top {
    flex-direction: column;
  }
  .footer__contact {
    text-align: left;
  }
  .panel {
    padding: 26px 22px;
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero__scroll span,
  .rail::after {
    animation: none;
    transition: none;
  }
  .orb {
    animation: none;
  }
  #bg {
    display: none;
  }
}
