/* ══════════════════════════════════════════════════
   오후네시반 — 우주 테마 홈페이지
   외부 라이브러리·웹폰트 없음. Apache 정적 배포용.
   ══════════════════════════════════════════════════ */

@property --spot-x { syntax: '<percentage>'; inherits: false; initial-value: 50%; }
@property --spot-y { syntax: '<percentage>'; inherits: false; initial-value: 50%; }
@property --ring-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  --space: #06040f;
  --ink: #ede7f8;
  --muted: #a9a1c4;
  --dim: #6f6790;
  --violet: #7c5cff;
  --violet-deep: #3a1f6e;
  --rose: #f1a8a2;
  --gold: #f3c96b;
  --teal: #7fe6e0;

  --font: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif;

  --wrap: 1240px;
  --pad: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--space);
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--space);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

@media (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
}

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

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ── 배경 우주 캔버스 ───────────────────────────── */
#space, #fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}
#fx { z-index: 1; }

/* ── 커스텀 커서 ───────────────────────────────── */
#cursor {
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
  will-change: transform;
}
body.has-cursor #cursor { opacity: 1; }
#cursor .core {
  position: absolute;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px 2px rgba(243, 201, 107, .7);
}
#cursor .halo {
  position: absolute;
  width: 24px; height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  border: 1px solid rgba(243, 201, 107, .55);
  transition: transform .25s var(--ease), border-color .25s, opacity .25s;
}
#cursor.is-hover .halo {
  transform: scale(1.7);
  border-color: rgba(241, 168, 162, .9);
}
#cursor.is-down .halo { transform: scale(.6); }

