/* =========================================================
   ELOY — link-in-bio site
   Dark chrome / metal aesthetic, monochrome, animated shine
   ========================================================= */

/* ---------- Fonts ---------- */
/* Clash Display (Fontshare) — display headings
   General Sans (Fontshare) — body / UI */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

.separator  {
  display:block;
  height:50px;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'], ol[role='list'] { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; line-height: 1.1; }
p { text-wrap: pretty; }

::selection { background: color-mix(in oklab, var(--color-primary) 35%, transparent); color: var(--color-text); }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@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;
  }
}

button { cursor: pointer; background: none; border: none; }

a, button, [role='button'] {
  transition: color var(--transition-interactive),
              background var(--transition-interactive),
              border-color var(--transition-interactive),
              box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* ---------- Tokens ---------- */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2.25rem, 1.4rem + 3vw, 4.25rem);
  --text-hero: clamp(3.5rem, 1rem + 9vw, 7.5rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem; --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;

  --radius-sm: 0.375rem; --radius-md: 0.625rem; --radius-lg: 1rem;
  --radius-xl: 1.5rem; --radius-full: 9999px;

  --transition-interactive: 220ms cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Clash Display', 'General Sans', 'Helvetica Neue', sans-serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;

  --content-narrow: 460px;
  --content-default: 640px;
}

/* Dark = default (chrome on black) */
:root, [data-theme='dark'] {
  --color-bg: #060606;
  --color-bg-2: #0d0d0d;
  --color-surface: #111111;
  --color-surface-2: #161616;
  --color-border: #2a2a2a;
  --color-border-strong: #3d3d3d;
  --color-text: #f4f4f4;
  --color-text-muted: #9c9c9c;
  --color-text-faint: #5c5c5c;
  --color-text-inverse: #0a0a0a;
  --color-primary: #e6e6e6;
  --color-primary-highlight: #ffffff;
  --color-accent: #b23b3b; /* restrained crimson ember, used sparingly */

  --chrome-gradient: linear-gradient(115deg, #4a4a4a 0%, #e9e9e9 18%, #ffffff 30%, #7a7a7a 42%, #cfcfcf 55%, #3f3f3f 70%, #ffffff 85%, #6b6b6b 100%);
  --shadow-glow: 0 0 40px rgba(255,255,255,0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.6);
  --noise-opacity: 0.05;
}

/* Light = brushed steel */
[data-theme='light'] {
  --color-bg: #eeeeee;
  --color-bg-2: #e6e6e6;
  --color-surface: #f5f5f5;
  --color-surface-2: #ffffff;
  --color-border: #cfcfcf;
  --color-border-strong: #b8b8b8;
  --color-text: #131313;
  --color-text-muted: #55555a;
  --color-text-faint: #8b8b8b;
  --color-text-inverse: #ffffff;
  --color-primary: #1a1a1a;
  --color-primary-highlight: #000000;
  --color-accent: #9c2c2c;

  --chrome-gradient: linear-gradient(115deg, #5a5a5a 0%, #1a1a1a 18%, #000000 30%, #4a4a4a 42%, #0d0d0d 55%, #3f3f3f 70%, #000000 85%, #5a5a5a 100%);
  --shadow-glow: 0 0 40px rgba(0,0,0,0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.14);
  --noise-opacity: 0.035;
}

/* ---------- Background texture ---------- */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: var(--noise-opacity); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, transparent 0%, transparent 40%, var(--color-bg) 100%);
}

.beam {
  position: fixed; top: -20%; left: 50%; width: 140vmax; height: 140vmax;
  transform: translateX(-50%);
  background: radial-gradient(circle, color-mix(in oklab, var(--color-primary) 8%, transparent) 0%, transparent 55%);
  z-index: 0; pointer-events: none; animation: beam-drift 16s ease-in-out infinite alternate;
}
@keyframes beam-drift {
  0% { opacity: .5; transform: translateX(-52%) translateY(0); }
  100% { opacity: .9; transform: translateX(-48%) translateY(2%); }
}

/* ---------- Layout ---------- */
.page {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: var(--space-8) var(--space-5) var(--space-16);
}

.topbar {
  width: 100%; max-width: var(--content-default);
  display: flex; justify-content: flex-end; align-items: center;
  padding-block: var(--space-2);
}

.theme-toggle {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border); color: var(--color-text-muted);
  background: color-mix(in oklab, var(--color-surface) 80%, transparent);
}
.theme-toggle:hover { color: var(--color-text); border-color: var(--color-border-strong); box-shadow: var(--shadow-glow); }
.theme-toggle svg { width: 18px; height: 18px; }

main {
  width: 100%; max-width: var(--content-default);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}

/* ---------- Avatar ---------- */
.avatar-frame {
  position: relative;
  width: clamp(120px, 30vw, 168px);
  height: clamp(120px, 30vw, 168px);
  margin-top: var(--space-8);
  margin-bottom: var(--space-6);
}

.avatar-ring {
  position: absolute; inset: -8px; border-radius: var(--radius-full);
  background: conic-gradient(from 0deg, transparent 0deg, var(--color-primary-highlight) 40deg, transparent 90deg, transparent 260deg, var(--color-primary-highlight) 300deg, transparent 340deg);
  animation: ring-spin 7s linear infinite;
  filter: blur(1px);
}
@keyframes ring-spin { to { transform: rotate(360deg); } }

