/* ===== Spalvos ir dydžiai vienoje vietoje ===== */
:root {
  --bg: #fbfaf7;
  --bg-alt: #f1f4fb;
  --panel: #ffffff;
  --text: #1c2333;
  --muted: #5d6679;
  --accent: #2f5bea;
  --accent-dark: #1f43c0;
  --accent-soft: #e4ebfe;
  --warm: #f2a93b;
  --border: #e3e6ee;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(28, 35, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow {
  max-width: 760px;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 12px;
}

a {
  color: inherit;
}

/* ===== Mygtukai ===== */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 10px;
  border: 2px solid var(--accent);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s, transform 0.2s;
}

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

.btn-ghost {
  background: transparent;
  color: var(--accent);
}

.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.95rem;
}

/* ===== Navigacija ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 250, 247, 0.9);
  -webkit-backdrop-filter: blur(8px); /* senesniems iPhone */
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a:not(.btn) {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.nav-links a:not(.btn):hover {
  color: var(--accent);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text);
}

/* ===== Hero ===== */
.hero {
  padding: 72px 0 80px;
  /* Languoto sąsiuvinio fonas */
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
}

.highlight {
  color: var(--accent);
  background: linear-gradient(transparent 65%, rgba(242, 169, 59, 0.45) 65%);
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 36px;
}

.hero-stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.hero-stats strong {
  display: block;
  font-size: 2rem;
  color: var(--accent);
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-card {
  position: relative;
  background: var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
}

.formula {
  position: absolute;
  font-family: "Cambria Math", "STIX Two Math", Georgia, serif;
  font-size: 1.15rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  animation: float 5s ease-in-out infinite;
}

.f1 { top: 24px; left: 24px; }
.f2 { top: 80px; right: 20px; animation-delay: -1.5s; }
.f3 { top: 140px; left: 40px; animation-delay: -3s; color: var(--accent-dark); }

@keyframes float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -8px; }
}

.graph {
  width: 100%;
}

.graph .axis {
  stroke: var(--muted);
  stroke-width: 1.5;
}

.graph .curve {
  fill: none;
  stroke: var(--warm);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: draw 2s ease-out 0.4s forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

/* ===== Sekcijos ===== */
.section {
  padding: 80px 0;
}

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

.section-title {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  text-align: center;
  margin-bottom: 40px;
}

.section-title.left {
  text-align: left;
  margin-bottom: 12px;
}

/* ===== Privalumai ===== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.feature {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.feature p {
  margin: 0;
  color: var(--muted);
}

/* ===== Žingsniai ===== */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.steps li {
  text-align: center;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

/* ===== Kainos ===== */
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.price-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
}

.price-card.featured {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
}

.badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warm);
  color: #3b2600;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.price {
  color: var(--muted);
  margin: 0 0 16px;
}

.price span {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex-grow: 1;
}

.price-card li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.price-card li::before {
  content: "✓ ";
  color: var(--accent);
  font-weight: 700;
}

.price-card .btn {
  text-align: center;
}

/* ===== DUK ===== */
details {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.3rem;
  line-height: 1;
  color: var(--accent);
}

details[open] summary::after {
  content: "–";
}

details p {
  margin: 12px 0 0;
  color: var(--muted);
}

/* ===== Kontaktai ir forma ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: start;
}

.contact-info {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 8px;
  font-weight: 500;
}

.form {
  background: var(--panel);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

.form .full {
  grid-column: 1 / -1;
}

.form input,
.form select,
.form textarea {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  width: 100%;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.form .invalid {
  border-color: #d93636;
}

.form-message {
  margin: 0;
  min-height: 1.4em;
  font-weight: 600;
}

.form-message.error   { color: #d93636; }
.form-message.success { color: #16884a; }

/* Paslėptas laukelis botams (honeypot) */
.form .honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Paslėpti laukai tikrai nesimato, net jei turi display: grid */
.form [hidden] {
  display: none !important;
}

/* „Registruoja“ pasirinkimas */
.role-choice {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
}

.role-choice legend {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0;
  margin-bottom: 6px;
  width: 100%;
}

.form .radio,
.form .checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  cursor: pointer;
}

.form .radio input,
.form .checkbox input {
  width: auto;
  margin: 4px 0 0;
  accent-color: var(--accent);
}

.form .checkbox {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
}

.form .checkbox a {
  color: var(--accent);
}

.form .checkbox.invalid {
  border-color: #d93636;
}

