/* ============================================
   VARIABLES
   ============================================ */
:root {
  --bg: #0a0a0a;
  --text: #e8e8e8;
  --text-dim: #666666;
  --text-muted: #444444;
  --accent: #4ecdc4;
  --accent-dim: #2d8f89;
  --border: #222222;

  --font-display: 'Audiowide', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ring-size: clamp(420px, 52vw, 780px);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  height: 100vh;
  cursor: none;
}

/* Noise overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ============================================
   CUSTOM CURSOR
   ============================================ */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s;
  visibility: hidden;
}

.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s;
  opacity: 0.5;
  visibility: hidden;
}

body.cursor-hover .cursor-dot {
  width: 12px;
  height: 12px;
}

body.cursor-hover .cursor-ring {
  width: 50px;
  height: 50px;
  opacity: 0.8;
}

@media (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
  body { cursor: auto; }
}

/* ============================================
   LOADER
   ============================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  animation: loader-fade-in 0.8s ease-out forwards;
  opacity: 0;
}

@keyframes loader-fade-in {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.loader-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.loader-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.2;
  animation: loader-pulse 1.2s ease-in-out infinite;
}

.loader-dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loader-pulse {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}

/* ============================================
   HERO
   ============================================ */
#hero {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  visibility: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ============================================
   RING + NODES
   ============================================ */
.hero-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: var(--ring-size);
  height: var(--ring-size);
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
}

.ring-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--accent);
  pointer-events: none;
  opacity: 0;
  transform-origin: center;
}

.data-points {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

.ring-node {
  position: absolute;
  top: 50%; left: 50%;
  width: 56px;
  height: 56px;
  margin-left: -28px;
  margin-top: -28px;
  border: 1.5px solid rgba(78, 205, 196, 0.5);
  background: rgba(10, 10, 10, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: none;
  opacity: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.ring-node:hover {
  border-color: var(--accent);
  background: rgba(78, 205, 196, 0.15);
  box-shadow: 0 0 20px rgba(78, 205, 196, 0.3), 0 0 40px rgba(78, 205, 196, 0.1);
}

.ring-node.active {
  border-color: var(--accent);
  border-width: 2px;
  background: rgba(78, 205, 196, 0.2);
  box-shadow: 0 0 20px rgba(78, 205, 196, 0.5), 0 0 50px rgba(78, 205, 196, 0.2);
}

.node-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
  user-select: none;
  transition: color 0.3s;
}

.ring-node:hover .node-label,
.ring-node.active .node-label {
  color: var(--accent);
}

.ring-node-home .node-label {
  line-height: 1;
}

@media (pointer: coarse) {
  .ring-node { cursor: pointer; }
}

/* ============================================
   CENTER CONTENT
   ============================================ */
.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 2rem;
  pointer-events: none;
  margin-top: 2vh;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 0.9vw, 0.8rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
  opacity: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
  pointer-events: auto;
  cursor: none;
}

/* Section views — tag & subtitle positioned independently */
.hero-content.section-view-active {
  position: absolute;
  inset: 0;
  margin-top: 0;
}

.hero-title.section-view {
  display: none;
}

.hero-content.section-view-active .hero-tag {
  position: absolute;
  top: 28%;
  left: 0;
  right: 0;
  transform: none;
  margin: 0 auto;
  font-size: clamp(0.65rem, 0.9vw, 0.8rem);
  letter-spacing: 0.2em;
  text-align: center;
}

.hero-content.section-view-active .hero-subtitle {
  position: absolute;
  top: 64%;
  left: 0;
  right: 0;
  transform: none;
  margin: 0 auto;
  font-style: italic;
  text-align: justify;
  text-align-last: center;
  opacity: 0.35;
}

.hero-content.section-view-active .hero-subtitle::before {
  display: none;
}

.title-line {
  display: block;
}

.title-line-inner {
  display: block;
  opacity: 0;
}

.hero-subtitle {
  font-size: clamp(0.75rem, 0.95vw, 0.9rem);
  font-style: italic;
  line-height: 1.6;
  color: var(--text);
  max-width: 580px;
  margin: 3rem auto 0;
  opacity: 0;
  text-align: justify;
  text-align-last: center;
}

/* Home motto style */
.hero-subtitle.hero-motto {
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 0.85vw, 0.85rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  text-align-last: auto;
}

.hero-subtitle::before {
  display: none;
}

/* Contact links in subtitle area */
.hero-subtitle.contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  pointer-events: auto;
  font-style: normal;
  text-align: center;
  text-align-last: auto;
  max-width: none;
}

.hero-content.section-view-active .hero-subtitle.contact-links {
  opacity: 1;
}

.contact-desc {
  font-size: clamp(0.75rem, 0.95vw, 0.9rem);
  font-style: italic;
  color: var(--text);
  opacity: 0.45;
  max-width: 480px;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

/* ============================================
   CONTACT VIEW
   ============================================ */
.hero-title.contact-view {
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  margin-bottom: 1rem;
}

.contact-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.1vw, 1rem);
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s;
  cursor: none;
  pointer-events: auto;
}

.contact-line:hover {
  color: var(--accent);
}

.contact-line svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

@media (pointer: coarse) {
  .contact-line { cursor: pointer; }
}

/* ============================================
   SOCIAL LINKS
   ============================================ */
.social-links {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  z-index: 4;
  display: flex;
  gap: 1rem;
  opacity: 0;
}

.social-link {
  color: var(--text-muted);
  transition: color 0.3s;
  cursor: none;
}

.social-link:hover {
  color: var(--accent);
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

@media (pointer: coarse) {
  .social-link { cursor: pointer; }
}

/* ============================================
   LANGUAGE BUTTON
   ============================================ */
.lang-btn {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--border);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  cursor: none;
  transition: color 0.3s, border-color 0.3s;
  opacity: 0;
}

.lang-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (pointer: coarse) {
  .lang-btn { cursor: pointer; }
}

/* ============================================
   SKIP LINK (a11y)
   ============================================ */
.skip-link {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10003;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   FOCUS STYLES (a11y)
   ============================================ */
.ring-node:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-color: var(--accent);
  background: rgba(78, 205, 196, 0.15);
  box-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
}

.lang-btn:focus-visible,
.social-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ============================================
   REDUCED MOTION (a11y)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .cursor-dot, .cursor-ring {
    transition: none !important;
  }
}