/* ── 내비게이션 ─────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--pad);
  transition: background .5s, backdrop-filter .5s, padding .5s;
}
.nav.is-scrolled {
  padding: 14px var(--pad);
  background: rgba(6, 4, 15, .55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.nav .brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: 9px;
}
.brand-logo { width: 1.3em; height: 1.3em; flex: none; display: block; }
.nav nav { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav nav a {
  font-size: 17px;
  font-weight: 500;
  color: var(--muted);
  position: relative;
  padding: 6px 2px;
  transition: color .3s;
}
.nav nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--rose));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.nav nav a:hover, .nav nav a.is-active { color: var(--ink); }
.nav nav a:hover::after, .nav nav a.is-active::after { transform: scaleX(1); }

@media (max-width: 640px) {
  .nav { padding: 16px var(--pad); justify-content: center; }
  .nav.is-scrolled { padding: 12px var(--pad); }
  .nav .brand { display: none; }
  .nav nav { gap: 18px; }
  .nav nav a { font-size: 15px; }
}

/* ── 공통 레이아웃 ──────────────────────────────── */
main { position: relative; z-index: 2; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.section {
  position: relative;
  padding: clamp(56px, 7vw, 96px) 0;
}

.section-head { margin-bottom: clamp(28px, 3.5vw, 44px); }

.section-en {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .32em;
  color: var(--gold);
}

.display {
  margin: 0;
  font-size: clamp(38px, 6.2vw, 84px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.025em;
}
.display .row { display: block; }

/* 스크롤에 따른 등장 — 최신 브라우저는 scroll-driven animation,
   구형 브라우저는 IntersectionObserver가 .in 클래스로 처리 */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ── HERO ──────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 120px var(--pad) 80px;
  position: relative;
}
.hero-inner { max-width: 1100px; }

.hero-name {
  margin: 0 0 clamp(20px, 3vw, 36px);
  font-size: clamp(54px, 14vw, 190px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.02em;
  display: flex;
  justify-content: center;
  gap: .02em;
}
.hero-name span {
  display: inline-block;
  background: linear-gradient(180deg, #fff 30%, var(--rose) 75%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(.35em) rotateX(-40deg);
  transform-origin: bottom;
  filter: blur(14px);
  animation: name-in 1.3s var(--ease) forwards;
  animation-delay: calc(.25s + var(--i, 0) * .11s);
  text-shadow: none;
}
.hero-name span:nth-child(1) { --i: 0; }
.hero-name span:nth-child(2) { --i: 1; }
.hero-name span:nth-child(3) { --i: 2; }
.hero-name span:nth-child(4) { --i: 3; }
.hero-name span:nth-child(5) { --i: 4; }

@keyframes name-in {
  to { opacity: 1; transform: none; filter: blur(0); }
}

.hero-line {
  margin: 0 0 clamp(16px, 2vw, 24px);
  font-size: clamp(26px, 3.6vw, 48px);
  font-weight: 700;
  letter-spacing: -.015em;
  opacity: 0;
  animation: fade-up 1.1s var(--ease) 1.05s forwards;
}
.hero-sub {
  margin: 0;
  font-size: clamp(18px, 1.7vw, 23px);
  line-height: 1.75;
  color: var(--muted);
  opacity: 0;
  animation: fade-up 1.1s var(--ease) 1.35s forwards;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

.hero-scroll {
  position: absolute;
  bottom: 34px;
  left: 50%;
  width: 1px;
  height: 64px;
  margin-left: -.5px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
  opacity: 0;
  animation: fade-up 1s var(--ease) 2.1s forwards;
}
.hero-scroll span {
  position: absolute;
  left: 0; top: -40%;
  width: 100%; height: 40%;
  background: linear-gradient(180deg, transparent, var(--gold));
  animation: scroll-drop 2.2s ease-in-out infinite;
}
@keyframes scroll-drop {
  0% { top: -40%; }
  100% { top: 110%; }
}

/* ── ABOUT ─────────────────────────────────────── */
.about .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}
.about-body { font-size: clamp(18px, 1.5vw, 21px); color: var(--muted); }
.about-body p { margin: 0 0 1.4em; }
.about-body p:last-child { margin-bottom: 0; }
.about-lines span {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.05em;
  padding-left: 18px;
  border-left: 2px solid;
  border-image: linear-gradient(180deg, var(--gold), var(--rose), transparent) 1;
}
.about-lines span + span { margin-top: 6px; }

@media (max-width: 900px) {
  .about .wrap { grid-template-columns: 1fr; }
}

/* ── BUSINESS ──────────────────────────────────── */
.biz-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  perspective: 1400px;
}
@media (max-width: 1000px) { .biz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .biz-grid { grid-template-columns: 1fr; } }

.biz-card {
  --spot-x: 50%;
  --spot-y: 50%;
  position: relative;
  aspect-ratio: 4 / 5;
  min-height: 380px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at var(--spot-x) var(--spot-y), rgba(124, 92, 255, .22), transparent 55%),
    linear-gradient(160deg, rgba(58, 31, 110, .5), rgba(6, 4, 15, .82));
  border: 1px solid rgba(255, 255, 255, .07);
  transform-style: preserve-3d;
  transition: transform .5s var(--ease), border-color .5s, box-shadow .5s;
  will-change: transform;
  isolation: isolate;
}
.biz-card::before {
  /* 커서를 따라다니는 테두리 광원 */
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(160px circle at var(--spot-x) var(--spot-y), rgba(243, 201, 107, .95), rgba(241, 168, 162, .35) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .5s;
  z-index: 3;
  pointer-events: none;
}
.biz-card:hover::before, .biz-card:focus-visible::before { opacity: 1; }
.biz-card:hover, .biz-card:focus-visible {
  border-color: rgba(255, 255, 255, .14);
  box-shadow: 0 30px 80px -20px rgba(124, 92, 255, .35);
}

.biz-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: .8;
  transition: opacity .5s;
}
.biz-card:hover .biz-canvas, .biz-card:focus-visible .biz-canvas { opacity: 1; }

.biz-text {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 30px 30px 32px;
  background: linear-gradient(180deg, transparent, rgba(6, 4, 15, .85) 55%);
  transform: translateZ(40px);
}
.biz-text h3 {
  margin: 0 0 10px;
  font-size: clamp(22px, 1.9vw, 27px);
  font-weight: 800;
  letter-spacing: .04em;
  background: linear-gradient(90deg, #fff, var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.biz-text p {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
}

.biz-note {
  margin: clamp(40px, 5vw, 64px) 0 0;
  text-align: center;
  font-size: clamp(24px, 3.2vw, 44px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.02em;
}
.biz-note span { display: block; }
.biz-note span:last-child { color: var(--gold); }

/* ── TECHNOLOGY ────────────────────────────────── */
.constellation {
  position: relative;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: linear-gradient(180deg, rgba(58, 31, 110, .18), rgba(6, 4, 15, .5));
  overflow: hidden;
}
#constellation {
  display: block;
  width: 100%;
  height: clamp(440px, 60vw, 640px);
}
.constellation-flow {
  position: absolute;
  left: 0; right: 0; bottom: 22px;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--dim);
}
.constellation-flow i {
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, var(--dim), var(--gold));
}
@media (max-width: 640px) {
  .constellation-flow { display: none; }
}

/* ── PROJECTS (궤도) ───────────────────────────── */
.orbit {
  --R: min(42vw, 460px);
  --ring-a: 0deg;
  position: relative;
  height: calc(var(--R) * 1.24 + 150px);
  display: grid;
  place-items: center;
}
.orbit::before, .orbit::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  border-radius: 50%;
  translate: -50% -50%;
  pointer-events: none;
}
.orbit::before {
  width: calc(var(--R) * 2);
  height: calc(var(--R) * 2 * .62);
  border: 1px dashed rgba(255, 255, 255, .12);
}
.orbit::after {
  width: calc(var(--R) * 1.15);
  height: calc(var(--R) * 1.15 * .62);
  border: 1px solid rgba(243, 201, 107, .15);
}

