:root {
  --green-950: #053d2f;
  --green-900: #07543f;
  --green-800: #0b6d4b;
  --green-700: #078857;
  --green-500: #10b972;
  --green-100: #dcfce7;
  --cream: #fff8e7;
  --paper: #f8fbf7;
  --ink: #10231c;
  --muted: #62746b;
  --line: rgba(8, 79, 55, 0.14);
  --coral: #ff584f;
  --gold: #e9bc57;
  --shadow: 0 14px 34px rgba(4, 40, 29, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(233, 188, 87, 0.2), transparent 28%),
    linear-gradient(135deg, #f5fff8 0%, #e7f8ec 48%, #fbfff7 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1080px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.sidebar,
.phone-frame {
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  overflow: hidden;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(165deg, var(--green-500), #04a663 58%, var(--green-800));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--green-900);
  background: var(--cream);
  font-family: Amiri, serif;
  font-size: 1.8rem;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.1;
  font-size: 1rem;
}

.brand small {
  margin-top: 3px;
  color: rgba(5, 61, 47, 0.75);
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-link,
.tab-link,
.primary-action,
.ghost-action {
  min-height: 44px;
  border-radius: 999px;
  font-weight: 800;
}

.nav-link {
  width: 100%;
  padding: 0 18px;
  color: #111;
  background: var(--coral);
  text-align: left;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  transform: translateX(4px);
  color: var(--green-950);
  background: var(--cream);
}

.phone-frame {
  min-height: calc(100vh - 36px);
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.page {
  display: none;
  min-height: calc(100vh - 36px);
  padding: 22px;
}

.page.is-active {
  display: block;
}

.hero-card {
  min-height: 360px;
  border-radius: 22px;
  padding: 26px 26px 0;
  color: #081b15;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 248, 231, 0.48), transparent 34%),
    linear-gradient(135deg, rgba(19, 188, 111, 0.98), rgba(5, 119, 80, 0.98)),
    var(--green-500);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 300px);
  gap: 18px;
  overflow: hidden;
  position: relative;
}

.hero-copy {
  align-self: center;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 10px;
  color: rgba(5, 61, 47, 0.78);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 0.77rem;
}

.hero-copy h1,
.page-heading h2 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy h1 {
  max-width: 14ch;
  font-size: clamp(2rem, 5.5vw, 3.6rem);
}

.hero-copy p:not(.eyebrow) {
  max-width: 500px;
  margin: 12px 0 0;
  color: rgba(5, 37, 28, 0.78);
  line-height: 1.55;
  font-weight: 500;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.primary-action,
.ghost-action {
  padding: 0 18px;
}

.primary-action {
  color: white;
  background: var(--green-950);
}

.ghost-action {
  color: var(--green-950);
  background: rgba(255, 248, 231, 0.8);
}

.hero-illustration {
  width: min(100%, 300px);
  align-self: end;
  justify-self: center;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.18));
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.feature-card,
.note-panel,
.word-card,
.phrase-card,
.about-list article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.feature-card {
  padding: 14px;
  text-align: left;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(7, 136, 87, 0.35);
}

.feature-card span,
.word-arabic,
.phrase-arabic {
  font-family: Amiri, serif;
}

.feature-card span {
  display: block;
  color: var(--green-800);
  font-size: 1.65rem;
  font-weight: 800;
}

.feature-card strong,
.feature-card small {
  display: block;
}

.feature-card small {
  margin-top: 6px;
  color: var(--muted);
}

.note-panel {
  margin-top: 12px;
  padding: 14px 16px;
}

.note-panel p {
  margin: 0;
  font-family: Amiri, serif;
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--green-900);
}

.note-panel small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.page-heading {
  margin-bottom: 14px;
}

.page-heading h2 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
}

.page-heading p:not(.eyebrow) {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.search-box {
  position: sticky;
  top: 0;
  z-index: 3;
  margin-bottom: 10px;
  padding: 6px 0;
  background: linear-gradient(180deg, rgba(248, 251, 247, 0.98), rgba(248, 251, 247, 0.7));
}

.search-box input {
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: white;
  outline: none;
}

.search-box input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 4px rgba(16, 185, 114, 0.14);
}

.word-list,
.phrase-list,
.about-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.word-card,
.about-list article {
  padding: 12px 14px;
}

.word-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(132px, 0.8fr);
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: white;
}

.about-list article {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: white;
}

.word-card:last-child,
.phrase-card:last-child,
.about-list article:last-child {
  border-bottom: 0;
}

.word-arabic,
.phrase-arabic {
  margin: 0;
  color: var(--green-900);
  font-size: 1.5rem;
  line-height: 1.25;
}

.word-meta strong,
.phrase-card strong,
.sound-copy strong,
.about-list strong {
  display: block;
  color: var(--ink);
}

.word-meta small,
.phrase-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.tag {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  margin-top: 7px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green-900);
  background: var(--green-100);
  font-size: 0.78rem;
  font-weight: 700;
}

.phrase-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 1fr) 46px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: white;
}

.phrase-indonesia {
  color: var(--ink);
  font-weight: 800;
}

.sound-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: white;
  background: var(--green-800);
  font-size: 1rem;
  box-shadow: 0 12px 24px rgba(7, 136, 87, 0.24);
  line-height: 1;
}

.sound-button:hover {
  background: var(--green-950);
}

.sound-button.is-playing {
  background: var(--coral);
}

.about-list article p {
  margin: 6px 0 4px;
  color: var(--green-900);
  font-family: Amiri, serif;
  font-size: 1.22rem;
  line-height: 1.45;
}

.about-list article span {
  color: var(--muted);
  line-height: 1.55;
}

.mobile-tabs {
  display: none;
}

@media (max-width: 860px) {
  body {
    background: var(--paper);
  }

  .app-shell {
    min-height: 100vh;
    display: block;
    padding: 0 0 76px;
  }

  .sidebar {
    display: none;
  }

  .phone-frame {
    min-height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--paper);
  }

  .page {
    min-height: calc(100vh - 76px);
    padding: 12px;
  }

  .hero-card {
    min-height: auto;
    padding: 20px 16px 0;
    border-radius: 18px;
    grid-template-columns: 1fr;
    align-content: start;
  }

  .hero-copy {
    align-self: start;
  }

  .hero-copy h1 {
    max-width: 13ch;
  }

  .hero-copy p:not(.eyebrow) {
    font-size: 0.95rem;
  }

  .hero-illustration {
    max-height: 34vh;
    object-fit: contain;
  }

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

  .word-card,
  .phrase-card {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px;
  }

  .phrase-card {
    position: relative;
    padding-right: 62px;
  }

  .phrase-card .sound-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
  }

  .mobile-tabs {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(8, 79, 55, 0.16);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 40px rgba(6, 48, 35, 0.18);
    backdrop-filter: blur(14px);
  }

  .tab-link {
    min-width: 0;
    min-height: 42px;
    padding: 0 4px;
    color: var(--muted);
    background: transparent;
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tab-link.is-active {
    color: white;
    background: var(--green-800);
  }
}

@media (min-width: 861px) and (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 20px;
    padding: 20px;
  }

  .sidebar {
    top: 20px;
    height: calc(100vh - 40px);
  }

  .phone-frame,
  .page {
    min-height: calc(100vh - 40px);
  }

  .hero-card {
    grid-template-columns: 1fr;
  }
}
