/* Matieka.lt — pagrindinis stilius */
:root {
  --green: #29866b;
  --green-dark: #1d5f4c;
  --green-light: #4cc9a4;
  --green-pale: #d5f2ea;
  --green-bg: #f2faf7;
  --ink: #173e4c;
  --ink-soft: #4d6b76;
  --white: #fff;
  --line: #dcebe6;
  --wa: #25d366;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(23, 62, 76, .08);
  --shadow-lg: 0 20px 50px rgba(23, 62, 76, .14);
  --max: 1160px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html { overflow-x: hidden; }
.hero-grid > *, .split > *, .grid > * { min-width: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; transition: color .2s; }
a:hover { color: var(--green-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.section { padding: 90px 0; }
.section--tint { background: var(--green-bg); }
.section--dark { background: var(--ink); color: #dfeef0; }
.section--dark h2, .section--dark h3 { color: var(--white); }
.eyebrow {
  display: inline-block;
  font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--green); background: var(--green-pale);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.section-head { text-align: center; max-width: 720px; margin: 0 auto 50px; }
.section-head p { color: var(--ink-soft); }
.text-green { color: var(--green); }

/* ---------- Mygtukai ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 600; font-size: 1rem;
  padding: 14px 28px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s, color .2s;
  text-decoration: none; line-height: 1.2;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--green); color: var(--white); box-shadow: 0 8px 20px rgba(41, 134, 107, .3); }
.btn--primary:hover { background: var(--green-dark); color: var(--white); }
.btn--outline { border-color: var(--green); color: var(--green); background: transparent; }
.btn--outline:hover { background: var(--green); color: var(--white); }
.btn--wa { background: var(--wa); color: var(--white); box-shadow: 0 8px 20px rgba(37, 211, 102, .3); }
.btn--wa:hover { background: #1eb457; color: var(--white); }
.btn--white { background: var(--white); color: var(--green); }
.btn--white:hover { color: var(--green-dark); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 20px; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 700; font-size: 1.3rem; }
.logo img { width: 54px; height: 54px; }
.logo span b { color: var(--green); }
.logo:hover { color: var(--ink); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav > ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.nav li { position: relative; }
.nav a.nav-link {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px; border-radius: 999px;
  color: var(--ink); font-weight: 500; font-size: .95rem;
}
.nav a.nav-link:hover, .nav a.nav-link.active { color: var(--green); background: var(--green-bg); }
.nav .caret { width: 14px; height: 14px; transition: transform .2s; }
.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 210px;
  list-style: none; margin: 0; padding: 8px;
  background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s;
}
.has-dropdown:hover .dropdown, .has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.has-dropdown:hover .caret { transform: rotate(180deg); }
.dropdown a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--ink); font-size: .95rem; }
.dropdown a:hover { background: var(--green-bg); color: var(--green); }
.header-cta { padding: 11px 20px; font-size: .9rem; }

.menu-toggle {
  display: none; width: 46px; height: 46px; border: 0; border-radius: 12px;
  background: var(--green-bg); color: var(--green); cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-toggle svg { width: 24px; height: 24px; }

@media (max-width: 1020px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0;
    flex-direction: column; align-items: stretch; gap: 16px;
    background: var(--white); padding: 20px; overflow-y: auto;
    transform: translateX(100%); visibility: hidden; transition: transform .3s, visibility .3s;
  }
  .nav.open { transform: translateX(0); visibility: visible; }
  .nav > ul { flex-direction: column; }
  .nav a.nav-link { padding: 14px 16px; font-size: 1.05rem; border-radius: 10px; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding: 0 0 0 16px; }
  .header-cta { width: 100%; padding: 15px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--green-bg) 0%, #fff 60%);
  padding: 80px 0 100px;
}
.hero::before {
  content: ""; position: absolute; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 201, 164, .22), transparent 70%);
  top: -200px; right: -150px;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 50px; align-items: center; }
.hero h1 span { color: var(--green); }
.hero .lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 580px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 36px; margin-top: 44px; }
.hero-stats strong { display: block; font-size: 1.8rem; color: var(--green); line-height: 1.1; }
.hero-stats small { color: var(--ink-soft); font-size: .88rem; }
.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-visual .blob {
  width: min(420px, 100%); aspect-ratio: 1;
  background: var(--white); border-radius: 50%;
  box-shadow: var(--shadow-lg); padding: 30px;
  display: flex; align-items: center; justify-content: center;
}
.hero-visual .blob img { border-radius: 50%; }
.float-card {
  position: absolute; background: var(--white); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: .88rem; font-weight: 600;
  animation: float 4s ease-in-out infinite;
}
.float-card .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--green-pale); color: var(--green); display: grid; place-items: center; font-size: 1.1rem; }
.float-card--1 { top: 8%; left: 0; }
.float-card--2 { bottom: 10%; right: 0; animation-delay: 1.5s; }
@keyframes float { 50% { transform: translateY(-10px); } }

@media (max-width: 900px) {
  .hero { padding: 50px 0 70px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-visual .blob { width: min(300px, 80%); }
  .float-card { display: none; }
}

/* ---------- Page hero (vidiniai puslapiai) ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--ink) 0%, var(--green-dark) 100%);
  color: #dfeef0; padding: 70px 0 60px; text-align: center; position: relative; overflow: hidden;
}
.page-hero::after {
  content: "∑ π √ ∫ x² Δ ∞"; position: absolute; inset: auto 0 -20px; font-size: 6rem; font-weight: 700;
  color: rgba(255, 255, 255, .04); white-space: nowrap; letter-spacing: .3em; pointer-events: none;
}
.page-hero h1 { color: var(--white); margin-bottom: .3em; }
.page-hero p { max-width: 640px; margin: 0 auto; opacity: .85; }
.breadcrumb { font-size: .85rem; margin-bottom: 14px; opacity: .8; }
.breadcrumb a { color: var(--green-light); }

/* ---------- Kortelės ---------- */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card .icon {
  width: 56px; height: 56px; border-radius: 14px; background: var(--green-pale); color: var(--green);
  display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 18px;
}
.card .icon svg { width: 28px; height: 28px; }
.card p { color: var(--ink-soft); margin: 0; }

.subject-card { display: flex; flex-direction: column; text-align: center; align-items: center; color: var(--ink); }
.subject-card:hover { color: var(--ink); }
.subject-card .icon { width: 76px; height: 76px; border-radius: 50%; font-size: 2rem; font-weight: 700; }
.subject-card .more { margin-top: 16px; color: var(--green); font-weight: 600; font-size: .92rem; }

/* ---------- Split (tekstas + vaizdas) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 36px; } }
.checklist { list-style: none; padding: 0; margin: 24px 0 0; }
.checklist li { position: relative; padding-left: 36px; margin-bottom: 14px; }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--green); color: var(--white); font-size: .8rem; font-weight: 700; display: grid; place-items: center;
}
.feature-box {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%); color: var(--white);
  border-radius: 24px; padding: 44px; position: relative; overflow: hidden;
}
.feature-box h3 { color: var(--white); font-size: 1.5rem; }
.feature-box::after { content: "√x"; position: absolute; right: -10px; bottom: -40px; font-size: 10rem; font-weight: 700; opacity: .08; }
.feature-box .formula { font-family: 'Times New Roman', serif; font-style: italic; font-size: 1.4rem; opacity: .9; margin-top: 20px; }

/* ---------- Mokytojai ---------- */
.teacher { display: grid; grid-template-columns: 340px 1fr; gap: 50px; align-items: start; padding: 50px 0; border-bottom: 1px solid var(--line); }
.teacher:last-child { border-bottom: 0; }
.teacher:nth-child(even) { grid-template-columns: 1fr 340px; }
.teacher:nth-child(even) .teacher-photo { order: 2; }
.teacher-photo { position: sticky; top: calc(var(--header-h) + 20px); }
.teacher-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 24px; box-shadow: var(--shadow-lg); }
.teacher video.teacher-video { width: 100%; aspect-ratio: 16 / 9; background: var(--ink); border-radius: 20px; box-shadow: var(--shadow-lg); display: block; margin: 8px 0 24px; }
.teacher-photo::before {
  content: ""; position: absolute; inset: 16px -16px -16px 16px; border: 3px solid var(--green-light); border-radius: 24px; z-index: -1;
}
.teacher .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tag { background: var(--green-pale); color: var(--green-dark); font-size: .8rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.teacher h2 { margin-bottom: .3em; }
.teacher p { color: var(--ink-soft); }
@media (max-width: 860px) {
  .teacher, .teacher:nth-child(even) { grid-template-columns: 1fr; gap: 30px; }
  .teacher:nth-child(even) .teacher-photo { order: 0; }
  .teacher-photo { position: relative; top: 0; max-width: 320px; }
}

.teacher-mini { text-align: center; }
.teacher-mini img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px; border: 5px solid var(--green-pale); }
.teacher-mini h3 { margin-bottom: .2em; }
.teacher-mini small { color: var(--green); font-weight: 600; }

/* ---------- Kainos / užsakymas ---------- */
.plan { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; padding: 40px 26px; }
.plan h3 { font-size: 1.35rem; }
.plan .meta { color: var(--ink-soft); margin-bottom: 20px; }
.plan .badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: var(--white); font-size: .75rem; font-weight: 600; padding: 5px 14px; border-radius: 999px;
}
.plan--featured { border: 2px solid var(--green); box-shadow: var(--shadow); }
.plan stripe-buy-button { margin-top: auto; width: 100%; display: block; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; text-align: left; width: 100%; }
.plan ul li { padding: 8px 0 8px 28px; border-bottom: 1px dashed var(--line); position: relative; font-size: .95rem; }
.plan ul li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

/* ---------- Video ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 40px; }
.tab {
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  padding: 10px 20px; border-radius: 999px; border: 2px solid var(--line); background: var(--white); color: var(--ink);
  transition: .2s;
}
.tab:hover { border-color: var(--green); color: var(--green); }
.tab.active { background: var(--green); border-color: var(--green); color: var(--white); }
.video-group { display: none; }
.video-group.active { display: block; animation: fade .3s; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
.video-group h2 { text-align: center; }
.video-group > p { text-align: center; color: var(--ink-soft); margin-bottom: 30px; }
.video-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.video-card .label { padding: 14px 18px; font-weight: 600; font-size: .95rem; }
.yt {
  position: relative; aspect-ratio: 16 / 9; background: #000 center / cover no-repeat; cursor: pointer;
  border: 0; padding: 0; width: 100%; display: block;
}
.yt::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0, 0, 0, .35)); transition: .2s; }
.yt:hover::after { background: rgba(23, 62, 76, .25); }
.yt .play {
  position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 68px; border-radius: 50%; background: var(--green); display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transition: transform .2s;
}
.yt:hover .play { transform: translate(-50%, -50%) scale(1.1); }
.yt .play svg { width: 26px; height: 26px; fill: #fff; margin-left: 4px; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Pamoka (Whereby) ---------- */
.room-wrap { background: var(--white); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.room-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; background: var(--ink); color: #fff; }
.room-bar .live { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.room-bar .live::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green-light); box-shadow: 0 0 0 4px rgba(76, 201, 164, .3); }
.room-bar a { color: var(--green-light); font-size: .9rem; font-weight: 500; }
.room-frame { width: 100%; height: min(78vh, 760px); border: 0; display: block; background: #0f2a33; }
.room-tips { margin-top: 30px; }

/* ---------- Atsiliepimai ---------- */
.masonry { columns: 3 300px; column-gap: 22px; }
.masonry figure {
  break-inside: avoid; margin: 0 0 22px; background: var(--white); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); cursor: zoom-in; transition: transform .2s;
}
.masonry figure:hover { transform: scale(1.02); }
.masonry img { border-radius: 8px; width: 100%; }

.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(10, 30, 37, .9);
  display: none; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; max-width: 95vw; border-radius: 12px; background: #fff; }

.quote-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
@media (max-width: 900px) { .quote-strip { grid-template-columns: 1fr; } }
.quote-strip .card { padding: 18px; }
.quote-strip img { border-radius: 8px; }

/* ---------- Forma ---------- */
.form-card { background: var(--white); border-radius: 24px; padding: 44px; box-shadow: var(--shadow-lg); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } .form-card { padding: 28px 22px; } }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field label .req { color: var(--green); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; color: var(--ink);
  padding: 14px 16px; border: 2px solid var(--line); border-radius: 12px; background: var(--green-bg);
  transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--green); background: var(--white); }
