/* ==========================================================================
   HyperLinker — Design System
   Signature: "node-chain" — dotted connector nodes that visually thread
   sections together, echoing what a hyperlink literally does: connect things.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---- Brand gradient ---- */
  --accent-1: #6366F1;   /* indigo */
  --accent-2: #22D3EE;   /* cyan */
  --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));

  /* ---- Dark theme (default) ---- */
  --bg: #0B1120;
  --bg-elevated: #0F172A;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --text: #E7ECF3;
  --text-muted: #93A0B4;
  --text-faint: #5B6879;
  --success: #34D399;
  --danger: #F87171;
  --warning: #FBBF24;
  --glass-blur: blur(20px);
  --shadow-lg: 0 20px 60px -15px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 4px 16px -4px rgba(0, 0, 0, 0.35);

  /* ---- Type scale ---- */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg: #F7F8FB;
  --bg-elevated: #FFFFFF;
  --surface: rgba(15, 23, 42, 0.035);
  --surface-hover: rgba(15, 23, 42, 0.06);
  --border: rgba(15, 23, 42, 0.09);
  --text: #0F172A;
  --text-muted: #57647A;
  --text-faint: #93A0B4;
  --shadow-lg: 0 20px 60px -15px rgba(15, 23, 42, 0.15);
  --shadow-sm: 0 4px 16px -4px rgba(15, 23, 42, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; color-scheme: dark; }
[data-theme="light"] html { color-scheme: light; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 60% 40% at 15% -10%, rgba(99, 102, 241, 0.16), transparent),
    radial-gradient(ellipse 50% 35% at 90% 0%, rgba(34, 211, 238, 0.10), transparent);
  background-repeat: no-repeat;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { color: var(--text-muted); }
a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--font-mono); }

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

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

.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--space-5); }

/* ---- Glass surface ---- */
.glass {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  padding: 12px 22px; border-radius: var(--radius-full); border: 1px solid transparent;
  cursor: pointer; transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent-gradient); color: #fff; box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.6); }
.btn-primary:hover { box-shadow: 0 12px 32px -8px rgba(99, 102, 241, 0.75); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-icon { padding: 10px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); }
.btn-icon:hover { color: var(--text); background: var(--surface-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---- Inputs ---- */
.input, textarea.input {
  width: 100%; font-family: var(--font-mono); font-size: 0.95rem;
  background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.input::placeholder { color: var(--text-faint); font-family: var(--font-body); }
.input:focus { border-color: var(--accent-1); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); outline: none; }

/* ---- Card ---- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-5); transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.card:hover { border-color: rgba(99, 102, 241, 0.35); transform: translateY(-3px); }

/* ---- Node-chain signature connector ---- */
.node-chain { display: flex; align-items: center; gap: 6px; }
.node-chain .node { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); flex-shrink: 0; }
.node-chain .link { flex: 1; height: 1px; background: linear-gradient(90deg, var(--accent-1), var(--accent-2)); opacity: 0.35; }

/* ---- Skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 37%, var(--surface) 63%);
  background-size: 400% 100%; animation: skeleton-wave 1.4s ease infinite; border-radius: var(--radius-sm);
}
@keyframes skeleton-wave { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- Fade/slide-in on scroll ---- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.text-gradient {
  background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

::selection { background: rgba(99, 102, 241, 0.35); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
