/* =================================================================
   კენწერო — Landing page styles
   Educational platform for Georgian national exam preparation
   ================================================================= */

/* ---- Design tokens ---- */
:root {
  /* Colors */
  --navy: #0A2754;
  --navy-hover: #061B3C;
  --gold: #E1A32E;
  --gold-soft: #FCF6EA;        /* icon-box tint, matches the icon artwork */
  --cream: #FDEFD8;            /* warm hero / navbar / top-wave (sampled from illustration) */
  --cream-light: #FFFBF4;      /* lighter cream used after the blue-gray section */
  --bluegray: #DDE6EC;         /* wavy section background */
  --white: #FFFFFF;            /* cards */
  --text: #0A2754;            /* primary text = navy */
  --text-muted: #5C6B82;       /* muted navy-gray-blue */

  /* Typography */
  --font: "Noto Sans Georgian", "BPG Nino Mtavruli", "Sylfaen", system-ui, sans-serif;

  /* Spacing scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 80px; --s-10: 120px;

  /* Radius */
  --r-pill: 999px;
  --r-card: 16px;
  --r-icon: 14px;

  /* Shadows */
  --shadow-card: 0 18px 40px -20px rgba(10, 39, 84, .22),
                 0 4px 12px -6px rgba(10, 39, 84, .08);
  --shadow-card-hover: 0 28px 56px -22px rgba(10, 39, 84, .30),
                       0 8px 18px -8px rgba(10, 39, 84, .12);
  --shadow-btn: 0 12px 26px -12px rgba(10, 39, 84, .55);

  /* Layout */
  --container: 1200px;
  --gutter: 24px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--cream-light);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---- Layout helper: centered content, max 1200, responsive gutters ---- */
.container {
  width: min(var(--container), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

/* =================================================================
   NAVBAR
   ================================================================= */
.navbar {
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar__inner {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
}
.navbar__logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .2px;
  flex-shrink: 0;
}
.navbar__nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: clamp(var(--s-5), 2.4vw, 44px);
}
.navbar__nav a {
  color: var(--navy);
  font-size: .95rem;
  font-weight: 500;
  opacity: .9;
  transition: opacity .2s ease, color .2s ease;
}
.navbar__nav a:hover { opacity: 1; color: var(--gold); }

.navbar__cta {
  flex-shrink: 0;
  background: var(--navy);
  color: var(--cream);
  font-weight: 600;
  font-size: .95rem;
  padding: 14px 26px;
  border-radius: var(--r-pill);
  transition: background .2s ease, transform .2s ease;
}
.navbar__cta:hover { background: var(--navy-hover); transform: translateY(-1px); }

/* Hamburger (hidden on desktop) */
.navbar__burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.navbar__burger span {
  display: block; width: 22px; height: 2px;
  background: var(--navy); border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}

/* =================================================================
   HERO
   ================================================================= */
.hero {
  position: relative;
  background-color: var(--cream);
  background-image: url("../assets/background.png");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: auto 100%;              /* illustration fills height on the left; cream fills the rest */
  min-height: clamp(560px, 52vw, 820px);
  display: flex;
  align-items: center;
}
.hero__art { display: none; }              /* shown only on the stacked (mobile/tablet) layout */
.hero .container {
  display: flex;
  justify-content: flex-end;               /* text block hugs the right, aligned to content edge */
}
.hero__text {
  width: min(560px, 100%);
  text-align: left;
}
.hero__title {
  color: var(--navy);
  font-weight: 600;
  font-size: clamp(1.85rem, 3vw, 2.75rem);
  line-height: 1.25;
  letter-spacing: -.5px;
}
.hero__subtitle {
  color: var(--text-muted);
  font-size: clamp(.95rem, 1.3vw, 1.05rem);
  line-height: 1.75;
  margin-top: var(--s-5);
}
.hero__actions {
  margin-top: var(--s-7);
  display: flex;
  align-items: center;
  gap: var(--s-5);
  flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--s-4);
  background: var(--navy);
  color: var(--cream);
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 10px 10px 26px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-btn);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn-primary:hover {
  background: var(--navy-hover);
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -14px rgba(10, 39, 84, .6);
}
.btn-primary__arrow {
  width: 34px; height: 34px;
  background: var(--white);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform .25s ease;
}
.btn-primary__arrow svg { width: 16px; height: 16px; }
.btn-primary:hover .btn-primary__arrow { transform: rotate(45deg); }