.avatar-frame::after {
  content: ''; position: absolute; inset: -1px; border-radius: var(--radius-full);
  border: 1px solid var(--color-border-strong); box-shadow: var(--shadow-glow);
}

.avatar-img {
  position: relative; width: 100%; height: 100%; border-radius: var(--radius-full);
  overflow: hidden; border: 3px solid var(--color-bg);
}
.avatar-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Identity ---------- */
.eyebrow {
  font-family: var(--font-body); font-size: var(--text-xs);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--color-text-faint); margin-bottom: var(--space-3);
}

h1.title {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--text-hero); letter-spacing: -0.02em;
  line-height: 0.95; margin-bottom: var(--space-3);

  background-image: var(--chrome-gradient);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: chrome-sweep 5s ease-in-out infinite;
}
@keyframes chrome-sweep {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.subtitle {
  font-family: var(--font-body); font-weight: 500;
  font-size: var(--text-lg); color: var(--color-text);
  margin-bottom: var(--space-4);
}
.subtitle .accent-dot { color: var(--color-accent); }

.bio {
  max-width: 46ch; font-size: var(--text-sm); color: var(--color-text-muted);
  margin-bottom: var(--space-10);
}

/* ---------- Link buttons ---------- */
.link-stack {
  width: 100%; max-width: var(--content-narrow);
  display: flex; flex-direction: column; gap: var(--space-4);
  margin-bottom: var(--space-16);
  perspective: 800px;
}

.link-btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, var(--color-surface-2), var(--color-surface));
  color: var(--color-text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.link-btn::before {
  content: ''; position: absolute; top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, color-mix(in oklab, var(--color-primary-highlight) 70%, transparent), transparent);
  transform: skewX(-20deg);
  transition: left 700ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.link-btn:hover, .link-btn:focus-visible {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}
.link-btn:hover::before { left: 130%; }
.link-btn:active { transform: translateY(0) scale(0.99); }

.link-btn .icon {
  flex: none; width: 24px; height: 24px; color: var(--color-text);
}

.link-btn .label {
  flex: 1; text-align: left; font-family: var(--font-display);
  font-weight: 500; font-size: var(--text-base); letter-spacing: -0.01em;
}

.link-btn .handle {
  font-size: var(--text-xs); color: var(--color-text-faint);
  display: block; margin-top: 2px; font-family: var(--font-body); letter-spacing: 0;
}

.link-btn .arrow { flex: none; width: 16px; height: 16px; color: var(--color-text-faint); transition: transform var(--transition-interactive); }
.link-btn:hover .arrow { transform: translateX(3px); color: var(--color-text); }

/* Primary vs secondary sizing */
.link-btn--primary { padding-block: var(--space-6); }
.link-btn--secondary {
  padding: var(--space-4) var(--space-5);
}
.link-btn--secondary .icon { width: 20px; height: 20px; }
.link-btn--secondary .label { font-size: var(--text-sm); }

/* ---------- Section divider ---------- */
.section-header {
  width: 100%; max-width: var(--content-narrow);
  display: flex; align-items: center; gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.section-header .line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--color-border-strong), transparent); }
.section-header .label {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--text-sm); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-text-muted);
}

.section-sub {
  font-size: var(--text-xs); color: var(--color-text-faint);
  max-width: var(--content-narrow); text-align: left; width: 100%;
  margin-top: calc(-1 * var(--space-2)); margin-bottom: var(--space-5);
}

.link-group { width: 100%; max-width: var(--content-narrow); display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-10); }

/* ---------- Equalizer divider ---------- */
.eq {
  display: flex; align-items: flex-end; gap: 4px; height: 22px; margin-bottom: var(--space-10);
  opacity: 0.7;
}
.eq span {
  width: 3px; background: var(--color-text-muted); border-radius: 2px;
  animation: eq-bounce 1.2s ease-in-out infinite;
}
.eq span:nth-child(1) { animation-delay: -1.1s; }
.eq span:nth-child(2) { animation-delay: -0.9s; }
.eq span:nth-child(3) { animation-delay: -0.4s; }
.eq span:nth-child(4) { animation-delay: -1.3s; }
.eq span:nth-child(5) { animation-delay: -0.2s; }
.eq span:nth-child(6) { animation-delay: -0.7s; }
.eq span:nth-child(7) { animation-delay: -1s; }
@keyframes eq-bounce {
  0%, 100% { height: 4px; }
  50% { height: 22px; }
}

/* ---------- Footer ---------- */
footer {
  text-align: center; color: var(--color-text-faint); font-size: var(--text-xs);
  max-width: var(--content-narrow);
}
footer .note { margin-bottom: var(--space-4); }
footer .mark { display: flex; justify-content: center; margin-bottom: var(--space-4); opacity: 0.5; }
footer .mark svg { width: 22px; height: 22px; color: var(--color-text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 420px) {
  .link-btn { padding: var(--space-4) var(--space-5); }
  .link-btn--primary { padding-block: var(--space-5); }
}