.form-hint {
  margin: 0;
  padding: 10px 12px;
  background: #fff6e5;
  border-radius: 10px;
  font-size: 0.9rem;
}

.form button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

/* ===== Privatumo politikos tekstas ===== */
.legal h2 {
  margin-top: 32px;
  font-size: 1.25rem;
}

.legal ul {
  padding-left: 20px;
}

.legal .note {
  background: #fff6e5;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.95rem;
}

.legal h2 {
  scroll-margin-top: 90px; /* kad antraštė nepasislėptų po meniu */
}

.legal h3 {
  margin-top: 20px;
  font-size: 1.05rem;
}

.legal p,
.legal li {
  color: #384055;
}

/* Laukai, kuriuos reikia užpildyti */
mark.fill {
  background: #ffe08a;
  color: inherit;
  padding: 0 4px;
  border-radius: 4px;
}

.legal .updated {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Turinys */
.toc {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin: 24px 0 8px;
}

.toc-title {
  font-weight: 700;
  margin: 0 0 8px;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 32px;
}

.toc li {
  margin: 2px 0;
}

.toc a {
  color: var(--accent);
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

.legal ul.plain {
  list-style: none;
  padding: 0;
}

/* Lentelė */
.table-wrap {
  overflow-x: auto;
  margin: 12px 0;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 620px;
}

.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.legal-table th {
  background: var(--bg-alt);
  font-weight: 600;
}

.back-link {
  margin-top: 40px;
}

.back-link a,
.legal a {
  color: var(--accent);
}

@media (max-width: 600px) {
  .toc ol {
    columns: 1;
  }
}

/* ===== Aktyvus meniu punktas ===== */
.nav-links a.active {
  color: var(--accent);
  font-weight: 700;
}

/* ===== Socialiniai tinklai ===== */
.socials-label {
  margin: 24px 0 8px;
  color: var(--muted);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
}

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

.socials svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Poraštėje rodomos tik apvalios ikonos */
.socials-icons a {
  padding: 0;
  width: 38px;
  height: 38px;
  justify-content: center;
  border-radius: 50%;
}

/* ===== Poraštė ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-grid p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.footer-links a {
  text-decoration: none;
}

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

/* ===== Vidinių puslapių antraštė ===== */
.page-hero {
  padding: 56px 0 40px;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
}

.page-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.page-hero .lead {
  margin: 0;
}

/* ===== Galerija ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.gallery-item {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-item figcaption {
  padding: 12px 16px;
  font-weight: 500;
}

/* Laukelis, kol nuotrauka dar neįkelta */
.gallery-item.missing {
  cursor: default;
}

.gallery-item.missing:hover {
  transform: none;
  box-shadow: none;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  border-bottom: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 16px;
}

/* Padidinta nuotrauka */
.lightbox {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: min(92vw, 1000px);
  background: var(--panel);
}

.lightbox::backdrop {
  background: rgba(10, 14, 25, 0.8);
}

.lightbox img {
  display: block;
  max-height: 80vh;
  width: 100%;
  object-fit: contain;
}

.lightbox-caption {
  margin: 0;
  padding: 12px 16px;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

/* ===== Užduotys ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.filter {
  font: inherit;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
}

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

.filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tasks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.task {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

/* Filtro paslėptos užduotys */
.task[hidden] {
  display: none;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.tag {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.task > p {
  margin: 0 0 16px;
  flex-grow: 1;
}

.math {
  font-family: "Cambria Math", "STIX Two Math", Georgia, serif;
  font-size: 1.08em;
  white-space: nowrap;
}

/* Sprendimas užduoties kortelėje */
.task .solution {
  margin: 0;
  padding: 12px 16px;
  background: var(--bg-alt);
  border: none;
}

.task .solution summary {
  color: var(--accent);
}

.task .solution p {
  margin: 8px 0 0;
}

.answer {
  font-weight: 700;
  color: var(--text) !important;
}

.cta-box {
  margin-top: 48px;
  padding: 36px 24px;
  border-radius: 20px;
  background: var(--accent-soft);
  text-align: center;
}

.cta-box p {
  color: var(--muted);
  margin: 0 0 20px;
}

/* ===== Apie mokytoją ===== */
.teacher {
  display: grid;
  /* Nuotraukos stulpelis ne platesnis už pačią nuotrauką (294 px), kad nebūtų ištempta ir neryški.
     Įkėlus didesnę nuotrauką, 294px galima pakeisti į 380px. */
  grid-template-columns: minmax(220px, 294px) 1fr;
  justify-content: center;
  gap: 56px;
  align-items: center;
}

.teacher-photo {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent-soft), #fff3df);
  box-shadow: var(--shadow);
  /* Dekoratyvus rėmelis už nuotraukos */
  outline: 2px dashed var(--accent);
  outline-offset: 10px;
}

.teacher-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%; /* jei apkerpama, veidas lieka matomas */
  border-radius: 24px;
}

/* Rodoma, kol nuotraukos nėra (nuotrauka ją uždengia) */
.teacher-initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 5rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.5;
}

.teacher-badge {
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

.teacher-text h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
}

.teacher-text > p:not(.eyebrow):not(.lead) {
  color: var(--muted);
}

.teacher-facts {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.teacher-facts li {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: grid;
  gap: 2px;
}

.teacher-facts span {
  color: var(--muted);
  font-size: 0.92rem;
}

.teacher-quote {
  margin: 0 0 28px;
  padding: 4px 0 4px 18px;
  border-left: 4px solid var(--warm);
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
}

@media (max-width: 820px) {
  .teacher {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .teacher-photo {
    max-width: 294px;
    width: 100%;
    margin: 0 auto;
  }
}

/* ===== Atsiradimo animacija slenkant ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s, transform 0.6s;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ===== Telefonai ir planšetės ===== */
@media (max-width: 820px) {
  .hero-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 48px 0 56px;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }
}

@media (max-width: 520px) {
  .form {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 56px 0;
  }
}

/* Žmonėms, kurie išjungę animacijas */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .graph .curve { stroke-dashoffset: 0; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Hero: 3D paviršius ir lygčių sprendimas ===== */
.hero-card.hero-math {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding: 20px;
  min-height: 0;
  overflow: hidden;
}

.surface-wrap {
  position: relative;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 40%, var(--accent-soft), transparent 70%),
    var(--bg-alt);
}

#surface3d {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  cursor: grab;
  touch-action: pan-y; /* telefone vertikalus slinkimas lieka puslapiui */
}

#surface3d:active {
  cursor: grabbing;
}

.surface-label {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 12px;
  font-family: "Cambria Math", "STIX Two Math", Georgia, serif;
  font-size: 1.05rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: opacity 0.5s, translate 0.5s;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.surface-label small {
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

.surface-label.fade {
  opacity: 0;
  translate: 0 -6px;
}

.surface-hint {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  pointer-events: none;
}

/* Lygčių sprendimas */
.solver {
  min-height: 178px;
  padding: 4px 6px 0;
  transition: opacity 0.45s;
}

.solver.leaving {
  opacity: 0;
}

.solver-title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.solver-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.solver-steps li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: "Cambria Math", "STIX Two Math", Georgia, serif;
  font-size: 1.2rem;
  opacity: 0;
  translate: -14px 0;
  transition: opacity 0.45s, translate 0.45s;
}

.solver-steps li.show {
  opacity: 1;
  translate: 0 0;
}

.solver-steps .note {
  font-family: inherit;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--muted);
}

.solver-steps .note::before {
  content: "← ";
}

.solver-steps li.answer {
  justify-self: start;
  background: #fff4e0;
  border: 2px solid var(--warm);
  border-radius: 10px;
  padding: 4px 12px;
  font-weight: 700;
}

.solver-steps li.answer.show {
  animation: answer-pop 0.5s ease-out;
}

.solver-steps .check {
  color: #16884a;
  font-family: system-ui, sans-serif;
  font-weight: 800;
}

@keyframes answer-pop {
  0%   { scale: 0.85; }
  60%  { scale: 1.08; }
  100% { scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .solver-steps li { opacity: 1; translate: 0 0; transition: none; }
  .surface-hint { display: none; }
}

/* Diskreti nuoroda į administravimą poraštėje */
.footer-links .admin-link {
  opacity: 0.55;
  font-size: 0.85em;
}

.footer-links .admin-link:hover {
  opacity: 1;
}

/* iPhone/iPad: jei laukelio šriftas mažesnis nei 16px, iOS Safari priartina puslapį
   paspaudus ant laukelio. Jutikliniuose ekranuose laukeliams naudojam 16px. */
@media (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Telefone: patogesni paspaudimai privatumo politikos turinyje */
@media (pointer: coarse) {
  .toc li { padding: 4px 0; }
}
