/* Design tokens */
:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-heading: #0f172a;
  --color-accent: #0d9488;
  --color-accent-hover: #0f766e;
  --color-accent-soft: rgba(13, 148, 136, 0.12);
  --color-border: #e2e8f0;
  --color-nav-bg: rgba(15, 23, 42, 0.92);
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --radius: 12px;
  --radius-lg: 16px;
  --max-width: 1100px;
  --nav-height: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-hover);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--color-heading);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h3 { font-size: 1.35rem; }

p {
  margin: 0 0 1rem;
}

/* Navigation */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--color-nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-nav__inner {
  width: 100%;
  height: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
}

.site-nav__brand {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.site-nav__brand:hover {
  color: #99f6e4;
}

.site-nav__links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
  flex-shrink: 0;
}

.site-nav__links a {
  display: block;
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.site-nav__links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.site-nav__toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: url("../wallpaper.jpg") center / cover no-repeat;
  z-index: 0;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.35) 0%,
    rgba(15, 23, 42, 0.6) 45%,
    rgba(15, 23, 42, 0.85) 100%
  );
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero__eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #5eead4;
  margin-bottom: 1rem;
}

.hero__title {
  color: #fff;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

.hero__content .hero__eyebrow,
.hero__content .hero__subtitle {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.hero__subtitle {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2rem;
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: bounce 2s infinite;
}

.hero__scroll::after {
  content: "";
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.6), transparent);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.btn--dark {
  background: var(--color-heading);
  color: #fff;
}

.btn--dark:hover {
  background: #334155;
  color: #fff;
}

/* Sections */
.section {
  padding: 5rem 1.5rem;
}

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

.section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem;
}

.section__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.section__lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* About */
.about-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.about-card p {
  text-align: left;
  font-size: 1.05rem;
}

/* Lists */
.content-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.content-list__item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.content-list__item:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.content-list__item a {
  font-weight: 600;
}

.content-list__number {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  line-height: 1.75rem;
  text-align: center;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-right: 0.75rem;
  vertical-align: middle;
}

/* Horizontal auto-scrolling slideshow */
.slideshow {
  margin-top: 3rem;
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
}

.slideshow__track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: slideshow-scroll 45s linear infinite;
}

.slideshow:hover .slideshow__track {
  animation-play-state: paused;
}

@keyframes slideshow-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.slideshow__slide {
  flex: 0 0 auto;
  width: min(420px, 75vw);
  height: 280px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.slideshow__slide:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.slideshow__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

/* Course notes (classes page) */
.notes-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.notes-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
}

.notes-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.notes-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.notes-card__links {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.notes-card__links a {
  font-weight: 600;
  font-size: 0.95rem;
}

.notes-card__links a::after {
  content: " →";
  opacity: 0;
  transition: opacity 0.2s;
}

.notes-card__links a:hover::after {
  opacity: 1;
}

/* Page header (inner pages) */
.page-hero {
  padding: calc(var(--nav-height) + 4rem) 1.5rem 3rem;
  text-align: center;
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
  color: #fff;
}

.page-hero h1 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  margin: 0;
}

/* Footer */
.site-footer {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: rgba(255, 255, 255, 0.85);
  padding: 4rem 1.5rem 2rem;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
}

.site-footer h3,
.site-footer h4 {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.site-footer p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

.site-footer a {
  color: #5eead4;
}

.site-footer a:hover {
  color: #99f6e4;
}

.site-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer__links li {
  margin-bottom: 0.5rem;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: background 0.2s;
}

.social-links a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.social-links img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
}

.site-footer__bottom {
  max-width: var(--max-width);
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Scroll to top */
.scroll-top {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background 0.2s, transform 0.2s;
}

.scroll-top:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
}

.scroll-top.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal (classes password) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--color-surface);
  padding: 2rem;
  width: 360px;
  max-width: calc(100% - 2rem);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  margin-bottom: 0.5rem;
}

.modal .hint {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.modal input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-family: inherit;
}

.modal input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.modal .buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.modal .error {
  color: #dc2626;
  font-size: 0.85rem;
  display: none;
  margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 900px) {
  .slideshow__slide {
    width: min(340px, 80vw);
    height: 240px;
  }

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .site-nav__toggle {
    display: block;
  }

  .site-nav__links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    margin-left: 0;
    flex-direction: column;
    background: var(--color-nav-bg);
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .site-nav__links.open {
    display: flex;
  }

  .site-nav__links a {
    padding: 0.75rem 1rem;
  }

  .slideshow__slide {
    width: min(300px, 85vw);
    height: 220px;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }
}