.field textarea { min-height: 140px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.form-note { font-size: .82rem; color: var(--ink-soft); margin-top: 14px; }
.form-msg { display: none; padding: 14px 18px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; }
.form-msg.ok { display: block; background: var(--green-pale); color: var(--green-dark); }

.contact-list { list-style: none; padding: 0; margin: 30px 0 0; }
.contact-list li { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.contact-list .ci { width: 50px; height: 50px; border-radius: 14px; background: var(--green-pale); color: var(--green); display: grid; place-items: center; flex-shrink: 0; }
.contact-list .ci svg { width: 22px; height: 22px; }
.contact-list small { display: block; color: var(--ink-soft); font-size: .82rem; }
.contact-list a { font-weight: 600; color: var(--ink); }
.contact-list a:hover { color: var(--green); }

/* ---------- CTA juosta ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--green) 0%, var(--green-dark) 100%); color: var(--white);
  border-radius: 28px; padding: 56px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 30px;
  position: relative; overflow: hidden;
}
.cta-band::before { content: "a² + b² = c²"; position: absolute; right: 30px; top: -10px; font-size: 5rem; font-style: italic; font-family: 'Times New Roman', serif; opacity: .08; white-space: nowrap; }
.cta-band h2 { color: var(--white); margin-bottom: .2em; }
.cta-band p { margin: 0; opacity: .9; }
.cta-band .actions { display: flex; flex-wrap: wrap; gap: 12px; position: relative; }
@media (max-width: 640px) { .cta-band { padding: 36px 26px; } }

/* ---------- Teisinis tekstas ---------- */
.legal { max-width: 820px; margin: 0 auto; }
.legal h2 { font-size: 1.5rem; margin-top: 2em; padding-top: 1em; border-top: 2px solid var(--green-pale); }
.legal h3 { font-size: 1.1rem; margin-top: 1.6em; color: var(--green-dark); }
.legal p, .legal li { color: var(--ink-soft); }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .4em; }
.toc { background: var(--green-bg); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 30px; }
.toc a { display: inline-block; margin: 4px 14px 4px 0; font-size: .92rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #b9d0d6; padding: 70px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--white); font-size: 1rem; margin-bottom: 18px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: #b9d0d6; }
.site-footer a:hover { color: var(--green-light); }
.footer-brand .logo { color: var(--white); margin-bottom: 16px; }
.footer-brand .logo img { background: #fff; border-radius: 50%; }
.footer-brand p { font-size: .92rem; }
.footer-bottom {
  margin-top: 50px; padding: 22px 0; border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: .85rem;
}

/* ---------- Plaukiojantis WhatsApp ---------- */
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  width: 60px; height: 60px; border-radius: 50%; background: var(--wa); color: #fff;
  display: grid; place-items: center; box-shadow: 0 10px 30px rgba(37, 211, 102, .45); transition: transform .2s;
}
.wa-float:hover { transform: scale(1.08); color: #fff; }
.wa-float svg { width: 32px; height: 32px; }

/* ---------- Animacijos ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
