:root {
  --bg: #faf9f7;
  --bg-paper: #ffffff;
  --fg: #1a1a1a;
  --muted: #6a6a6a;
  --border: #dcd7d0;
  --border-light: #e8e5e0;
  --accent: #2c2c2c;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-hover: rgba(0, 0, 0, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: "Libre Baskerville", serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.background {
  background-image: url(img/background.jpg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  height: 120%;
  width: 120%;
  z-index: -1;
  position: fixed;
  top: -10%;
  left: -10%;
  margin: 0;
  opacity: 0.15;
  filter: grayscale(100%) contrast(0.8);
  -webkit-filter: grayscale(100%) contrast(0.8);
}

.frame {
  max-width: 900px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 1.2s ease-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: none;
  }
}

.logo-container {
  margin-bottom: 8px;
}

.logo {
  width: 180px;
  opacity: 0.92;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 2px 8px var(--shadow));
}

.logo:hover {
  opacity: 1;
  transform: scale(1.02) translateY(-2px);
  filter: drop-shadow(0 4px 12px var(--shadow-hover));
}

.dictionary-card {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 44px 52px;
  width: 100%;
  max-width: 720px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 24px var(--shadow), 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
}

.dictionary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

.dictionary-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--shadow-hover), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.word-syllables {
  font-family: "Playfair Display", serif;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
  margin-bottom: 12px;
  line-height: 1.2;
}

.word-spelling {
  font-family: "Libre Baskerville", serif;
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
  font-style: italic;
}

.word-type {
  font-family: "Libre Baskerville", serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 20px;
  opacity: 0.85;
}

.word-definition {
  font-family: "Libre Baskerville", serif;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 400;
  color: var(--fg);
  line-height: 1.75;
  max-width: 600px;
  margin: 0 auto;
}

/* Headline - strong serif */
h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(42px, 6.5vw, 72px);
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 800px;
  line-height: 1.15;
  color: var(--fg);
}

.tagline {
  font-family: "Libre Baskerville", serif;
  font-size: clamp(18px, 2.5vw, 22px);
  color: var(--muted);
  max-width: 680px;
  line-height: 1.75;
  margin-top: -12px;
}

.divider {
  width: 180px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  opacity: 0.8;
  margin: 12px auto 0;
}

.grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.pill {
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-paper);
  font-size: 15px;
  font-family: "Libre Baskerville", serif;
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--fg);
  cursor: default;
  box-shadow: 0 1px 3px var(--shadow);
}

.pill:hover {
  border-color: var(--accent);
  background: var(--fg);
  color: var(--bg-paper);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-hover);
}

footer {
  margin-top: 42px;
  font-size: 14px;
  font-family: "Inter", sans-serif;
  color: var(--muted);
  letter-spacing: 0.03em;
  opacity: 0.85;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 30px 16px;
  }

  .frame {
    gap: 36px;
  }

  .dictionary-card {
    padding: 36px 32px;
  }

  .word-syllables {
    font-size: 32px;
  }

  .word-spelling {
    font-size: 18px;
  }

  h1 {
    font-size: 36px;
  }

  .tagline {
    font-size: 18px;
  }

  .grid {
    gap: 10px;
  }

  .pill {
    padding: 10px 20px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .logo {
    width: 140px;
  }

  .dictionary-card {
    padding: 32px 28px;
  }

  .word-syllables {
    font-size: 28px;
  }

  h1 {
    font-size: 30px;
  }
}
