/* =========================================================
   Redesign — base palette, typography, header, #home hero
   Plain CSS (Propshaft does not compile SCSS).
   ========================================================= */

:root {
  /* ============================================================
     Palette — Ink-forward system. 3 core hues (base neutral · ink ·
     sage) + white + derived neutral tints. No separate beige.
     Light sections punctuated by one dark (ink) surface moment.
     ============================================================ */

  /* Surface — base neutral is a soft warm near-white (replaces the
     yellowish #F3ECDF). --bg-cream keeps its name so all references
     update automatically, but it is now the clean base neutral. */
  --bg-cream:        #F6F4EF;  /* page base */
  --bg-cream-soft:   #FBFAF6;  /* lifted panels */
  --bg-card:         #FFFFFF;  /* white cards */

  /* Dark surface (ink-forward accent moment) */
  --surface-dark:    #23231F;  /* dark CTA card / dark sections */
  --on-dark:         #EDE7D9;  /* cream text/detail on dark */
  --on-dark-muted:   #B7B1A3;  /* muted text on dark */

  /* Sage accent (the single brand accent) */
  --sage:            #8A9573;
  --sage-dark:       #6E7A58;
  --sage-soft:       #C4CDB2;
  --sage-tint:       #E7EBDD;

  /* Buttons — repointed from beige to deep olive (the sage family)
     so every existing var(--btn-accent) usage becomes on-brand. */
  --btn-accent:      #6E7A58;
  --btn-accent-dark: #5C6749;
  --btn-accent-tint: #E7EBDD;

  /* Derived neutral tints (for chips / soft fills / hovers) */
  --bg-subtle:       #ECE9E1;
  --bg-subtle-hover: #E4E0D6;

  /* Ink (text + doubles as the dark surface hue) */
  --ink:             #23231F;
  --ink-soft:        #55534C;
  --ink-muted:       #837F76;

  /* Lines */
  --line:            rgba(35, 35, 31, 0.10);

  /* Legacy aliases — kept so unchanged sections still render */
  --primary-color:   var(--sage);
  --secondary-color: var(--bg-cream);
  --font-color:      var(--ink);

  --radius-sm:       8px;
  --radius-md:       16px;
  --radius-lg:       28px;
  --radius-pill:     999px;

  --border-radius:   var(--radius-sm);
  --box-shadow:      0 18px 40px rgba(35, 35, 31, 0.12);
  --text-shadow:     none;

  --header-height:   96px;

  /* Lora — warm literary serif with full Cyrillic; Manrope — humanist sans, both Cyrillic */
  --font-serif:      "Lora", Georgia, serif;
  --font-sans:       "Manrope", system-ui, sans-serif;
}

html, body {
  background-color: var(--bg-cream);
  color: var(--ink);
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
}

/* =========================================================
   Header — fixed, transparent, sits on top of #home
   ========================================================= */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 clamp(20px, 4vw, 56px);
  background: transparent;
  pointer-events: none;
}

header > * { pointer-events: auto; }

.header-logo {
  display: flex;
  /* align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink); */
  max-width: clamp(190px, 20vw, 230px);
  /* filter: invert(1) sepia(1) saturate(0) brightness(1.1) hue-rotate(20deg); */
}

.header-monogram {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--sage-dark);
  background: var(--bg-cream-soft);
  border: 1px solid var(--sage-soft);
  letter-spacing: 0.5px;
}

.header-brand {
  height: 100%;
  padding: 2px 0;
}

.header-brand img {
  max-height: 100%;
}

.header-brand-text { display: flex; flex-direction: column; line-height: 1.2; }

.header-brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}

.header-brand-subtitle {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.header-nav a {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--sage-dark);
  background-color: rgba(126, 137, 103, 0.08);
}

.header-nav a div { display: inline; }

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: var(--btn-accent);
  color: #fff;
  font-size: 15px;
  text-decoration: none;
  border-radius: var(--radius-pill);
  border: 1px solid var(--btn-accent);
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

.header-cta * { color: #fff; }

.header-cta:hover {
  background: var(--btn-accent-dark);
  border-color: var(--btn-accent-dark);
  transform: translateY(-1px);
}

.header-cta .arrow {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Mobile toggle (hidden on desktop) */
header .toggle.for-mobile { display: none; }

/* =========================================================
   #home hero — full viewport, left text + right photo
   ========================================================= */

section#home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(28px, 4vw, 72px);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100vh;
  max-height: 100dvh;
  background: var(--bg-card);
  /* small top gap under the header, no bottom padding so the photo can sit on the bottom edge */
  padding: calc(var(--header-height) - 8px) clamp(24px, 4vw, 72px) 0;
  overflow: hidden;
  position: relative;
}

.home-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(12px, 1.6vh, 18px);
  height: 100%;
  padding: clamp(8px, 2vh, 24px) 0 clamp(48px, 10vh, 96px);
  position: relative;
  z-index: 2;
  min-width: 0;
}

