/* ═══════════════════════════════════════════
   Lord Bismark — v3 style.css
   Markmix Studios Limited
   • Dark / Light mode via [data-theme]
   • Performance: will-change only on animated,
     contain: layout style on cards
═══════════════════════════════════════════ */

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

/* ══════════════════════════════════════════
   DESIGN TOKENS — DARK (default)
══════════════════════════════════════════ */
:root,
[data-theme="dark"] {
  --bg:          #09090e;
  --surface:     #0f0f17;
  --surface2:    #161621;
  --border:      rgba(255, 255, 255, 0.07);
  --border-h:    rgba(207, 170, 90, 0.35);
  --gold:        #cfaa5a;
  --gold-soft:   rgba(207, 170, 90, 0.12);
  --gold-glow:   rgba(207, 170, 90, 0.25);
  --cyan:        #5ac8cf;
  --text:        #edeae2;
  --text-strong: #ffffff;
  --muted:       #5c5968;
  --muted2:      #7e7a8c;
  --radius:      14px;

  /* scanline / orb strengths */
  --scanline-opacity: 0.03;
  --orb1-color:  rgba(207,170,90,0.13);
  --orb2-color:  rgba(90,200,207,0.09);
  --orb3-color:  rgba(140,90,207,0.08);

  /* theme-color for <meta> (JS updates it too) */
  --meta-bg: #09090e;

  /* toggle button look */
  --toggle-bg:     rgba(255,255,255,0.07);
  --toggle-border: rgba(207,170,90,0.25);
  --toggle-color:  var(--gold);

  /* footer link color */
  --footer-link: var(--muted2);
}

/* ══════════════════════════════════════════
   DESIGN TOKENS — LIGHT
══════════════════════════════════════════ */
[data-theme="light"] {
  --bg:          #f5f3ee;
  --surface:     #ffffff;
  --surface2:    #ede9e1;
  --border:      rgba(0, 0, 0, 0.08);
  --border-h:    rgba(160, 120, 40, 0.4);
  --gold:        #9a6f1e;
  --gold-soft:   rgba(160, 120, 40, 0.1);
  --gold-glow:   rgba(160, 120, 40, 0.18);
  --cyan:        #1a8e96;
  --text:        #1c1a16;
  --text-strong: #000000;
  --muted:       #998f80;
  --muted2:      #6b6155;

  --scanline-opacity: 0;
  --orb1-color:  rgba(207,170,90,0.18);
  --orb2-color:  rgba(90,200,207,0.12);
  --orb3-color:  rgba(180,130,60,0.10);

  --toggle-bg:     rgba(0,0,0,0.06);
  --toggle-border: rgba(160,120,40,0.3);
  --toggle-color:  var(--gold);

  --footer-link: var(--muted2);
}

/* ── Fonts ── */
:root {
  --font-head:  'Syne', sans-serif;
  --font-serif: 'Instrument Serif', serif;
  --font-mono:  'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-head);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none;
  position: relative;
  /* smooth theme transition */
  transition: background 0.35s ease, color 0.35s ease;
}

/* Restore cursor on touch/mobile */
@media (hover: none) {
  body { cursor: auto; }
  #cursor { display: none; }
}

/* ════════════════════════════════
   THEME TOGGLE BUTTON
════════════════════════════════ */
.theme-toggle {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 1000;

  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  color: var(--toggle-color);
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  transition:
    background    0.25s,
    border-color  0.25s,
    color         0.25s,
    transform     0.2s,
    box-shadow    0.25s;
}

.theme-toggle:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
  transform: scale(1.08) rotate(15deg);
  box-shadow: 0 0 16px var(--gold-glow);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Show/hide sun & moon based on current theme */
.theme-toggle__icon { display: flex; align-items: center; justify-content: center; }

[data-theme="dark"]  .theme-toggle__icon--sun  { display: none; }
[data-theme="dark"]  .theme-toggle__icon--moon { display: flex; }
[data-theme="light"] .theme-toggle__icon--sun  { display: flex; }
[data-theme="light"] .theme-toggle__icon--moon { display: none; }

/* Tablet / small desktop: nudge slightly left of edge */
@media (min-width: 640px) {
  .theme-toggle {
    top: 1.4rem;
    right: 1.4rem;
  }
}

/* ════════════════════════════════
   AMBIENT ORBS
════════════════════════════════ */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--orb1-color) 0%, transparent 70%);
  top: -150px; left: -150px;
  animation: drift1 18s ease-in-out infinite;
}

.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--orb2-color) 0%, transparent 70%);
  bottom: 0; right: -100px;
  animation: drift2 22s ease-in-out infinite;
}

.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--orb3-color) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: drift3 26s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(60px, 40px) scale(1.1); }
  66%       { transform: translate(-30px, 80px) scale(0.95); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(-80px, -60px) scale(1.15); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%       { transform: translate(-50%, -50%) scale(1.3); opacity: 0.6; }
}

/* ── Scanlines ── */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, var(--scanline-opacity)) 2px,
    rgba(0, 0, 0, var(--scanline-opacity)) 4px
  );
  transition: background 0.35s;
}

