/* =========================================================================
   alexandrfilonenko.com
   Academic, restrained design. Warm off-white, serif headlines, one accent.
   ========================================================================= */

:root {
  /* Palette */
  --bg:        #faf7f1;
  --bg-alt:    #f3ede1;
  --surface:   #ffffff;
  --text:      #1a1714;
  --text-soft: #4a463f;
  --muted:     #7a7368;
  --border:    #e6dfd0;
  --accent:    #7a1f1f;          /* dark wine — nod to Dante */
  --accent-soft: #9b3a3a;
  --accent-bg: #f4ebe6;

  /* Typography */
  --ff-serif: "Cormorant Garamond", "EB Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --ff-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-hero:   clamp(2.6rem, 6vw, 5.2rem);
  --fs-h2:     clamp(1.8rem, 3.2vw, 2.75rem);
  --fs-h3:     clamp(1.25rem, 2vw, 1.55rem);
  --fs-lede:   clamp(1.15rem, 1.6vw, 1.35rem);
  --fs-body:   1.0625rem;
  --fs-small:  0.9rem;

  --lh-tight:  1.15;
  --lh-normal: 1.65;
  --lh-loose:  1.8;

  --maxw:      1120px;
  --maxw-text: 780px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --space-7: 9rem;

  --radius: 2px;

  --shadow-sm: 0 1px 2px rgba(30, 20, 10, 0.04);
  --shadow:    0 4px 14px rgba(30, 20, 10, 0.06);

  --tr-fast:   160ms ease;
  --tr:        240ms ease;
}

/* =========================================================================
   Reset & base
   ========================================================================= */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--tr-fast);
}

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

ul, ol {
  padding-left: 1.2em;
}

h1, h2, h3, h4 {
  font-family: var(--ff-serif);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-hero); margin: 0 0 var(--space-3); }
h2 { font-size: var(--fs-h2);   margin: 0 0 var(--space-3); }
h3 { font-size: var(--fs-h3);   margin: 0 0 var(--space-2); }

p {
  margin: 0 0 var(--space-2);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-5) 0;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* =========================================================================
   Layout
   ========================================================================= */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: var(--maxw-text);
}

section {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
}

section:first-of-type {
  border-top: none;
}

.section-label {
  display: inline-block;
  font-family: var(--ff-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.section-lede {
  font-family: var(--ff-serif);
  font-size: var(--fs-lede);
  line-height: var(--lh-loose);
  color: var(--text-soft);
  max-width: 60ch;
  margin-bottom: var(--space-4);
  font-style: italic;
}

/* =========================================================================
   Header / Navigation
   ========================================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 241, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
  gap: var(--space-3);
}

.site-logo {
  font-family: var(--ff-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-logo__mark {
  color: var(--accent);
  font-style: italic;
  margin-right: 0.35em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 450;
  transition: color var(--tr-fast);
}

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

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  font-family: var(--ff-sans);
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius);
}

/* =========================================================================
   Hero
   ========================================================================= */

.hero {
  padding: clamp(4rem, 10vw, 8rem) 0 var(--space-6);
  border-top: none;
}

.hero__kicker {
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
  display: block;
}

.hero h1 {
  max-width: 16ch;
}

.hero__subtitle {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  color: var(--text-soft);
  margin-bottom: var(--space-4);
}

.hero__intro {
  max-width: 56ch;
  font-size: var(--fs-lede);
  line-height: var(--lh-loose);
  color: var(--text-soft);
}

.hero__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-top: var(--space-4);
  font-family: var(--ff-sans);
  font-size: 0.95rem;
}

.hero__quick a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.2em;
  transition: color var(--tr-fast), border-color var(--tr-fast);
}

.hero__quick a:hover {
  color: var(--accent);
  border-bottom-color: var(--text);
}

/* =========================================================================
   About / Biography
   ========================================================================= */

.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  align-items: start;
}