.btn-text {
  color: var(--navy);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 6px;
  position: relative;
}
.btn-text::after {
  content: "";
  position: absolute;
  left: 6px; right: 6px; bottom: 6px;
  height: 1.5px;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.btn-text:hover::after { transform: scaleX(1); }

/* =================================================================
   INTRO SECTION (wavy blue-gray) + FEATURE CARDS
   ================================================================= */
.intro {
  position: relative;
  background: var(--bluegray);
  margin-top: 0;
  padding-bottom: 230px;   /* bluegray tail so cards overlap onto the lighter cream */
}
.intro::before,
.intro::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  z-index: 1;
  background-repeat: no-repeat;
  background-size: 100% 100%;   /* stretch the wave to the element width */
  pointer-events: none;
}
/* top edge: warm hero cream curving down into the blue-gray */
.intro::before {
  top: -1px;
  height: clamp(68px, 9vw, 175px);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%201440%20120%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20fill%3D%27%23FDEFD8%27%20d%3D%27M0%2C0%20H1440%20V24%20C1250%2C104%201120%2C112%20970%2C90%20C840%2C71%20760%2C22%20600%2C34%20C450%2C45%20320%2C110%20160%2C104%20C100%2C102%2048%2C90%200%2C98%20Z%27%2F%3E%3C%2Fsvg%3E");
}
/* bottom edge: blue-gray curving down into the lighter #FFFBF4 */
.intro::after {
  bottom: -1px;
  height: clamp(58px, 8vw, 150px);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%201440%20120%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20fill%3D%27%23FFFBF4%27%20d%3D%27M0%2C120%20H1440%20V34%20C1250%2C2%201120%2C20%20970%2C40%20C840%2C57%20740%2C26%20580%2C18%20C430%2C11%20300%2C54%20150%2C58%20C92%2C60%2044%2C48%200%2C40%20Z%27%2F%3E%3C%2Fsvg%3E");
}
.intro__inner {
  position: relative;
  z-index: 2;
  padding-top: clamp(96px, 12vw, 200px);   /* clear the taller top wave */
}

/* Top row: heading (left) + paragraph & CTA (right) */
.intro__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--s-7), 6vw, 90px);
  align-items: start;
}
.intro__title {
  color: var(--navy);
  font-weight: 600;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.3;
  letter-spacing: -.3px;
}
.intro__title .comet {
  width: clamp(46px, 4.4vw, 66px);
  height: auto;
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  transform: translateY(-6px);
}
.intro__right { padding-top: var(--s-2); }
.intro__text {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
  max-width: 46ch;
}
.intro__cta { margin-top: var(--s-7); }

/* Cards grid — pulled up to overlap the blue-gray bottom edge */
.cards-wrap {
  background: var(--cream-light);
  padding-bottom: var(--s-9);
}
.cards {
  position: relative;
  z-index: 3;
  margin-top: -150px;             /* overlap: gap to text row stays ~80px */
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-5);
}

.card {
  background: var(--white);
  border-radius: var(--r-card);
  padding: var(--s-5);
  min-height: 328px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform .28s ease, box-shadow .28s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}
.card__icon {
  width: 52px; height: 52px;
  border-radius: var(--r-icon);
  background: var(--gold-soft);
  display: grid;
  place-items: center;
  margin-bottom: var(--s-5);
}
.card__icon img { width: 52px; height: 52px; }
.card__title {
  color: var(--navy);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.35;
  margin-bottom: var(--s-3);
}
.card__text {
  color: var(--text-muted);
  font-size: .92rem;
  line-height: 1.7;
}

/* =================================================================
   SUBJECTS SECTION (საგნები)
   ================================================================= */
.subjects {
  background: var(--cream-light);
  padding-block: clamp(56px, 8vw, 80px);
}
.subjects__inner {
  display: grid;
  grid-template-columns: 1.135fr 1fr;   /* ≈ 608 : 536 */
  gap: clamp(40px, 4.6vw, 56px);
  align-items: center;
}
/* text is first in DOM (reading order) but sits in the right column on desktop */
.subjects__cards { grid-area: 1 / 1; }
.subjects__text  { grid-area: 1 / 2; }

/* ---- Right column ---- */
.subjects__title {
  color: var(--navy);
  font-weight: 600;
  font-size: clamp(2.25rem, 4.4vw, 3.5rem);   /* ~36px → 56px */
  line-height: 1.1;
  letter-spacing: -.5px;
}
.subjects__lead {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 536px;
  margin-top: var(--s-5);          /* heading → paragraph 24px */
}
.checklist {
  margin-top: 28px;                /* paragraph → checklist */
  display: flex;
  flex-direction: column;
  gap: var(--s-4);                 /* rows 16px */
}
.checklist__item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);                 /* icon → text 12px */
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.5;
}
.checklist__icon {
  flex-shrink: 0;
  margin-top: 1px;
}
.subjects__cta { margin-top: var(--s-6); }   /* checklist → button 32px */

