/* ==========================================================================
   페그시티 SEO 이해 사이트 — 공용 디자인 시스템
   Theme: 검색되는 우주 (dreamy, professional space)
   Pages 2-5 must reuse these tokens and component classes only.
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  --bg: #050914;
  --panel: rgba(11, 18, 38, 0.7);
  --panel-solid: #0b1226;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-soft: rgba(37, 99, 235, 0.18);
  --text: #e6edf7;
  --muted: #aab6d3;
  --hairline: rgba(147, 164, 196, 0.18);

  --nebula-a: rgba(37, 99, 235, 0.18);
  --nebula-b: rgba(96, 165, 250, 0.10);

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Noto Sans KR", sans-serif;

  --h1: clamp(2.2rem, 5vw, 3.6rem);
  --h2: clamp(1.5rem, 3vw, 2.2rem);
  --h3: clamp(1.15rem, 2vw, 1.35rem);
  --body: 1rem;
  --small: 0.875rem;

  --container: 1120px;
  --section-pad: 96px 24px;
  --radius-card: 16px;
  --radius-pill: 999px;
  --glow-card: 0 0 40px rgba(37, 99, 235, 0.12);

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

/* ---------- 2. Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(147, 164, 196, 0.35) transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.7;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Nebula atmosphere layers, sit behind the JS starfield canvas */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(52% 42% at 18% 8%, var(--nebula-a), transparent 70%),
    radial-gradient(46% 38% at 84% 22%, var(--nebula-b), transparent 70%),
    radial-gradient(60% 50% at 50% 105%, var(--nebula-a), transparent 72%);
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

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

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

ul,
ol {
  list-style: none;
}

/* Everything readable floats above bg layers */
.site-nav,
main,
.site-footer {
  position: relative;
  z-index: 2;
}

h1,
h2,
h3,
h4 {
  letter-spacing: -0.02em;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text);
}

h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); font-weight: 600; }
h3 { font-size: var(--h3); font-weight: 600; }

p {
  color: var(--muted);
  max-width: 68ch;
}

::selection {
  background: rgba(37, 99, 235, 0.45);
  color: #fff;
}

/* Dark thin scrollbar to match the space theme */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(147, 164, 196, 0.35);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(147, 164, 196, 0.55);
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 3. Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding: var(--section-pad);
}

.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head.center .section-lead {
  margin-inline: auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--small);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin-bottom: 16px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-hover);
  box-shadow: 0 0 12px var(--accent-hover);
}

.section-title {
  margin-bottom: 18px;
}

.section-lead {
  font-size: 1.0625rem;
  color: var(--muted);
  word-break: keep-all;
}

.text-accent {
  background: linear-gradient(115deg, #7fb0ff 0%, var(--accent-hover) 55%, #bcd6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 4. Navigation ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(5, 9, 20, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.site-nav.scrolled {
  background: rgba(5, 9, 20, 0.82);
  border-bottom-color: var(--hairline);
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo img {
  width: 170px;
  height: auto;
  /* Dark wordmark on transparent PNG: invert to light, rotate hue back so the blue swoosh stays blue */
  filter: invert(1) hue-rotate(190deg) saturate(1.4) brightness(1.05) drop-shadow(0 0 5px rgba(230, 237, 247, 0.35));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  position: relative;
  padding: 8px 14px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
  transition: color 0.25s var(--ease-out);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-hover);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.active {
  color: var(--text);
  font-weight: 600;
}

.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease-out), opacity 0.2s var(--ease-out);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out),
    color 0.25s var(--ease-out),
    transform 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.35);
}

.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 10px 34px rgba(59, 130, 246, 0.45);
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(147, 164, 196, 0.06);
  color: var(--text);
  border-color: var(--hairline);
}

.btn-ghost:hover {
  border-color: var(--accent-hover);
  color: #fff;
  background: rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 10px 22px;
  font-size: var(--small);
}

/* Inline text link with arrow, used in cards and steps */
.link-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: var(--small);
  font-weight: 600;
  color: var(--accent-hover);
  transition: gap 0.25s var(--ease-out), color 0.25s var(--ease-out);
}

.link-more::after {
  content: "→";
  transition: transform 0.25s var(--ease-out);
}

.link-more:hover {
  color: #8fb6ff;
  gap: 10px;
}

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: calc(var(--nav-h) + 48px) 24px 96px;
}

/* Shorter hero variant for pages 2-5: tall enough to read as a complete hero at 900px viewport */
.hero-sub {
  min-height: 80vh;
  min-height: 80svh;
}

.hero-motif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.hero-title {
  margin: 18px 0 24px;
  word-break: keep-all;
}

.hero-sub-line {
  font-size: clamp(1rem, 1.6vw, 1.1875rem);
  color: #c4cfe8;
  margin-inline: auto;
  max-width: 620px;
  word-break: keep-all;
  text-shadow: 0 2px 18px rgba(5, 9, 20, 0.95), 0 0 40px rgba(5, 9, 20, 0.9);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 40px;
}

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.hero-scroll::after {
  content: "";
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--accent-hover), transparent);
  animation: scroll-hint 2.2s var(--ease-out) infinite;
}

@keyframes scroll-hint {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  35% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  70% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ---------- 7. Cards & grids ---------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 28px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--glow-card);
  transition:
    transform 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out);
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 52px rgba(37, 99, 235, 0.2);
}

.card-title {
  font-size: 1.1875rem;
  font-weight: 600;
}

