/* ==========================================================================
   Randu — lp3 „Nuotraukų tinklelis (discovery grid)"
   ========================================================================== */

:root {
  --bg: #FAFAF9;
  --surface: #F4F4F5;
  --border: #E4E4E7;
  --text: #18181B;
  --text-muted: #3F3F46;
  --accent: #7C3AED;
  --accent-ink: #FFFFFF;

  --font-heading: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --container: 1180px;
  --gap: clamp(1rem, 2vw, 1.75rem);

  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; color: var(--text-muted); }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--text);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.lp3-container {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: 1.25rem;
}

section[id], main[id] {
  scroll-margin-top: 84px;
}

/* ---------- Header ---------- */

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

.site-header .lp3-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav a.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.main-nav a.nav-link:hover { color: var(--text); }

/* ---------- Buttons ---------- */

.lp3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  line-height: 1.1;
}

@media (prefers-reduced-motion: reduce) {
  .lp3-btn { transition: none; }
}

.lp3-btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.lp3-btn-primary:hover { background: #6D28D9; }
.lp3-btn-primary:active { transform: scale(0.98); }

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

.btn-sm { padding: 0.55rem 1.05rem; font-size: 0.88rem; }

/* ---------- Hero ---------- */

.lp3-hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}

.lp3-hero .lp3-container { max-width: 780px; }

.hero-lede {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 60ch;
  margin-inline: auto;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin: 1.75rem 0 1.25rem;
}

.hero-trust {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-trust svg { flex-shrink: 0; }

/* ---------- Section shell ---------- */

.lp3-section {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 62ch;
  margin: 0 0 1.75rem;
}

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

/* ---------- Discovery grid section ---------- */

.filters {
  margin-bottom: 1.75rem;
}

.filter-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
  scrollbar-width: thin;
}

.filter-group:last-child { margin-bottom: 0; }

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: none;
  color: var(--text-muted);
  margin: 0 0 0.4rem;
  display: block;
}

.lp3-chip {
  flex: 0 0 auto;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  .lp3-chip { transition: none; }
}

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

.lp3-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.grid-status {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .avatar-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}

@media (min-width: 1024px) {
  .avatar-grid { grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
}

.lp3-avatar-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  background: var(--surface);
  opacity: 0;
  transform: scale(0.92);
  animation: card-in 0.5s ease forwards;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lp3-avatar-card.bg-flat { background: var(--bg); }

.lp3-avatar-card:hover,
.lp3-avatar-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -12px rgba(24, 24, 27, 0.25);
}

.lp3-avatar-card[hidden] { display: none; }

@keyframes card-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .lp3-avatar-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .lp3-avatar-card:hover, .lp3-avatar-card:focus-visible { transform: none; }
}

/* staggered entrance delays */
.avatar-grid li:nth-child(1) .lp3-avatar-card { animation-delay: 0.02s; }
.avatar-grid li:nth-child(2) .lp3-avatar-card { animation-delay: 0.06s; }
.avatar-grid li:nth-child(3) .lp3-avatar-card { animation-delay: 0.10s; }
.avatar-grid li:nth-child(4) .lp3-avatar-card { animation-delay: 0.14s; }
.avatar-grid li:nth-child(5) .lp3-avatar-card { animation-delay: 0.18s; }
.avatar-grid li:nth-child(6) .lp3-avatar-card { animation-delay: 0.22s; }
.avatar-grid li:nth-child(7) .lp3-avatar-card { animation-delay: 0.26s; }
.avatar-grid li:nth-child(8) .lp3-avatar-card { animation-delay: 0.30s; }
.avatar-grid li:nth-child(9) .lp3-avatar-card { animation-delay: 0.34s; }
.avatar-grid li:nth-child(10) .lp3-avatar-card { animation-delay: 0.38s; }
.avatar-grid li:nth-child(11) .lp3-avatar-card { animation-delay: 0.42s; }
.avatar-grid li:nth-child(12) .lp3-avatar-card { animation-delay: 0.46s; }
.avatar-grid li:nth-child(13) .lp3-avatar-card { animation-delay: 0.50s; }
.avatar-grid li:nth-child(14) .lp3-avatar-card { animation-delay: 0.54s; }
.avatar-grid li:nth-child(15) .lp3-avatar-card { animation-delay: 0.58s; }
.avatar-grid li:nth-child(16) .lp3-avatar-card { animation-delay: 0.62s; }

.lp3-avatar-card svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lp3-avatar-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: rgba(24,24,27,0.82);
}

.avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem;
  background: rgba(124, 58, 237, 0.92);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
  .avatar-overlay { transition: none; }
}

.lp3-avatar-card:hover .avatar-overlay,
.lp3-avatar-card:focus-visible .avatar-overlay {
  opacity: 1;
}

/* ---------- Steps ---------- */

.steps {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

.step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.step-visual {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: 0.85rem;
}

/* ---------- FAQ ---------- */

.lp3-faq-list {
  border-top: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 0;
  font-weight: 600;
  font-family: var(--font-heading);
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .faq-icon { transition: none; }
}

.faq-item[open] .faq-icon { transform: rotate(45deg); }

.faq-item p { padding-bottom: 1.1rem; margin: 0; }

/* ---------- Form ---------- */

.form-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  max-width: 640px;
  margin: 0 auto;
}

.form-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .form-grid.two-col { grid-template-columns: 1fr 1fr; }
}

.lp3-field { display: flex; flex-direction: column; gap: 0.4rem; }

.lp3-field label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.lp3-field input,
.lp3-field select {
  font: inherit;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.lp3-field input:focus-visible,
.lp3-field select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.lp3-field-error {
  font-size: 0.82rem;
  color: #B91C1C;
  min-height: 1.1em;
}

.lp3-field.has-error input,
.lp3-field.has-error select {
  border-color: #B91C1C;
}

.consent-field {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.65rem;
}

.consent-field input { width: 1.2rem; height: 1.2rem; margin-top: 0.15rem; flex-shrink: 0; }
.consent-field label { font-weight: 400; font-size: 0.88rem; color: var(--text-muted); }

.form-submit {
  width: 100%;
  margin-top: 0.5rem;
}

.lp3-form-status {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  display: none;
}

.lp3-form-status.is-visible { display: block; }

.lp3-form-status.success {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.lp3-form-status.error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.form-success-view { display: none; text-align: center; }
.form-success-view.is-visible { display: block; }
.form-fields-view.is-hidden { display: none; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: clamp(2.5rem, 6vw, 3.5rem) 0 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-top {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-top { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-brand p { max-width: 42ch; }

.lp3-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.lp3-footer-links a { color: var(--text-muted); text-decoration: none; }
.lp3-footer-links a:hover { color: var(--accent); }

.footer-legal {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-legal p { margin: 0; max-width: 70ch; }

/* ---------- Utility ---------- */

.eyebrow {
  display: inline-block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

@media (max-width: 639px) {
  .main-nav { gap: 0.75rem; }
  .main-nav a.nav-link { display: none; }
}