.home-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  line-height: 1.14;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.home-name {
  display: block;
  /* override the global `* { font-size:16px }` reset so it matches the title size */
  font-size: inherit;
}

.home-subtitle {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.55;
  color: var(--ink-muted);
}

.home-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
  max-width: 560px;
}

.btn-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* .btn-ic img {
  width: 24px;
  height: 24px;
  filter: invert(1) sepia(1) saturate(0) brightness(1.1) hue-rotate(20deg);
} */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  font-size: 15px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--btn-accent);
  color: #fff;
  border-color: var(--btn-accent);
}
.btn-primary * { color: #fff; }
.btn-primary:hover { background: var(--btn-accent-dark); border-color: var(--btn-accent-dark); transform: translateY(-1px); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--btn-accent);
}
.btn-secondary:hover { background: var(--btn-accent-tint); }

.btn-primary .arrow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Goals — light card: centered intro line + 3 icon+caption columns */

.home-goals {
  border: 1px solid var(--btn-accent);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.6vh, 20px);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 1.8vw, 26px) clamp(12px, 1.4vw, 22px);
  /* layered shadow (incl. a soft top glow) so the frame reads against the white section */
  box-shadow: 0 14px 34px rgba(45, 45, 42, 0.10), 0 -4px 18px rgba(45, 45, 42, 0.05);
  max-width: 560px;
  /* push the goals + buttons group toward the bottom of the column
     (the .home-left padding-bottom keeps an indent from the bottom edge) */
  margin-top: auto;
}

.home-goals-title {
  margin: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  font-weight: 500;
  color: var(--ink);
}

.home-goals-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.home-goal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 0 clamp(8px, 1vw, 18px);
}

.home-goal + .home-goal {
  border-left: 1px solid var(--line);
}

.home-goal-icon {
  width: clamp(52px, 4vw, 64px);
  height: clamp(52px, 4vw, 64px);
  border-radius: 50%;
  background: var(--sage-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  flex-shrink: 0;
}

.home-goal-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-goal-caption, .home-goal-caption b {
  font-size: clamp(0.72rem, 0.85vw, 0.85rem);
  color: var(--ink);
  line-height: 1.4;
}

.home-goal-caption {
  font-weight: 500;
}

/* Right column — photo with rounded corners */

.home-right {
  position: relative;
  min-width: 0;
  height: 100%;
  align-self: end;
}

.home-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* keep the face in frame — anchor the crop to the top of the image */
  object-position: 50% 20%;
  border-radius: clamp(24px, 2.4vw, 40px) clamp(24px, 2.4vw, 40px) 0 0;
  display: block;
}

/* Short / landscape viewports: let the hero grow and scroll instead of
   squashing the photo. */
@media (max-height: 600px) {
  section#home {
    height: auto;
    max-height: none;
    min-height: 600px;
  }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 768px) {
  :root { --header-height: 72px; }

  header { gap: 16px; padding: 0 16px; }

  .header-brand-text { display: none; }
  .header-nav { display: none; }
  .header-cta { padding: 10px 18px; font-size: 13px; }
  .header-cta .arrow { display: none; }

  .header-logo {
    filter: invert(1) sepia(1) saturate(0) brightness(1.1) hue-rotate(20deg);
  }

  /* Mobile hero — stack: photo on top, then text + goals + buttons */
  section#home {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    background: var(--bg-card);
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
    padding: 60px 16px 32px;
    gap: 22px;
  }

  .home-right {
    order: -1;
    min-width: 0;
    /* reset desktop align-self:end / height:100% so the photo fills the
       full content width and its own height */
    align-self: stretch;
    width: 100%;
    height: auto;
  }

  .home-photo {
    width: 100%;
    height: 60vh;
    border-radius: 24px;
  }

  .home-title {
    font-size: clamp(1.7rem, 7.5vw, 2.3rem);
  }

  .home-subtitle {
    max-width: none;
  }

  /* Goals stack into rows (icon left, caption right); divider becomes a top rule */
  .home-goals {
    max-width: none;
    padding: 18px;
  }

  .home-goals-row {
    grid-template-columns: 1fr;
  }

  .home-goal {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 16px;
    padding: 16px 0;
  }

  .home-goal + .home-goal {
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .home-cta-group {
    max-width: none;
  }

  .home-cta-group .btn-primary,
  .home-cta-group .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .home-cta-group .btn-primary,
  .home-cta-group .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   #education — header "PRO освіту" + graduation cap, then 3 cream
   cards (top) and 2 warm cards (bottom). Section grows past 100vh
   if a card's text requires it (top-row card 3 has the most copy).
   ========================================================= */

section#education {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-cream);
  padding: 0 clamp(24px, 4vw, 64px) clamp(24px, 4vh, 48px);
  gap: clamp(24px, 3.5vh, 48px);
}