/* ════════════════════════════════
   CUSTOM CURSOR
════════════════════════════════ */
#cursor {
  position: fixed;
  width: 20px; height: 20px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s linear, width 0.2s, height 0.2s, background 0.2s, border-color 0.2s;
}

body.link-hover #cursor {
  width: 48px; height: 48px;
  background: var(--gold-soft);
  border-color: var(--gold);
}

/* ════════════════════════════════
   LAYOUT
════════════════════════════════ */
.container {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

/* ════════════════════════════════
   PROFILE HEADER
════════════════════════════════ */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.75rem;
  animation: fadeDown 0.7s ease both;
}

/* ── Avatar ── */
.avatar-ring {
  position: relative;
  width: 110px; height: 110px;
  flex-shrink: 0;
}

.avatar-spin {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--gold) 0%,
    transparent 40%,
    var(--cyan) 60%,
    transparent 80%,
    var(--gold) 100%
  );
  animation: spin 6s linear infinite;
  will-change: transform;
}

.avatar {
  position: relative;
  z-index: 1;
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 3px solid var(--bg);
  display: block;
  transition: border-color 0.35s;
}

.avatar-status {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 20px; height: 20px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.35s;
}

.status-dot {
  width: 10px; height: 10px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse-green 2.5s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 6px #4ade80;  transform: scale(1); }
  50%       { box-shadow: 0 0 14px #4ade80; transform: scale(1.15); }
}

/* ── Profile text ── */
.profile-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.profile-name {
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 10vw, 4rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.02em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.3em;
}

.name-line         { color: var(--text); }
.name-line.accent  { color: var(--gold); }
.name-ankh         { font-size: 0.6em; color: var(--muted2); opacity: 0.8; }

.profile-handle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--muted2);
  margin-top: 0.25rem;
}

.profile-bio {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--muted2);
  letter-spacing: 0.01em;
  margin-top: 0.25rem;
}

.profile-studio {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(207,170,90,0.2);
  padding: 0.45rem 1rem;
  border-radius: 100px;
  margin-top: 0.5rem;
  transition: background 0.35s, border-color 0.35s;
}

.studio-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: blink 2.2s ease-in-out infinite;
}

/* ════════════════════════════════
   LINK CARDS
════════════════════════════════ */
.links-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  cursor: none;
  contain: layout style;          /* performance: limit reflow scope */

  transition:
    border-color  0.25s,
    background    0.25s,
    transform     0.2s,
    box-shadow    0.25s;

  opacity: 0;
  transform: translateY(20px);
}

.link-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity       0.5s ease,
    transform     0.5s ease,
    border-color  0.25s,
    background    0.25s,
    box-shadow    0.25s;
}

.link-card:hover {
  border-color: var(--border-h);
  background: var(--surface2);
  transform: translateY(-2px) scale(1.008);
  box-shadow:
    0 8px 32px var(--gold-glow),
    0 0 0 1px rgba(207, 170, 90, 0.08) inset;
}

/* Featured */
.link-card--featured {
  border-color: rgba(207,170,90,0.25);
  background: linear-gradient(135deg, var(--surface) 60%, var(--gold-soft));
}

.link-card--featured:hover {
  border-color: rgba(207,170,90,0.6);
  box-shadow:
    0 10px 40px rgba(207, 170, 90, 0.18),
    0 0 0 1px rgba(207, 170, 90, 0.12) inset;
}

/* Glow blob */
.link-glow {
  position: absolute;
  width: 120px; height: 120px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
  left: var(--gx, 50%);
  top:  var(--gy, 50%);
}

.link-card:hover .link-glow { opacity: 1; }

/* Icon */
.link-icon {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--gold);
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.2s;
  position: relative;
  z-index: 1;
}

.link-card:hover .link-icon {
  background: var(--gold-soft);
  border-color: rgba(207,170,90,0.4);
  transform: scale(1.08) rotate(-3deg);
}

/* Text body */
.link-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.link-label {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.link-card:hover .link-label { color: var(--text-strong); }

.link-url {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.link-card:hover .link-url { color: var(--muted2); }

/* Arrow */
.link-arrow {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--muted);
  transition: border-color 0.25s, color 0.25s, background 0.25s, transform 0.25s;
  position: relative;
  z-index: 1;
}

.link-card:hover .link-arrow {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
  transform: rotate(45deg);
}

/* ════════════════════════════════
   FOOTER
════════════════════════════════ */
.site-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: fadeUp 0.7s ease 1.2s both;
}

.footer-brand {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted2);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-mark { color: var(--gold); font-size: 1rem; }

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.4rem;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  color: var(--footer-link);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ════════════════════════════════
   KEYFRAMES
════════════════════════════════ */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 480px) {
  .container { padding: 2.5rem 1rem 3rem; }

  .profile-name { font-size: clamp(2.2rem, 12vw, 3rem); }

  .link-card { padding: 1rem 1rem; }
  .link-icon { width: 38px; height: 38px; font-size: 1rem; }
  .link-label { font-size: 0.88rem; }
  .link-url   { font-size: 0.62rem; }

  .theme-toggle { top: 0.8rem; right: 0.8rem; width: 38px; height: 38px; }
}

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
  .avatar-spin, .orb, .status-dot, .studio-dot { animation: none; }
  .link-card { transition: none; }
  .theme-toggle { transition: none; }
}
