/* ============ Reset & base ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #111111;
  --white: #ffffff;
  --gray-line: #e2e2e2;
  --gray-bg: #f4f4f4;
  --gray-text: #6b6b6b;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-he: 'Assistant', 'Arial Hebrew', sans-serif;
  --font-he-serif: 'Frank Ruhl Libre', 'David', serif;
  --max-width: 1180px;
}

html, body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font-en);
  -webkit-font-smoothing: antialiased;
}

[lang="he"] { font-family: var(--font-he); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; }
img, svg { display: block; max-width: 100%; }

.hidden { display: none !important; }

/* ============ Buttons / pills ============ */
.btn-pill,
.btn-outline {
  border: 1px solid var(--black);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--black);
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-pill:hover,
.btn-outline:hover {
  background: var(--black);
  color: var(--white);
}

.pill {
  border: 1px solid var(--black);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--black);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.pill-sub {
  font-weight: 400;
  font-size: 12px;
  opacity: 0.7;
  font-family: var(--font-he);
}

.pill.selected {
  background: var(--black);
  color: var(--white);
}
.pill.selected .pill-sub { color: var(--white); opacity: 0.85; }

.btn-generate {
  width: 100%;
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-pill);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 8px;
  transition: opacity 0.15s ease;
}
.btn-generate:hover { opacity: 0.85; }

/* ============ Nav ============ */
.navbar {
  border-bottom: 1px solid var(--gray-line);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 50;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.logo {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.logo-dot { color: var(--black); opacity: 0.5; }

.nav-links {
  justify-self: center;
  display: flex;
  gap: 32px;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a { opacity: 0.75; }
.nav-links a:hover { opacity: 1; }

.btn-get-started { justify-self: end; }

/* ============ Hero / landing ============ */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 72px 32px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.hero-left h1 {
  font-size: 42px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero-description {
  font-size: 16px;
  line-height: 1.7;
  color: var(--gray-text);
  max-width: 460px;
  margin-bottom: 28px;
}

.hero-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero-points li {
  font-size: 14px;
  padding-left: 22px;
  position: relative;
  color: var(--black);
}
.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--black);
}

/* ============ Form card ============ */
.form-card {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.field-group { margin-bottom: 22px; }
.field-group:last-of-type { margin-bottom: 0; }

.field-group > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--black);
}

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

.occasion-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.occasion-card {
  border: 1px solid var(--black);
  border-radius: 12px;
  background: var(--white);
  color: var(--black);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.occasion-card:hover { background: var(--gray-bg); }
.occasion-card.selected { background: var(--black); color: var(--white); }
.occasion-card.selected .occasion-caption { color: var(--white); opacity: 0.8; }

.occasion-hebrew {
  font-family: var(--font-he);
  font-size: 17px;
  font-weight: 700;
}
.occasion-english {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
}
.occasion-caption {
  font-size: 11px;
  color: var(--gray-text);
}

input[type="text"], select {
  width: 100%;
  border: 1px solid var(--black);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--font-he);
  background: var(--white);
  color: var(--black);
}
input[type="text"]:focus, select:focus {
  outline: 2px solid var(--black);
  outline-offset: 1px;
}

.relation-group label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.relation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 2px 8px;
  border: 1px solid var(--black);
  border-radius: var(--radius-pill);
  font-family: var(--font-he);
  font-size: 13px;
  font-weight: 700;
}

.checkbox-group { margin-top: -6px; }
.checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 400 !important;
  color: var(--black);
  cursor: pointer;
}
.checkbox-label input { margin-top: 3px; }
.checkbox-label span { font-family: var(--font-he); }

.form-error {
  color: #b00020;
  font-size: 13px;
  min-height: 0;
  margin-bottom: 0;
}
.form-error:not(:empty) { margin: -6px 0 14px; }

/* ============ About strip ============ */
.about-strip {
  border-top: 1px solid var(--gray-line);
  padding: 40px 32px;
  text-align: center;
}
.about-strip p {
  max-width: 640px;
  margin: 0 auto;
  color: var(--gray-text);
  font-size: 14px;
  line-height: 1.7;
}

/* ============ Output page ============ */
.output-header {
  position: relative;
  background: var(--gray-bg);
  overflow: hidden;
  padding-bottom: 40px;
}

.output-header-bg {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  filter: grayscale(1);
  pointer-events: none;
}
.output-header-bg svg { width: 100%; height: 100%; }

.output-header-content {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 32px 0;
}

.output-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
  gap: 12px;
}

.output-actions { display: flex; gap: 10px; }

.output-name-block { text-align: center; }

.output-name {
  font-family: var(--font-he-serif);
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.output-subtitle {
  font-family: var(--font-he);
  font-size: 16px;
  color: var(--gray-text);
  margin-top: 10px;
}

.verses-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.verses-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.letter-section {
  border: 1px solid var(--gray-line);
  border-radius: var(--radius-lg);
  padding: 22px;
  break-inside: avoid;
}

.letter-section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--gray-line);
  padding-bottom: 12px;
}

.drop-letter {
  font-family: var(--font-he-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.letter-name {
  font-size: 12px;
  color: var(--gray-text);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.verses-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.verse {
  font-family: var(--font-he);
  font-size: 15px;
  line-height: 1.8;
}
.verse-num {
  font-weight: 700;
  margin-left: 4px;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--black);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--gray-line);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 32px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-logo { font-weight: 800; font-size: 15px; }
.footer-verse {
  font-family: var(--font-he-serif);
  font-size: 15px;
  color: var(--gray-text);
}

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 40px;
    gap: 40px;
  }
  .hero-left h1 { font-size: 32px; }
  .verses-container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav-container { padding: 14px 18px; grid-template-columns: auto 1fr auto; }
  .nav-links { display: none; }
  .hero { padding: 32px 18px; }
  .hero-left h1 { font-size: 28px; }
  .form-card { padding: 22px; }
  .occasion-cards { grid-template-columns: 1fr; }
  .output-name { font-size: 38px; }
  .verses-container { grid-template-columns: 1fr; }
  .output-actions-bar { flex-direction: column; align-items: stretch; }
  .output-actions { justify-content: stretch; }
  .output-actions .btn-outline { flex: 1; }
  .site-footer { flex-direction: column; text-align: center; }
}
