/* mydictionary.org — one stylesheet for every page. Same palette and type as the App Store
   screenshots ("duck editorial"): cream canvas, forest-green ink, heavy headlines with the key
   phrase in a green box. */

:root {
  --cream: #F8F3E8;
  --cream-2: #F1E9D8;
  --card: #FFFFFF;
  --ink: #14251A;
  --soft: #55665A;
  --line: rgba(20, 37, 26, 0.12);
  --green: #0B8A1A;
  --green-ink: #FFFDF5;
  --glow: rgba(140, 214, 120, 0.28);
  --radius: 28px;
  --wrap: 1120px;
  --gutter: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #101A13;
    --cream-2: #16231A;
    --card: #1C2B21;
    --ink: #EEF3EC;
    --soft: #A7B6AA;
    --line: rgba(238, 243, 236, 0.12);
    --green: #34B547;
    --green-ink: #0C1A10;
    --glow: rgba(52, 181, 71, 0.18);
  }
}

:root[data-theme="dark"] {
  --cream: #101A13; --cream-2: #16231A; --card: #1C2B21; --ink: #EEF3EC; --soft: #A7B6AA;
  --line: rgba(238, 243, 236, 0.12); --green: #34B547; --green-ink: #0C1A10; --glow: rgba(52, 181, 71, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }
a:hover { text-decoration: none; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }

.skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip-path: none; inset-inline-start: var(--gutter); top: 12px; z-index: 10; background: var(--card); padding: 8px 14px; border-radius: 10px; }

/* Headlines */
.display, h1, h2, h3 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin: 0;
}
h1.display { font-size: clamp(44px, 8vw, 84px); }
h1, h2, .legal-subtitle { text-wrap: balance; }
:lang(ko) h1, :lang(ko) h2, :lang(ko) .lede { word-break: keep-all; }
:lang(ja) h1, :lang(ja) h2 { line-break: strict; }
h2 { font-size: clamp(32px, 5vw, 52px); }
h3 { font-size: 22px; letter-spacing: -0.01em; line-height: 1.2; }
.hl {
  background: var(--green);
  color: var(--green-ink);
  border-radius: 0.24em;
  padding: 0 0.16em;
  white-space: nowrap;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.lede { font-size: clamp(19px, 2.2vw, 23px); color: var(--soft); font-weight: 500; margin: 20px 0 0; max-width: 34em; }
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); margin: 0 0 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--cream) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--green); }
.nav .get { background: var(--green); color: var(--green-ink); padding: 8px 16px; border-radius: 999px; font-weight: 600; }
.nav .get:hover { color: var(--green-ink); filter: brightness(1.08); }
@media (max-width: 640px) { .nav > a:not(.get) { display: none; } .nav { gap: 10px; } .nav .get { padding: 8px 12px; } }
.lang-code { display: none; }
@media (max-width: 480px) { .lang .lang-name { display: none; } .lang .lang-code { display: inline; } .brand { font-size: 16px; } }

/* Language picker */
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 500; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink);
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: translateY(-2px) rotate(45deg); margin-inline-start: 2px; opacity: .6; }
.lang[open] summary { background: var(--card); }
.lang ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 10; min-width: 190px;
  margin: 0; padding: 6px; list-style: none; background: var(--card); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(20, 37, 26, 0.18); border: 1px solid var(--line);
}
.lang ul a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; }
.lang ul a:hover { background: var(--cream); }
.lang ul a[aria-current] { color: var(--green); font-weight: 700; }

/* Store badges and rating */
.badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.badges a { display: inline-flex; align-items: center; height: 56px; padding: 0 20px; border-radius: 14px; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); transition: transform .15s ease; }
.badges a:hover { transform: translateY(-1px); }
.badges img { height: 30px; width: auto; filter: invert(1); }
.rating { display: flex; align-items: center; gap: 10px; margin-top: 20px; color: var(--soft); font-size: 15px; font-weight: 500; }
.stars { color: #F2B01E; letter-spacing: 2px; font-size: 17px; }
.rating b { color: var(--ink); }

/* Hero */
.hero {
  padding: 56px 0 24px;
  background: radial-gradient(900px 700px at 78% 55%, var(--glow), transparent 70%);
  overflow: hidden;
}
.hero .wrap { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 88px 0 56px; }
  .hero .wrap { grid-template-columns: 1.05fr 1fr; gap: 48px; }
}