/* ---------- Full-width feature image (edge-to-edge, top of section) ---------- */

.education-feature-image {
  margin: 0 calc(-1 * clamp(24px, 4vw, 64px));
}

.education-feature-image img {
  display: block;
  width: 100%;
  height: clamp(280px, 40vh, 500px);
  object-fit: cover;
  object-position: center;
}

.education-title-row {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding-top: 70px;
  padding-bottom: 30px;
}

.education-title-row .rule {
  flex: 1;
  height: 1px;
  background: var(--sage-soft);
}

.education-title {
  margin: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Card grids ---------- */

.education-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 450px));
  justify-content: center;
  gap: 24px;
}

.education-grid.education-grid-wide {
  grid-template-columns: repeat(2, minmax(0, 450px));
}

/* ---------- Card: image on top, then title + divider + description ---------- */

section#education .edu-card {
  background: var(--bg-card);
  color: var(--ink);
  border-radius: 20px;
  padding: clamp(12px, 1vw, 16px) clamp(12px, 1vw, 16px) clamp(20px, 2vw, 30px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 16px rgba(45, 45, 42, 0.05);
}

.edu-card-image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.edu-card-image img {
  display: block;
  width: 100%;
  height: clamp(150px, 15vw, 210px);
  object-fit: cover;
  object-position: center;
}

.edu-card-title {
  margin: clamp(16px, 1.4vw, 22px) clamp(6px, 1vw, 16px) 0;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.3vw, 1.35rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

.edu-card-divider {
  width: 100%;
  height: 1px;
  margin: clamp(14px, 1.4vw, 20px) 0 0;
  background: rgba(45, 45, 42, 0.14);
}

.edu-card-description {
  margin: clamp(16px, 1.6vw, 22px) clamp(6px, 1vw, 16px) 0;
  font-size: clamp(0.82rem, 0.95vw, 0.95rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

@media (max-width: 768px) {
  section#education {
    padding: 0 16px 48px;
    gap: 16px;
  }

  .education-grid,
  .education-grid.education-grid-wide {
    grid-template-columns: 1fr;
    flex: none;
  }

  .edu-card-image img {
    height: 200px;
  }
}

.for-mobile { display: none; }

/* =========================================================
   #gallery — "Дипломи та сертифікати" custom carousel.
   Behaviour (drag, autoplay, dots, modal) lives in application.css and
   slider.js; this block only re-skins it for the new palette, which the
   old #D9D9D9 / #efefef / slate-blue treatment clashed with.
   ========================================================= */

#gallery {
  background-color: var(--bg-cream);
  min-height: 0;
}

.cert-slider {
  background: var(--bg-cream);
  padding: clamp(48px, 8vh, 88px) clamp(24px, 4vw, 64px);
}

.cert-title {
  /* inline-block so the box hugs the text — lets the underline span the
     title's own width rather than a fixed length */
  display: inline-block;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 40px;
}

/* Sage rule under the title — full width of the title text */
.cert-title::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  margin: 18px auto 0;
  background: var(--sage-soft);
}

.cert-subtitle {
  max-width: 620px;
  /* larger gap down to the certificates themselves */
  margin: 0 auto clamp(56px, 9vh, 104px);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.slider-track {
  gap: clamp(16px, 1.8vw, 32px);
}

.slide {
  width: clamp(240px, 30vw, 360px);
  height: clamp(180px, 22vw, 260px);
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(45, 45, 42, 0.05);
}

.slide img {
  border-radius: 24px;
  padding: 10px;
}

/* Loading spinner — the old rule used --secondary-color, which the redesign
   remapped to cream, leaving it near-invisible against the card. */
.slide:before {
  border-color: var(--sage-soft);
  border-top-color: var(--sage);
}

.pagination { margin-top: clamp(24px, 4vh, 40px); }

.pagination-dot { background: var(--sage-soft); }

.pagination-dot.active { background: var(--sage); }

@media (max-width: 768px) {
  .cert-slider { padding: clamp(40px, 6vh, 64px) 0; }

  .cert-title,
  .cert-subtitle { padding: 0 16px; }

  .slide {
    width: min(300px, 82vw);
    height: min(220px, 60vw);
  }
}