@media (min-width: 860px) {
  .about__grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.about__text {
  max-width: 60ch;
}

.about__text p {
  font-size: var(--fs-lede);
  line-height: var(--lh-loose);
  color: var(--text-soft);
}

.about__text p strong {
  color: var(--text);
  font-weight: 600;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--border);
}

.timeline li {
  position: relative;
  padding: 0 0 1.1rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-soft);
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.55em;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
}

.timeline__year {
  display: block;
  font-family: var(--ff-serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   Ideas / Concepts
   ========================================================================= */

.ideas__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.idea {
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.idea h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.idea p {
  font-size: 0.98rem;
  color: var(--text-soft);
  margin: 0;
}

.quotes {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}

.quote {
  padding: var(--space-3);
  border-left: 2px solid var(--accent);
  background: var(--bg-alt);
}

.quote p {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.quote cite {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* =========================================================================
   Books
   ========================================================================= */

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

.book {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.book:last-child { border-bottom: none; }

@media (min-width: 720px) {
  .book {
    grid-template-columns: 6rem 1fr;
    gap: var(--space-3);
  }
}

.book__year {
  font-family: var(--ff-serif);
  font-size: 1.5rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.book__body h3 {
  margin-bottom: 0.3rem;
  font-size: 1.4rem;
}

.book__meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.book__desc {
  color: var(--text-soft);
  max-width: 62ch;
  margin-bottom: 1rem;
}

.book__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.9rem;
}

.book__links a {
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.1em;
  transition: all var(--tr-fast);
}

.book__links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* =========================================================================
   Videos / Filters
   ========================================================================= */

.videos__note {
  background: var(--bg-alt);
  border-left: 2px solid var(--accent);
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-bottom: var(--space-4);
  max-width: 72ch;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-4);
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-group__label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-right: 0.5rem;
}

.chip {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-soft);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--tr-fast);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.videos__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-3);
}

.course-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--tr);
}

.course-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.course-card__platform {
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.course-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.course-card__desc {
  font-size: 0.92rem;
  color: var(--text-soft);
  line-height: 1.55;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.course-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.75rem;
  border-radius: 2px;
  letter-spacing: 0.02em;
}

.course-card__link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: auto;
}

.course-card__link::after {
  content: " →";
  transition: margin var(--tr-fast);
  display: inline-block;
}

.course-card__link:hover::after {
  margin-left: 0.25rem;
}

.videos__empty {
  text-align: center;
  padding: var(--space-5) var(--space-3);
  color: var(--muted);
  font-style: italic;
}

/* =========================================================================
   Schools
   ========================================================================= */

.schools__group {
  margin-bottom: var(--space-4);
}

.schools__group:last-child {
  margin-bottom: 0;
}

.schools__group h3 {
  font-size: 1.35rem;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.schools__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-2);
}

.school {
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.school__name {
  font-family: var(--ff-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.school__city {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.school__desc {
  font-size: 0.88rem;
  color: var(--text-soft);
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.school__link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--tr-fast);
}

.school__link:hover {
  border-bottom-color: var(--accent);
}

/* =========================================================================
   Links
   ========================================================================= */

.links__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.links__col h3 {
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: var(--space-2);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

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

.links__list li {
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.links__list a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: all var(--tr-fast);
}

.links__list a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.links__list small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

/* =========================================================================
   Contact / Disclaimer
   ========================================================================= */

.contact__box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-4);
  border-radius: var(--radius);
  max-width: 720px;
}

.contact__box p {
  color: var(--text-soft);
  margin-bottom: 1rem;
  line-height: 1.65;
}

.contact__box p:last-child {
  margin-bottom: 0;
}

.disclaimer {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-alt);
  border-left: 2px solid var(--accent);
  font-size: 0.92rem;
  color: var(--text-soft);
  max-width: 720px;
  line-height: 1.65;
}

/* =========================================================================
   Footer
   ========================================================================= */

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: var(--space-4) 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: var(--text-soft);
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 760px) {
  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 0.5rem;
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .menu-toggle {
    display: block;
  }

  section {
    padding: var(--space-5) 0;
  }

  .about__grid {
    gap: var(--space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
