/* ============================================================
   Star Melody — Computer Systems Design
   Design System — Cosmic · Harmonic · Precise
   ============================================================ */

/* --- Custom Properties ----------------------------------- */
:root {
  --color-space-deep: #060612;
  --color-space: #0c0c20;
  --color-space-mid: #12122e;
  --color-space-light: #1a1a3a;
  --color-surface: #141428;
  --color-surface-hover: #1c1c38;
  --color-border: #252545;
  --color-border-light: #2a2a4a;
  --color-star: #f0c850;
  --color-star-dim: #c8a030;
  --color-star-glow: #ffe8a0;
  --color-accent: #e8b840;
  --color-accent-soft: #d4a830;
  --color-text: #e4e4f0;
  --color-text-soft: #a0a0c0;
  --color-text-muted: #6a6a8a;
  --color-text-inverse: #0a0a18;
  --color-success: #50d890;
  --color-warn: #f0a050;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 1px 3px #00000030, 0 4px 16px #00000040;
  --shadow-glow: 0 0 40px #f0c85015, 0 0 80px #f0c85008;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--color-space-deep);
  color: var(--color-text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-star);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-star-glow);
}

::selection {
  background: var(--color-star);
  color: var(--color-text-inverse);
}

/* --- Stars Background ------------------------------------ */
.stars-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1px 1px at 10% 15%, #ffffff80, transparent),
    radial-gradient(1px 1px at 25% 35%, #ffffff60, transparent),
    radial-gradient(1.5px 1.5px at 40% 10%, #ffffff70, transparent),
    radial-gradient(1px 1px at 55% 45%, #ffffff50, transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, #ffffff60, transparent),
    radial-gradient(1px 1px at 85% 40%, #ffffff70, transparent),
    radial-gradient(1px 1px at 15% 60%, #ffffff40, transparent),
    radial-gradient(1.5px 1.5px at 30% 70%, #ffffff50, transparent),
    radial-gradient(1px 1px at 50% 80%, #ffffff60, transparent),
    radial-gradient(1px 1px at 65% 55%, #ffffff40, transparent),
    radial-gradient(1.5px 1.5px at 80% 70%, #ffffff50, transparent),
    radial-gradient(1px 1px at 95% 60%, #ffffff40, transparent),
    radial-gradient(1px 1px at 20% 85%, #ffffff30, transparent),
    radial-gradient(1px 1px at 45% 90%, #ffffff40, transparent),
    radial-gradient(1.5px 1.5px at 75% 85%, #ffffff50, transparent),
    radial-gradient(1px 1px at 90% 90%, #ffffff30, transparent),
    radial-gradient(2px 2px at 60% 30%, #f0c85040, transparent),
    radial-gradient(2px 2px at 35% 55%, #f0c85030, transparent),
    radial-gradient(2px 2px at 78% 15%, #f0c85035, transparent);
}

/* --- Header ---------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0c0c20f0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.logo:hover {
  color: var(--color-star);
}

.logo-icon {
  color: var(--color-star);
}

.main-nav {
  display: flex;
  gap: 6px;
}

.main-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-soft);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-star);
  background: var(--color-star-dim)0d;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav-toggle.active .toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active .toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Hero ------------------------------------------------ */
.hero {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: calc(100vh - 68px);
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-star-dim);
  background: #f0c8500d;
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.title-line {
  display: block;
}

.title-line.accent {
  color: var(--color-star);
  text-shadow: 0 0 60px #f0c85020;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-soft);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  text-align: center;
}

.btn-primary {
  background: var(--color-star);
  color: var(--color-text-inverse);
}

.btn-primary:hover {
  background: var(--color-star-glow);
  color: var(--color-text-inverse);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px #f0c85030;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  border-color: var(--color-star-dim);
  color: var(--color-star);
  background: #f0c85008;
}

/* --- Hero Visual (Orbit System) ------------------------- */
.hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 480px;
  margin: 0 auto;
}

.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  transform: translate(-50%, -50%);
  animation: orbit-spin 20s linear infinite;
}

.ring-1 {
  width: 60%;
  height: 60%;
  animation-duration: 20s;
}

.ring-2 {
  width: 80%;
  height: 80%;
  animation-duration: 28s;
  animation-direction: reverse;
  border-style: dashed;
}

.ring-3 {
  width: 100%;
  height: 100%;
  animation-duration: 36s;
  border-color: var(--color-star-dim);
  border-width: 0.5px;
}

.orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  background: var(--color-star);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 30px #f0c85060, 0 0 60px #f0c85030, 0 0 100px #f0c85018;
  animation: center-pulse 3s ease-in-out infinite;
}

.orbit-node {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--color-star);
  border-radius: 50%;
  box-shadow: 0 0 8px #f0c85040;
}

.node-1 { top: 20%; left: 50%; animation: node-float 6s ease-in-out infinite; }
.node-2 { top: 50%; right: 20%; animation: node-float 5s ease-in-out infinite 1s; }
.node-3 { bottom: 20%; left: 50%; animation: node-float 7s ease-in-out infinite 2s; }
.node-4 { top: 50%; left: 20%; animation: node-float 5.5s ease-in-out infinite 3s; }

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

@keyframes center-pulse {
  0%, 100% { box-shadow: 0 0 30px #f0c85060, 0 0 60px #f0c85030, 0 0 100px #f0c85018; }
  50% { box-shadow: 0 0 40px #f0c85080, 0 0 80px #f0c85040, 0 0 120px #f0c85020; }
}

@keyframes node-float {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-8px); opacity: 1; }
}

/* --- Sections Common ------------------------------------- */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-soft);
  max-width: 500px;
  margin: 0 auto;
}

/* --- Services -------------------------------------------- */
.services {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px;
  transition: border-color var(--transition-base), background var(--transition-base), transform var(--transition-base);
}

.service-card:hover {
  border-color: var(--color-star-dim);
  background: var(--color-surface-hover);
  transform: translateY(-2px);
}

.card-icon {
  color: var(--color-star);
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.card-desc {
  color: var(--color-text-soft);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* --- About ----------------------------------------------- */
.about {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-text {
  color: var(--color-text-soft);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

.about-text strong {
  color: var(--color-text);
  font-weight: 600;
}

.about-meta {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta-value {
  font-size: 0.92rem;
  color: var(--color-text-soft);
  line-height: 1.6;
}

/* --- Waveform Visual ------------------------------------- */
.waveform {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 180px;
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.waveform .bar {
  width: 18px;
  height: var(--h);
  background: linear-gradient(to top, var(--color-star-dim), var(--color-star));
  border-radius: 4px 4px 0 0;
  animation: waveform-breathe 2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.12s);
}

.waveform .bar:nth-child(1) { --i: 0; }
.waveform .bar:nth-child(2) { --i: 1; }
.waveform .bar:nth-child(3) { --i: 2; }
.waveform .bar:nth-child(4) { --i: 3; }
.waveform .bar:nth-child(5) { --i: 4; }
.waveform .bar:nth-child(6) { --i: 5; }
.waveform .bar:nth-child(7) { --i: 6; }
.waveform .bar:nth-child(8) { --i: 7; }
.waveform .bar:nth-child(9) { --i: 8; }
.waveform .bar:nth-child(10) { --i: 9; }
.waveform .bar:nth-child(11) { --i: 10; }
.waveform .bar:nth-child(12) { --i: 11; }

@keyframes waveform-breathe {
  0%, 100% { opacity: 0.5; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* --- Contact --------------------------------------------- */
.contact {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px 100px;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: border-color var(--transition-base), background var(--transition-base);
  color: var(--color-text);
}

a.contact-card:hover {
  border-color: var(--color-star-dim);
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.contact-card svg {
  color: var(--color-star);
  margin-bottom: 4px;
}

.contact-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.contact-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-soft);
}

/* --- Footer ---------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--color-border);
  background: var(--color-space);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--color-text-soft);
}

.footer-links a:hover {
  color: var(--color-star);
}

.footer-legal {
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.footer-legal p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* --- Legal Pages ----------------------------------------- */
.legal-page {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 80px 24px 100px;
}

.legal-header {
  margin-bottom: 48px;
}

.legal-header h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.legal-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.legal-body h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 40px 0 12px;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.legal-body h2:first-of-type {
  margin-top: 0;
}

.legal-body p {
  color: var(--color-text-soft);
  margin-bottom: 14px;
  line-height: 1.75;
}

.legal-address {
  font-style: normal;
  color: var(--color-text-soft);
  line-height: 1.8;
  padding: 20px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: 8px;
}

/* --- Responsive ------------------------------------------ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 60px 24px;
    min-height: auto;
  }

  .hero-visual {
    max-width: 300px;
    order: -1;
  }

  .hero-title {
    font-size: clamp(2rem, 6vw, 3rem);
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #0c0c20fa;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 16px;
    gap: 2px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-base), opacity var(--transition-base);
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .main-nav a {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .waveform {
    height: 120px;
    gap: 4px;
  }

  .waveform .bar {
    width: 12px;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    justify-content: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }
}
