:root {
  --background: #fdf1f4;
  --surface: #fffafb;
  --surface-accent: #ffffff;
  --text-primary: #242424;
  --text-secondary: #666666;
  --border: #f2dee3;
  --accent: #d87b95;
  --accent-dark: #b04c68;
  --focus-ring: #8a5cf6;
  --border-radius: 20px;
  --border-radius-sm: 12px;
  --max-content-width: 720px;
  --shadow: 0 12px 30px rgba(36, 36, 36, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

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

/* Decorative wildflower garden */

.garden-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.meadow-band {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 32vh;
  min-height: 160px;
  max-height: 280px;
  max-width: none;
  opacity: 0.6;
}

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

/* Layout */

.site-header,
.site-footer,
main {
  position: relative;
  z-index: 1;
}

.site-header,
.site-footer {
  width: 100%;
}

.site-header {
  padding: 1.5rem 1.25rem 0.5rem;
}

.logo {
  max-width: var(--max-content-width);
  margin: 0 auto;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.logo span {
  color: var(--accent-dark);
}

main {
  flex: 1;
  width: 100%;
  min-height: 0;
  padding: 1rem 1.25rem 3rem;
  display: flex;
}

.page-content {
  max-width: var(--max-content-width);
  margin: 0 auto;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Vertically centers the heading + phrase card within whatever space is
   left above the (usually collapsed) about section and footer. */
.hero {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  text-align: center;
  margin: 0.5rem 0 1.5rem;
}

/* Phrase card */

.phrase-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
}

.featured-flower {
  width: clamp(64px, 14vw, 90px);
  height: auto;
  opacity: 0.55;
}

/* Mobile: both flowers share a row above the card (order 1, DOM order
   keeps left before right). Desktop: right moves after the card. */
.featured-flower--left {
  order: 1;
}

.featured-flower--right {
  order: 1;
}

.phrase-card {
  order: 2;
  flex-basis: 100%;
}

@media (min-width: 700px) {
  .phrase-stage {
    flex-wrap: nowrap;
    gap: 1rem;
  }

  .featured-flower--right {
    order: 3;
  }

  .phrase-card {
    flex-basis: auto;
  }

  .featured-flower {
    width: clamp(70px, 8vw, 110px);
  }
}

.phrase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.phrase-card.fade-in {
  animation: phrase-fade 0.35s ease;
}

@keyframes phrase-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .phrase-card.fade-in {
    animation: none;
  }
}

.phrase-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin: 0;
}

.german-phrase {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.english-phrase {
  font-size: clamp(1.05rem, 3.5vw, 1.25rem);
  color: var(--text-secondary);
  margin: 0;
}

.grammar-tip-box {
  width: 100%;
  background: var(--surface-accent);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 0.9rem 1.1rem;
  text-align: left;
}

.grammar-tip-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
  margin-bottom: 0.35rem;
}

.grammar-tip {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Buttons */

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  align-items: center;
}

button {
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  min-height: 48px;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

button:active {
  transform: scale(0.98);
}

button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  width: 100%;
  max-width: 320px;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-primary);
  width: 100%;
  max-width: 320px;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* SEO content */

.about {
  max-width: var(--max-content-width);
  margin: 3rem auto 0;
}

.about h2 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.5rem;
}

.about p {
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
}

.about-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: var(--border-radius-sm);
}

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

.about-summary h2 {
  margin: 0;
}

.about-summary::after {
  content: "";
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--accent-dark);
  border-bottom: 2px solid var(--accent-dark);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.about-details[open] .about-summary::after {
  transform: rotate(-135deg);
}

.about-summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 4px;
}

.about-content {
  padding-top: 0.25rem;
}

.site-footer {
  padding: 1.5rem 1.25rem 2rem;
  border-top: 1px solid var(--border);
}

.footer-content {
  max-width: var(--max-content-width);
  margin: 0 auto;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-content p {
  margin: 0.25rem 0;
}

/* Small screens: keep buttons comfortable but not full-width beyond content */

@media (min-width: 480px) {
  .actions {
    flex-direction: row;
    justify-content: center;
  }

  .btn-primary,
  .btn-secondary {
    width: auto;
  }
}
