:root {
  --navy: #122c91;
  --blue: #2a6fdb;
  --turquoise: #48d6d2;
  --aqua: #81e9e6;
  --cream: #fefcbf;
  --ink: #111827;
  --muted: #667085;
  --line: #dfe5ee;
  --white: #ffffff;
  --surface: rgba(255, 255, 255, 0.94);
  --shadow: 0 30px 50px rgba(18, 44, 145, 0.1);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 0%, rgba(254, 252, 191, 0.92), transparent 34rem),
    radial-gradient(circle at 95% 14%, rgba(129, 233, 230, 0.55), transparent 32rem),
    linear-gradient(145deg, #f7fbff 0%, #eef7ff 48%, #fdfde9 100%);
  color: var(--ink);
  font-family: "Manrope", "Avenir Next", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.app-shell {
  min-height: 100vh;
  padding: 54px 18px 92px;
}

.container {
  width: min(100%, 960px);
  margin: 0 auto;
}

.site-header {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  text-decoration: none;
}

.brand-mark {
  width: 58px;
  height: 58px;
  padding: 9px;
  border: 1px solid rgba(18, 44, 145, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 35px rgba(18, 44, 145, 0.12);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--navy);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.3;
}

.brand-mark .brand-spark {
  fill: var(--cream);
  stroke: var(--blue);
  stroke-width: 2.2;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-label {
  margin-top: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.dictionary {
  max-width: 960px;
  margin: 0 auto;
}

.card {
  margin-top: 12px;
  padding: 40px;
  overflow: hidden;
  border: 1px solid rgba(18, 44, 145, 0.07);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.search-card {
  position: relative;
}

.search-card::after {
  position: absolute;
  top: -48px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(72, 214, 210, 0.3), rgba(254, 252, 191, 0.45));
  content: "";
  pointer-events: none;
}

.search-card label {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 20px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.search-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.search-input {
  width: 100%;
  height: 64px;
  padding: 19px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-input::placeholder {
  color: #8b95a7;
}

.search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(42, 111, 219, 0.13);
}

.search-button {
  display: inline-flex;
  min-width: 132px;
  height: 64px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  box-shadow: 0 14px 25px rgba(42, 111, 219, 0.25);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.search-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.search-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 17px 30px rgba(42, 111, 219, 0.31);
}

.search-button:active {
  transform: translateY(0);
}

.search-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.hint {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.status {
  min-height: 0;
  color: var(--muted);
  text-align: center;
}

.status:not(:empty) {
  margin: 22px 0 8px;
}

.status.error {
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(18, 44, 145, 0.12);
  border-radius: 10px;
  background: rgba(254, 252, 191, 0.72);
  color: var(--navy);
  text-align: left;
}

.loading-dots {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
  vertical-align: middle;
}

.loading-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 900ms infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
  animation-delay: 150ms;
}

.loading-dots span:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes pulse {
  0%, 100% { opacity: 0.28; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.word-card {
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92)),
    linear-gradient(145deg, var(--aqua), var(--cream));
}

.word-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.word-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-transform: lowercase;
}

.phonetic-row {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
}

.phonetic-text {
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}

.audio-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid rgba(42, 111, 219, 0.2);
  border-radius: 999px;
  background: rgba(129, 233, 230, 0.18);
  color: var(--navy);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.audio-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.word-decoration {
  display: grid;
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 26px;
  background: linear-gradient(145deg, var(--aqua), var(--cream));
  box-shadow: inset 0 0 0 1px rgba(18, 44, 145, 0.07);
  color: var(--navy);
  font-family: Georgia, serif;
  font-size: 31px;
  font-style: italic;
  font-weight: 700;
}

.meaning-card {
  position: relative;
}

.meaning-card::before {
  position: absolute;
  top: 40px;
  left: 0;
  width: 5px;
  height: 31px;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(var(--turquoise), var(--blue));
  content: "";
}

.part-of-speech {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  text-transform: lowercase;
}

.definition-item + .definition-item {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(18, 44, 145, 0.08);
}

.definition-text {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

.definition-number {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  margin-right: 10px;
  border-radius: 50%;
  background: rgba(72, 214, 210, 0.2);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
}

.example {
  margin: 10px 0 0 34px;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  line-height: 1.55;
}

.synonyms {
  margin-top: 28px;
}

.synonyms strong {
  display: block;
  margin-bottom: 9px;
  color: var(--navy);
  font-size: 13px;
}

.synonyms ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.synonyms li {
  padding: 6px 10px;
  border: 1px solid rgba(42, 111, 219, 0.13);
  border-radius: 999px;
  background: rgba(254, 252, 191, 0.54);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
}

.photos-card {
  padding: 30px;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.photo-link {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(129, 233, 230, 0.4), rgba(254, 252, 191, 0.7));
  aspect-ratio: 4 / 3;
}

.photo-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease, filter 260ms ease;
}

.photo-link:hover img {
  transform: scale(1.035);
  filter: saturate(1.08);
}

.photo-placeholder {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed rgba(18, 44, 145, 0.24);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(129, 233, 230, 0.3), rgba(254, 252, 191, 0.7));
  color: var(--navy);
  font-size: 13px;
  text-align: center;
}

.site-footer {
  margin-top: 22px;
  color: #657084;
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
}

.site-footer a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .app-shell {
    padding: 34px 14px 64px;
  }

  .site-header {
    margin-bottom: 20px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
  }

  .brand-name {
    font-size: 22px;
  }

  .card {
    padding: 27px 22px;
  }

  .search-card label {
    max-width: 310px;
    font-size: 21px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-button {
    width: 100%;
  }

  .word-decoration {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 24px;
  }

  .meaning-card::before {
    top: 29px;
  }

  .photos-card {
    padding: 22px;
  }

  .photos-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .brand-copy {
    display: none;
  }

  .word-decoration {
    display: none;
  }

  .word-title {
    font-size: 38px;
  }

  .phonetic-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
