/**
 * EverythingSings.art - Main Stylesheet
 *
 * Dark mode default, light mode via prefers-color-scheme.
 * Minimal, accessible design focused on readability.
 */

/* CSS Custom Properties - Dark mode default */
:root {
  --color-bg: #0d0d0d;
  --color-text: #e8e8e8;
  --color-text-muted: #a0a0a0;
  --color-accent: #ffffff;
  --color-link: #e8e8e8;
  --color-link-hover: #ffffff;
  --color-border: #333333;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-size-base: 16px;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.25rem;

  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  --max-width: 600px;
  --border-radius: 8px;

  /* Quantum reveal animation timing */
  --ease-quantum: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --reveal-duration: 400ms;
}

/* Light mode override */
@media (prefers-color-scheme: light) {
  :root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #666666;
    --color-accent: #000000;
    --color-link: #1a1a1a;
    --color-link-hover: #000000;
    --color-border: #e0e0e0;
  }
}

/* Shader canvas background */
#shader-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Shader indicator */
#shader-indicator {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background-color: rgba(13, 13, 13, 0.7);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 100;
}

#shader-indicator.visible {
  opacity: 1;
}

@media (prefers-color-scheme: light) {
  #shader-indicator {
    background-color: rgba(255, 255, 255, 0.7);
  }
}

/* Hide shader canvas when reduced motion is preferred */
@media (prefers-reduced-motion: reduce) {
  #shader-canvas {
    display: none;
  }

  #shader-indicator {
    display: none;
  }
}

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

html {
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-md);
  flex: 1;
}

/* Profile card */
.profile-card {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  margin-bottom: var(--spacing-md);
  border: 2px solid var(--color-border);
}

.profile-card h1 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--color-accent);
}

.profile-card .p-note {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* Link list */
.link-list {
  margin-bottom: var(--spacing-xl);
}

/* Link groups - semantic organization */
.link-group {
  margin-bottom: var(--spacing-md);
}

.link-group-label {
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-text-muted);
  text-transform: lowercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--spacing-xs);
  padding-left: var(--spacing-xs);
  opacity: 0.7;
}

.link-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* Link card - quantum reveal container */
.link-card {
  display: grid;
  grid-template-rows: auto 0fr;
  overflow: hidden;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  color: var(--color-link);
  text-decoration: none;
  text-align: center;
  transition:
    grid-template-rows var(--reveal-duration) var(--ease-quantum),
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.link-card:hover,
.link-card:focus {
  grid-template-rows: auto 1fr;
  background-color: rgba(255, 255, 255, 0.03);
  border-color: var(--color-accent);
  color: var(--color-link-hover);
  outline: none;
}

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

/* Link label - lift effect on reveal */
.link-label {
  font-weight: 500;
  letter-spacing: 0.02em;
  transition:
    transform 300ms var(--ease-spring),
    letter-spacing 300ms var(--ease-quantum);
}

.link-card:hover .link-label,
.link-card:focus .link-label {
  transform: translateY(-2px);
  letter-spacing: 0.04em;
}

/* Link description - blur-to-sharp quantum reveal */
.link-description {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  filter: blur(4px);
  transform: translateY(-8px);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  transition:
    opacity 240ms ease 80ms,
    filter 320ms var(--ease-quantum) 40ms,
    transform 400ms var(--ease-spring);
}

.link-card:hover .link-description,
.link-card:focus .link-description {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
  padding-top: var(--spacing-xs);
}

/* Mobile touch support - two-tap pattern */
@media (hover: none) and (pointer: coarse) {
  .link-card {
    min-height: 48px;
  }
}

/* Light mode adjustments for link cards */
@media (prefers-color-scheme: light) {
  .link-card:hover,
  .link-card:focus {
    background-color: rgba(0, 0, 0, 0.03);
  }
}

/* Footer */
footer {
  text-align: center;
  padding: var(--spacing-md);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

footer a:hover {
  color: var(--color-link-hover);
}

/* Accessibility - reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  /* Quantum reveal: instant reveal without animation */
  .link-card {
    grid-template-rows: auto 0fr;
  }

  .link-card:hover,
  .link-card:focus {
    grid-template-rows: auto 1fr;
  }

  .link-description {
    filter: none;
    transform: none;
  }

  .link-card:hover .link-description,
  .link-card:focus .link-description {
    opacity: 1;
  }
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .link-list a {
    border-color: #ccc;
  }
}
