/* ============================================
   Geometric Analysis by the Andes
   Conference Website — Design Tokens & Styles
   ============================================ */

/* --- Art Direction ---
   Academic conference in geometric analysis / differential geometry.
   Palette: Deep slate blues + warm stone tones, evoking the Andes mountains.
   Typography: Authoritative serif display + clean sans body.
   Tone: Serious, scholarly, elegant.
*/

:root {
  /* Type Scale */
  --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(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

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

  /* Fonts */
  --font-display: 'DM Serif Display', 'Georgia', serif;
  --font-body: 'Source Sans 3', 'Helvetica Neue', sans-serif;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* --- Light Mode (Default) --- */
:root, [data-theme="light"] {
  --color-bg:             #f5f3ef;
  --color-surface:        #faf9f6;
  --color-surface-2:      #ffffff;
  --color-surface-offset: #eceae4;
  --color-divider:        #d8d5ce;
  --color-border:         #c9c5bc;

  --color-text:           #1a2332;
  --color-text-muted:     #5a6577;
  --color-text-faint:     #9aa3b0;

  --color-primary:        #1e3a5f;
  --color-primary-hover:  #152a45;
  --color-primary-active: #0f1e33;

  --color-accent:         #8b6f47;
  --color-accent-hover:   #725a38;

  --shadow-sm: 0 1px 2px rgba(26, 35, 50, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 35, 50, 0.08);
  --shadow-lg: 0 12px 32px rgba(26, 35, 50, 0.12);
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --color-bg:             #0f1419;
  --color-surface:        #161c24;
  --color-surface-2:      #1c242e;
  --color-surface-offset: #131920;
  --color-divider:        #252d38;
  --color-border:         #2e3844;

  --color-text:           #d4dae3;
  --color-text-muted:     #8895a5;
  --color-text-faint:     #566172;

  --color-primary:        #6b9fd4;
  --color-primary-hover:  #5588bf;
  --color-primary-active: #4172a8;

  --color-accent:         #c9a96e;
  --color-accent-hover:   #b8965a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #0f1419;
    --color-surface:        #161c24;
    --color-surface-2:      #1c242e;
    --color-surface-offset: #131920;
    --color-divider:        #252d38;
    --color-border:         #2e3844;
    --color-text:           #d4dae3;
    --color-text-muted:     #8895a5;
    --color-text-faint:     #566172;
    --color-primary:        #6b9fd4;
    --color-primary-hover:  #5588bf;
    --color-primary-active: #4172a8;
    --color-accent:         #c9a96e;
    --color-accent-hover:   #b8965a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  }
}

/* ========================
   LAYOUT & COMPONENTS
   ======================== */

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow 0.3s ease;
}

.nav--scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.nav-logo img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-logo-text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.nav-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--color-text);
}

.theme-toggle {
  padding: var(--space-2);
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}

/* Mobile menu */
.nav-mobile-btn {
  display: none;
  padding: var(--space-2);
  color: var(--color-text);
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-divider);
    padding: var(--space-4);
    gap: var(--space-4);
  }
  .nav-mobile-btn { display: block; }
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 20, 25, 0.45) 0%,
    rgba(15, 20, 25, 0.65) 50%,
    rgba(15, 20, 25, 0.85) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--content-default);
  margin-inline: auto;
  padding: var(--space-16) var(--space-4);
  text-align: center;
  color: #f0ede8;
}

.hero-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--space-8);
  border: 3px solid rgba(240, 237, 232, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-bottom: var(--space-4);
  color: #ffffff;
}

.hero-subtitle {
  font-size: var(--text-lg);
  font-weight: 300;
  color: rgba(240, 237, 232, 0.85);
  margin-bottom: var(--space-8);
  letter-spacing: 0.02em;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4) var(--space-8);
  font-size: var(--text-sm);
  color: rgba(240, 237, 232, 0.75);
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero-meta-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

/* --- Sections --- */
.section {
  padding: clamp(var(--space-12), 6vw, var(--space-24)) var(--space-4);
}

.section-alt {
  background: var(--color-surface);
}

.container {
  max-width: var(--content-default);
  margin-inline: auto;
}

.container-wide {
  max-width: var(--content-wide);
  margin-inline: auto;
}

.section-header {
  margin-bottom: var(--space-10);
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.section-header .accent-line {
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

.section-header p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-top: var(--space-3);
}

/* --- About --- */
.about-text p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: 1.7;
  margin-bottom: var(--space-4);
  max-width: 68ch;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.topic-card {
  background: var(--color-surface-2);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topic-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* --- Schedule Placeholder --- */
.schedule-placeholder {
  background: var(--color-surface-2);
  border: 2px dashed var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-12) var(--space-8);
  text-align: center;
}

.schedule-placeholder p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-inline: auto;
}

.schedule-placeholder .coming-soon {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

/* --- Speakers Placeholder --- */
.speakers-placeholder {
  background: var(--color-surface-2);
  border: 2px dashed var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-12) var(--space-8);
  text-align: center;
}

.speakers-placeholder p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-inline: auto;
}

.speakers-placeholder .coming-soon {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

/* --- Registration Placeholder --- */
.registration-placeholder {
  background: var(--color-surface-2);
  border: 2px dashed var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-12) var(--space-8);
  text-align: center;
}

.registration-placeholder p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-inline: auto;
}

.registration-placeholder .coming-soon {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

/* --- Organizers --- */
.organizers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-4);
}

.organizer-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
}

.organizer-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.organizer-affiliation {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* --- Venue --- */
.venue-intro {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: 1.7;
  margin-bottom: var(--space-6);
  max-width: 68ch;
}

.venue-detail-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.venue-detail-row svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.venue-detail-row .label {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.venue-detail-row p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.venues-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .venues-grid {
    grid-template-columns: 1fr;
  }
}

.venue-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.venue-card-info {
  padding: var(--space-6);
}

.venue-card-info h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.venue-card-info > p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.venue-detail {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.venue-detail svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.venue-detail div p {
  margin-bottom: 0;
}

.venue-detail .label {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.venue-detail p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.venue-map {
  border-top: 1px solid var(--color-divider);
  aspect-ratio: 16/10;
  flex-shrink: 0;
}

.venue-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Sponsors --- */
.sponsors-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8);
  align-items: center;
}

.sponsor-item {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}

.sponsor-item .sponsor-name {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

/* --- Footer --- */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  padding: var(--space-8) var(--space-4);
}

.footer-inner {
  max-width: var(--content-wide);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.footer-left {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer-right {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer-right a {
  color: var(--color-text-faint);
  text-decoration: none;
}

.footer-right a:hover {
  color: var(--color-text-muted);
}

/* --- Scroll Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Utility --- */
.text-center { text-align: center; }
