/* ====== RESET & BASE ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

:root {
  color-scheme: light dark;
}

body {
  margin: 1rem;
  font-family: 'Outfit', Helvetica, Arial, sans-serif;
  background: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ====== CUSTOM PROPERTIES (Light & Dark) ====== */
/* ====== CUSTOM PROPERTIES (Light & Dark) ====== */
:root {
  --text-color: #000;
  --background-color: #fff;
  --header-overlay: rgba(0, 0, 0, 0);
  --info-box-bg: rgba(255, 255, 255, 0.25);
  --info-box-text: #18181a;
  --info-box-border: rgba(24, 24, 26, 0.3);
  --footer-text: #18181a;
  --hero-bg: #f6f5fb;
  --site-title-color: #18181a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #f5f5f5;
    --background-color: #1c1c1e;
    --header-overlay: rgba(0, 0, 0, 0.3);
    --info-box-bg: rgba(30, 30, 35, 0.6);
    --info-box-text: #fff;
    --info-box-border: rgba(255, 255, 255, 0.15);
    --footer-text: #fff;
    --hero-bg: #1c1c1e;
    --site-title-color: #fff;
  }
}

/* Manual Overrides */
html[data-theme="dark"] {
  --text-color: #f5f5f5;
  --background-color: #1c1c1e;
  --header-overlay: rgba(0, 0, 0, 0.3);
  --info-box-bg: rgba(30, 30, 35, 0.6);
  --info-box-text: #fff;
  --info-box-border: rgba(255, 255, 255, 0.15);
  --footer-text: #fff;
  --hero-bg: #1c1c1e;
  --site-title-color: #fff;
}

html[data-theme="light"] {
  --text-color: #000;
  --background-color: #fff;
  --header-overlay: rgba(0, 0, 0, 0);
  --info-box-bg: rgba(255, 255, 255, 0.25);
  --info-box-text: #18181a;
  --info-box-border: rgba(24, 24, 26, 0.3);
  --footer-text: #18181a;
  --hero-bg: #f6f5fb;
  --site-title-color: #18181a;
}

/* ====== TYPOGRAPHY & ICONS ====== */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 24px;
  display: inline-block;
  vertical-align: middle;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* ====== LAYOUT ====== */
.container {
  max-inline-size: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}

main.container {
  content-visibility: auto;
  contain-intrinsic-size: 600px;
}

footer.container {
  content-visibility: auto;
  contain-intrinsic-size: 220px;
  text-align: center;
  padding-block: 1rem;
  font-size: 0.9rem;
  color: var(--footer-text);
  margin-block-start: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.footer-actions .separator {
  color: var(--info-box-text);
  font-size: 1rem;
  padding-inline: 0.5rem;
}

/* ====== HERO & ACTIONS ====== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 2.17rem;
  min-block-size: clamp(60vh, 85vh, 1000px);
  inline-size: 100%;
  /* Explicit width to prevent collapse */
  background: var(--hero-bg);
  padding-block: 4rem;
  margin-block-end: 2.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  z-index: 0;
  border-radius: 1rem;
  background: var(--hero-bg);
  display: block;
  pointer-events: auto;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--header-overlay);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  pointer-events: none;
}

.hero-overlay>* {
  pointer-events: auto;
  background: none;
}

.site-title {
  font-family: 'Outfit', Helvetica, Arial, sans-serif;
  font-size: clamp(2.5rem, 8vw, 8rem);
  color: var(--site-title-color);
  white-space: nowrap;
  text-shadow: 0 0 12px #22222244, 0 2px 6px #ffffff60;
  margin-block-end: 1rem;
  font-weight: 700;
}

nav.desktop-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-block-start: 1rem;
}

.circular-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--info-box-bg);
  color: var(--info-box-text);
  border: 1px solid var(--info-box-border);
  inline-size: 2.5rem;
  block-size: 2.5rem;
  border-radius: 50%;
  overflow: visible;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
  /* Split transitions: Expand is springy (0.4s), Collapse is snappy (0.2s) */
  transition: inline-size 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    padding 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-radius 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    background 0.3s ease;
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  box-shadow:
    0 8px 32px -4px rgba(0, 0, 0, 0.1),
    0 2px 8px -1px rgba(0, 0, 0, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  /* Inner light ring */
}

.circular-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg,
      rgba(255, 255, 255, 0.2) 0%,
      rgba(255, 255, 255, 0.05) 40%,
      transparent 100%);
  mix-blend-mode: overlay;
  opacity: 0.6;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}


.circular-btn .text {
  display: inline-block;
  margin-inline-start: 0;
  max-inline-size: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  font-size: 1.2rem;
  font-family: 'Outfit', Helvetica, Arial, sans-serif;
  transition: max-inline-size 0.2s ease-out, margin-inline-start 0.2s ease-out, opacity 0.2s ease-out;
}

.circular-btn:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {

  .circular-btn:hover,
  .circular-btn:focus,
  .circular-btn.expanded {
    inline-size: auto;
    padding-inline: 0.75rem;
    border-radius: 2rem;
    transition: inline-size 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), padding 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .circular-btn:hover .text,
  .circular-btn:focus .text,
  .circular-btn.expanded .text {
    margin-inline-start: 0.5rem;
    max-inline-size: 200px;
    opacity: 1;
    transition: max-inline-size 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), margin-inline-start 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}

.circular-btn.expanded {
  inline-size: auto;
  padding-inline: 0.75rem;
  border-radius: 2rem;
  transition: inline-size 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), padding 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.circular-btn.expanded .text {
  margin-inline-start: 0.5rem;
  max-inline-size: 200px;
  opacity: 1;
  transition: max-inline-size 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), margin-inline-start 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.desktop-actions .separator {
  color: var(--info-box-text);
  font-size: 1rem;
  padding-inline: 0.5rem;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  nav.desktop-actions {
    display: none;
  }

  .site-title {
    font-size: clamp(2.5rem, 12vw, 5rem);
  }

  .hero {
    min-block-size: 50vh;
    padding-block: 1.5rem;
  }

  header {
    margin-block-end: 2rem;
  }
}

@media (min-width: 769px) {
  .footer-actions {
    display: none;
  }
}

@media (max-width: 360px) {
  .site-title {
    white-space: normal;
    line-height: 1.1;
  }
}

/* ====== REDUCED MOTION ====== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition: none !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .circular-btn,
  .circular-btn .text {
    transition: none !important;
  }
}