.orbit-core {
  position: relative;
  z-index: 2;
  width: min(72vw, 380px);
  text-align: center;
  padding: 40px 28px;
  border-radius: 50%;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  gap: 10px;
  background:
    radial-gradient(circle at 50% 40%, rgba(243, 201, 107, .28), transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(124, 92, 255, .35), rgba(6, 4, 15, .2) 70%);
  box-shadow: 0 0 120px 30px rgba(124, 92, 255, .18), inset 0 0 60px rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
}
.orbit-core-name {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 900;
  letter-spacing: .02em;
}
.orbit-core-desc {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  min-height: 3.2em;
  transition: opacity .3s;
}
.orbit-core-desc.is-swap { opacity: 0; }

.orbit-ring {
  list-style: none;
  margin: 0; padding: 0;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.sat {
  position: absolute;
  left: 50%; top: 50%;
  pointer-events: auto;
  will-change: transform;
}
.sat button {
  transform: translate(-50%, -50%);
  white-space: nowrap;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(6, 4, 15, .6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color .3s, background .3s, box-shadow .3s, scale .3s var(--ease);
}
.sat button::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  flex: none;
}
.sat button:hover, .sat.is-active button {
  border-color: rgba(243, 201, 107, .7);
  background: rgba(58, 31, 110, .75);
  box-shadow: 0 0 30px rgba(243, 201, 107, .25);
  scale: 1.06;
}

/* 좁은 화면: 궤도 대신 목록 */
@media (max-width: 720px) {
  .orbit { height: auto; display: block; }
  .orbit::before, .orbit::after { display: none; }
  .orbit-core { margin: 0 auto 28px; width: min(80vw, 300px); }
  .orbit-ring { position: static; display: grid; gap: 10px; pointer-events: auto; }
  .sat { position: static; }
  .sat button { transform: none; width: 100%; white-space: normal; justify-content: flex-start; border-radius: 18px; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 20px; }
  .sat button::before { display: none; }
  .sat button::after { content: attr(data-desc); font-size: 15px; font-weight: 400; color: var(--muted); line-height: 1.5; text-align: left; }
}

/* ── ETHOS ─────────────────────────────────────── */
.ethos .wrap { text-align: center; }
.ethos .display { margin-bottom: clamp(24px, 3vw, 40px); }
.ethos-body { font-size: clamp(19px, 1.7vw, 24px); color: var(--muted); }
.ethos-body > p { margin: 0 0 1.2em; }
.ethos-chain {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 0;
  margin: 0;
}
.ethos-chain span {
  color: var(--ink);
  font-weight: 700;
  padding: 0 .35em;
  position: relative;
}
.ethos-chain span + span::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin: 0 .55em 0 .1em;
  vertical-align: middle;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

/* ── CTA ───────────────────────────────────────── */
.cta {
  padding-bottom: clamp(60px, 7vw, 100px);
}
.cta .wrap {
  text-align: center;
  padding-top: clamp(24px, 4vw, 56px);
  padding-bottom: clamp(24px, 4vw, 56px);
  position: relative;
}
.cta .wrap::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: min(120vw, 1300px);
  height: 70%;
  translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(243, 201, 107, .12), rgba(124, 92, 255, .08) 45%, transparent 70%);
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
}
.cta-title {
  margin: 0 0 .3em;
  font-size: clamp(48px, 9vw, 130px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -.03em;
  background: linear-gradient(180deg, #fff 30%, var(--rose) 80%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cta-sub {
  margin: 0 0 clamp(28px, 3.5vw, 48px);
  font-size: clamp(20px, 2.2vw, 30px);
  color: var(--muted);
}
.cta-brand {
  margin: 0 0 12px;
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 800;
  letter-spacing: .06em;
}
.cta-mail {
  display: inline-block;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 600;
  color: var(--gold);
  padding: 12px 30px;
  border-radius: 999px;
  border: 1px solid rgba(243, 201, 107, .4);
  transition: background .3s, box-shadow .3s, color .3s;
}
.cta-mail:hover {
  background: rgba(243, 201, 107, .12);
  box-shadow: 0 0 50px rgba(243, 201, 107, .25);
  color: #fff;
}

/* ── FOOTER ────────────────────────────────────── */
.footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px var(--pad) 40px;
  font-size: 15px;
  color: var(--dim);
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.footer p { margin: 0; }
.footer a:hover { color: var(--ink); }

/* ── 모션 최소화 설정 존중 ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-name span, .hero-line, .hero-sub, .hero-scroll { animation: none; opacity: 1; transform: none; filter: none; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .biz-card { transition: none; }
}
