/* =========================================================================
   Stéphane's Linktree — Dark Sky Theme
   ========================================================================= */

/* --- Design Tokens --- */
:root {
  /* Backgrounds — deep night sky scale */
  --bg:               #0a0e1a;
  --bg-card:          #141928;
  --bg-card-hover:    #1a2033;

  /* Text */
  --text-primary:     #e8e6e3;
  --text-secondary:   #8b8d98;
  --text-tertiary:    #7a7d8b;

  /* Accent — warm gold */
  --accent:           #c9a96e;
  --accent-hover:     #d4b87f;
  --accent-glow:      rgba(201, 169, 110, 0.15);

  /* Borders */
  --border:           #1f2538;
  --border-hover:     #c9a96e;

  /* Glass */
  --glass-bg:         rgba(20, 25, 40, 0.7);
  --glass-border:     rgba(255, 255, 255, 0.06);
  --glass-blur:       8px;

  /* Typography */
  --font:             'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-name:        1.5rem;
  --text-tagline:     0.875rem;
  --text-link-title:  1rem;
  --text-link-desc:   0.8125rem;
  --text-footer:      0.75rem;
  --text-toggle:      0.8125rem;
  --weight-normal:    400;
  --weight-medium:   500;
  --weight-semibold:  600;
  --weight-bold:      700;
  --leading-tight:    1.2;
  --leading-normal:   1.5;
  --tracking-normal:   0;
  --tracking-wide:     0.05em;

  /* Spacing */
  --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-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;

  /* Shadows */
  --shadow-card:        0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-card-hover:  0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow:        0 0 16px rgba(201, 169, 110, 0.15);

  /* Radius */
  --radius-card:    12px;
  --radius-toggle:   8px;
  --radius-full:    50%;
  --border-width:    1px;

  /* Layout */
  --max-width:    480px;
  --padding-x:    24px;
  --card-gap:     16px;
  --card-padding: 16px 20px;
}

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

/* --- Base --- */
body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.15), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(255, 255, 255, 0.1), transparent),
    radial-gradient(1px 1px at 80% 20%, rgba(255, 255, 255, 0.12), transparent),
    radial-gradient(1px 1px at 40% 85%, rgba(255, 255, 255, 0.08), transparent),
    radial-gradient(1px 1px at 90% 50%, rgba(201, 169, 110, 0.1), transparent),
    radial-gradient(1.5px 1.5px at 15% 60%, rgba(255, 255, 255, 0.06), transparent);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-16) var(--padding-x) var(--space-8);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Language Toggle --- */
.lang-toggle {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  display: flex;
  gap: var(--space-1);
  font-size: var(--text-toggle);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
}

.lang-toggle button {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-toggle);
  transition: color 150ms ease;
  font-family: var(--font);
  font-size: var(--text-toggle);
  font-weight: var(--weight-medium);
}

.lang-toggle button.active {
  color: var(--accent);
}

.lang-toggle button:hover {
  color: var(--text-secondary);
}

.lang-toggle button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-toggle .separator {
  color: var(--text-tertiary);
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* --- Header --- */
.header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.header h1 {
  font-size: clamp(1.25rem, 4vw + 0.5rem, 1.5rem);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-1);
}

.header .tagline {
  font-size: var(--text-tagline);
  font-weight: var(--weight-normal);
  color: var(--text-secondary);
  letter-spacing: var(--tracking-wide);
}

/* --- Monogram --- */
.monogram {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: var(--weight-bold);
  color: var(--accent);
  margin: 0 auto var(--space-4);
  box-shadow: var(--shadow-glow);
}

/* --- Link List --- */
.link-list {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

/* --- Link Card --- */
.link-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--card-padding);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 200ms ease,
              background 200ms ease;
}

.link-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover), var(--shadow-glow);
}

.link-card:active {
  transform: translateY(0);
}

.link-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.link-card .icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.link-card .content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.link-card .title {
  font-size: var(--text-link-title);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.link-card .desc {
  font-size: var(--text-link-desc);
  font-weight: var(--weight-normal);
  color: var(--text-secondary);
}

/* --- Footer --- */
.footer {
  text-align: center;
  margin-top: auto;
  padding-top: var(--space-12);
  font-size: var(--text-footer);
  color: var(--text-tertiary);
  font-weight: var(--weight-normal);
}

.footer .built {
  margin-top: var(--space-1);
  font-size: var(--text-footer);
  color: var(--text-tertiary);
}

/* --- Animations: Stagger Fade-In --- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.loaded .header {
  animation: fade-in-up 500ms ease both;
}

body.loaded .link-card:nth-child(1) {
  animation: fade-in-up 400ms ease 150ms both;
}

body.loaded .link-card:nth-child(2) {
  animation: fade-in-up 400ms ease 200ms both;
}

body.loaded .link-card:nth-child(3) {
  animation: fade-in-up 400ms ease 250ms both;
}

body.loaded .link-card:nth-child(4) {
  animation: fade-in-up 400ms ease 300ms both;
}

body.loaded .footer {
  animation: fade-in-up 400ms ease 400ms both;
}

body.loaded .lang-toggle {
  animation: fade-in-up 300ms ease both;
}

/* --- Responsive --- */
@media (min-width: 768px) {
  .container {
    padding-top: var(--space-20);
  }
}

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