/* Feature rows */
.section { padding: 72px 0; }
.section + .section { padding-top: 24px; }
.feature .wrap { display: grid; gap: 28px; align-items: center; }
.feature p { color: var(--soft); font-size: 19px; margin: 16px 0 0; max-width: 30em; }
.feature ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.feature li { position: relative; padding-inline-start: 30px; color: var(--ink); }
.feature li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}
@media (min-width: 900px) {
  .feature .wrap { grid-template-columns: 1fr 1fr; gap: 64px; }
  .feature.flip .copy { order: 2; }
}

/* Mac band */
.band { background: var(--cream-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band .wrap { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .band .wrap { grid-template-columns: 0.9fr 1.1fr; gap: 56px; } }
.text-link { display: inline-block; margin-top: 20px; font-weight: 600; text-decoration: none; }
.text-link::after { content: " →"; }
[dir="rtl"] .text-link::after { content: " ←"; }

/* Reviews */
.reviews-head { text-align: center; }
.reviews-head .rating { justify-content: center; font-size: 17px; }
.score { font-size: 64px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.quotes { display: grid; gap: 16px; margin-top: 40px; }
@media (min-width: 900px) { .quotes { grid-template-columns: repeat(3, 1fr); } }
.quote { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: 0 18px 50px rgba(20, 37, 26, 0.08); margin: 0; }
.quote blockquote { margin: 12px 0 16px; font-size: 18px; line-height: 1.5; }
.quote figcaption { color: var(--soft); font-size: 14px; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq h2 { text-align: center; margin-bottom: 32px; }
.faq details { background: var(--card); border-radius: 20px; padding: 0 24px; margin-bottom: 12px; }
.faq summary { cursor: pointer; list-style: none; padding-block: 20px; padding-inline-end: 28px; font-weight: 700; font-size: 18px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; inset-inline-end: 0; top: 16px; font-size: 26px; font-weight: 400; color: var(--green); }
.faq details[open] summary::after { content: "–"; }
.faq details[open] { padding-bottom: 22px; }
.faq details p { margin: 0; color: var(--soft); }

/* Final call to action */
.cta { text-align: center; }
.cta .duck { width: 150px; margin: 0 auto 12px; }
.cta .badges { justify-content: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; color: var(--soft); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: var(--soft); text-decoration: none; }
.site-footer a:hover { color: var(--green); }

/* Document pages (privacy, terms, legal, MCP docs) */
.legal-page { padding: 48px 0 72px; }
.legal-container { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }
.legal-header { margin-bottom: 32px; }
.legal-logo { color: var(--green); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; }
.legal-subtitle { font-size: clamp(34px, 6vw, 52px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; margin-top: 8px; }
.legal-date, .legal-description { color: var(--soft); margin-top: 10px; }
.legal-section, .legal-info-section, .legal-contact-info, .legal-document-card {
  background: var(--card); border-radius: 22px; padding: 24px 28px; margin-bottom: 14px;
}
.legal-section h2, .legal-info-section h2, .legal-contact-info h2, .legal-contact-info h3 { font-size: 22px; letter-spacing: -0.01em; margin: 0 0 10px; }
.legal-section h3 { font-size: 18px; margin: 18px 0 6px; }
.legal-section p, .legal-section li { color: var(--ink); }
.legal-section ul { padding-inline-start: 20px; }
.legal-section code, .legal-page code, .legal-page pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; background: var(--cream-2); border-radius: 6px; padding: 1px 6px; }
.legal-page pre { padding: 14px 16px; overflow-x: auto; }
.legal-page pre code { padding: 0; background: none; }
.legal-features-list { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 640px) { .legal-features-list { grid-template-columns: 1fr 1fr; } }
.legal-feature-icon { font-size: 22px; }
.legal-feature-title { font-weight: 700; margin-top: 4px; }
.legal-feature-description { color: var(--soft); font-size: 15px; }
.legal-back-button { display: inline-block; margin-top: 12px; font-weight: 600; text-decoration: none; }
.legal-document-grid, .legal-documents { display: grid; gap: 14px; }

/* Gentle reveal on scroll (no-op without JS or with reduced motion) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }
.documents-grid { display: grid; gap: 14px; margin: 24px 0; }
@media (min-width: 640px) { .documents-grid { grid-template-columns: 1fr 1fr; } }
.document-card { display: block; background: var(--card); border-radius: 22px; padding: 24px 28px; color: var(--ink); text-decoration: none; }
.document-icon { font-size: 26px; }
.document-title { font-weight: 800; font-size: 20px; margin-top: 6px; }
.document-description { color: var(--soft); margin-top: 6px; }
.document-button { display: inline-block; margin-top: 14px; color: var(--green); font-weight: 600; }
.tool-list li { margin-bottom: 6px; }