/* ---- Left column: 2x2 subject cards ---- */
.subjects__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-5);                 /* 24px */
}
.subject-card {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  border-radius: var(--r-card);
  padding: var(--s-5);
  min-height: 192px;
  box-shadow: 0 18px 38px -20px rgba(10, 39, 84, .45);
  display: flex;
  flex-direction: column;
}
.subject-card__title {
  color: var(--gold);
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: var(--s-3);
  position: relative;
  z-index: 1;
}
.subject-card__text {
  color: #C9D4E6;                  /* light cool text on navy */
  font-size: .9rem;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}
/* Decorative doodles — subtle, behind the text. PLACEHOLDERS for now. */
.subject-card__doodle {
  position: absolute;
  color: #FFFFFF;
  opacity: .10;
  pointer-events: none;
  z-index: 0;
}
.subject-card__doodle--curl  { right: 14px; bottom: 12px; width: 110px; }
.subject-card__doodle--loop  { right: 12px; top: 10px;    width: 110px; }
.subject-card__doodle--hash  { right: 16px; top: 12px;    width: 86px; }
.subject-card__doodle--arrow { right: 12px; top: 14px;    width: 116px; }

/* =================================================================
   ENTRANCE ANIMATION (page load)
   ================================================================= */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { opacity: 0; animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards; }
.d1 { animation-delay: .05s; }
.d2 { animation-delay: .15s; }
.d3 { animation-delay: .25s; }
.d4 { animation-delay: .35s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; }
  html { scroll-behavior: auto; }
  .card, .btn-primary, .navbar__cta { transition: none; }
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

/* Tablet: 2 cards per row */
@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, 1fr); }

  /* Hero stacks: illustration banner on top, text below */
  .hero {
    background-image: none;
    min-height: 0;
    display: block;
    padding-block: var(--s-6) var(--s-8);
  }
  .hero__art {
    display: block;
    width: 100%;
    max-width: 440px;
    height: auto;
    margin: 0 auto var(--s-6);
  }
  .hero .container { justify-content: center; }
  .hero__text { width: 100%; max-width: 600px; text-align: center; margin-inline: auto; }
  .hero__actions { justify-content: center; }
}

/* Collapse nav into a hamburger */
@media (max-width: 880px) {
  .navbar__nav,
  .navbar__cta { display: none; }
  .navbar__burger { display: flex; }

  .navbar__mobile {
    position: absolute;
    top: 96px; left: 0; right: 0;
    background: var(--cream);
    box-shadow: 0 16px 30px -18px rgba(10, 39, 84, .35);
    display: grid;
    gap: var(--s-2);
    padding: var(--s-4) var(--gutter) var(--s-6);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
  }
  .navbar.is-open .navbar__mobile {
    opacity: 1; transform: translateY(0); pointer-events: auto;
  }
  .navbar__mobile a {
    color: var(--navy);
    font-weight: 500;
    padding: 12px 8px;
    border-radius: 10px;
  }
  .navbar__mobile a:hover { background: rgba(10, 39, 84, .05); }
  .navbar__mobile .btn-primary { justify-content: space-between; margin-top: var(--s-3); }

  .navbar.is-open .navbar__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .navbar.is-open .navbar__burger span:nth-child(2) { opacity: 0; }
  .navbar.is-open .navbar__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Mobile: stack intro columns + single-column cards */
@media (max-width: 720px) {
  .intro__top { grid-template-columns: 1fr; gap: var(--s-6); }
  .intro__text { max-width: none; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn-primary { width: 100%; justify-content: space-between; }
}

/* Subjects: stack the two columns (text first, then cards) on tablet/below */
@media (max-width: 980px) {
  .subjects__inner { grid-template-columns: 1fr; gap: clamp(32px, 6vw, 48px); }
  .subjects__cards,
  .subjects__text { grid-area: auto; }      /* reset desktop placement → natural DOM order */
  .subjects__lead { max-width: none; }
}

/* Subjects cards → single column on small phones */
@media (max-width: 560px) {
  .subjects__cards { grid-template-columns: 1fr; }
  .subjects__cta { width: 100%; justify-content: space-between; }
}

/* Small phones: tighter gutter */
@media (max-width: 420px) {
  :root { --gutter: 16px; }
}

/* Desktop hides the mobile panel entirely */
@media (min-width: 881px) {
  .navbar__mobile { display: none; }
}