.card-text {
  font-size: 0.9375rem;
  color: var(--muted);
  word-break: keep-all;
}

/* Celestial icon: small glowing star in an orbit ring */
.card-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: radial-gradient(circle at 32% 30%, rgba(96, 165, 250, 0.28), rgba(37, 99, 235, 0.08) 62%);
  box-shadow: inset 0 0 14px rgba(96, 165, 250, 0.18), 0 0 18px rgba(37, 99, 235, 0.18);
  flex-shrink: 0;
}

.card-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-hover);
  box-shadow: 0 0 12px var(--accent-hover);
  transform: translate(-50%, -50%);
}

.card-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px dashed rgba(147, 164, 196, 0.4);
  transform: translate(-50%, -50%);
}

/* Celestial bullet list */
.celestial-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.celestial-list li {
  position: relative;
  padding-left: 26px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.celestial-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-hover);
  box-shadow: 0 0 10px var(--accent-hover);
}

.celestial-list li strong {
  color: var(--text);
  font-weight: 600;
}

/* Statement block: big quiet sentence, section 1 style */
.statement {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.45;
  color: var(--text);
  max-width: 760px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* ---------- 8. Planet cards (two galaxies) ---------- */
.planet-card {
  overflow: hidden;
}

.planet-visual {
  position: relative;
  height: 180px;
  margin: -8px -4px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pure CSS planet */
.css-planet {
  position: relative;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #8fb6ff 0%, #3b82f6 42%, #1d4ed8 74%, #0b1e4b 100%);
  box-shadow:
    inset -14px -12px 30px rgba(3, 8, 23, 0.65),
    0 0 44px rgba(59, 130, 246, 0.4);
}

.css-planet::before {
  content: "";
  position: absolute;
  inset: -26px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  transform: rotateX(68deg);
}

.css-planet::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #dbeafe;
  box-shadow: 0 0 10px #93c5fd;
  animation: orbit-moon 9s linear infinite;
}

.css-planet.planet-alt {
  background: radial-gradient(circle at 30% 28%, #c4b5fd 0%, #818cf8 40%, #4f46e5 72%, #1e1b4b 100%);
  box-shadow:
    inset -14px -12px 30px rgba(3, 8, 23, 0.65),
    0 0 44px rgba(129, 140, 248, 0.38);
}

@keyframes orbit-moon {
  from { transform: translate(-50%, -50%) rotate(0deg) translateX(78px) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg) translateX(78px) rotate(-360deg); }
}

/* Pure CSS orbit decoration for empty corners of sections */
.orbit-decor {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  pointer-events: none;
}

.orbit-decor::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-hover);
  box-shadow: 0 0 10px var(--accent-hover);
}

/* ---------- 9. Step cards (orbit timeline) ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  counter-reset: step;
}

.step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 22px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  transition: transform 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}

.step:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.45);
}

.step-num {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-hover);
}

.step-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
}

.step-text {
  font-size: var(--small);
  color: var(--muted);
  line-height: 1.65;
}

.step-here {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(96, 165, 250, 0.5);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-hover);
  background: rgba(37, 99, 235, 0.12);
}

/* ---------- 10. Comparison table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--glow-card);
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.compare-table th,
.compare-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  line-height: 1.6;
  word-break: keep-all;
}

.compare-table thead th {
  font-size: var(--small);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(37, 99, 235, 0.1);
  border-bottom: 1px solid rgba(96, 165, 250, 0.35);
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table tbody th {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.compare-table td {
  color: var(--muted);
}

/* Sticky first column for horizontal scroll on small screens */
.compare-table th:first-child,
.compare-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--panel-solid);
  box-shadow: 1px 0 0 var(--hairline);
}

.compare-table thead th:first-child {
  background: #101a3a;
}

/* ---------- 11. CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 96px 24px;
  border-block: 1px solid var(--hairline);
  background:
    radial-gradient(60% 120% at 50% 120%, rgba(37, 99, 235, 0.22), transparent 70%),
    var(--panel);
}

.cta-band h2 {
  margin-bottom: 16px;
}

.cta-band p {
  margin: 0 auto 34px;
  max-width: 520px;
}

/* ---------- 12. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  background: rgba(5, 9, 20, 0.75);
  padding: 64px 24px 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: var(--container);
  margin-inline: auto;
}

.footer-brand img {
  width: 132px;
  margin-bottom: 18px;
}

.footer-brand p {
  font-size: var(--small);
  max-width: 30ch;
}

.footer-col h4 {
  font-size: var(--small);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: var(--small);
  color: var(--muted);
  transition: color 0.25s var(--ease-out);
}

.footer-col a:hover {
  color: var(--accent-hover);
}

.footer-bottom {
  max-width: var(--container);
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  font-size: 0.8125rem;
  color: rgba(147, 164, 196, 0.65);
}

/* ---------- 13. Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 14. Responsive ---------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav-logo img { width: 150px; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 24px 24px;
    background: rgba(5, 9, 20, 0.96);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--hairline);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition:
      transform 0.3s var(--ease-out),
      opacity 0.3s var(--ease-out),
      visibility 0.3s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links a.active {
    background: rgba(37, 99, 235, 0.14);
    border-radius: 10px;
  }
}

@media (max-width: 600px) {
  .section { padding: 72px 24px; }
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-cta .btn { width: 100%; max-width: 320px; }
  .card { padding: 26px 22px; }
}

/* ---------- 15. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-scroll::after {
    animation: none;
    opacity: 0.5;
  }
}
