:root {
  color-scheme: light;
  --ink: #162033;
  --muted: #52617a;
  --line: #dce3ee;
  --surface: #fff;
  --wash: #f4f7fb;
  --accent: #155eef;
  --accent-dark: #0046c7;
  --radius: 18px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--wash); color: var(--ink); font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
/* Hidden above the page rather than far to the left, which would widen right-to-left (Arabic) pages. */
.skip-link { position: absolute; top: -10rem; inset-inline-start: 1rem; }
.skip-link:focus { top: 1rem; z-index: 2; background: #fff; padding: .6rem 1rem; border-radius: 8px; }
.site-header, main, footer { width: min(1120px, calc(100% - 2rem)); margin: auto; }
.site-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .75rem; }
.brand { color: var(--ink); font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.site-header { flex-wrap: wrap; }
.site-header nav, footer p:last-child { display: flex; flex-wrap: wrap; gap: 1rem; }
/* Site language: one setting for the whole site (public/site-lang.js). */
.site-lang { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .92rem; font-weight: 650; }
.site-lang select { min-height: 44px; max-width: 13rem; padding: .45rem .7rem; border: 1px solid #b7c3d4; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; }
.orig-lang { display: inline-block; margin-inline-end: .3rem; padding: 0 .4rem; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: .74rem; font-weight: 650; vertical-align: .08em; }
.i18n-pending body { visibility: hidden; }
.site-header a, footer a { color: var(--muted); text-decoration: none; }
.site-header a:hover, footer a:hover { color: var(--accent); text-decoration: underline; }

.hero { padding: 5rem clamp(1.5rem, 7vw, 6rem); background: linear-gradient(125deg, #e9f0ff, #fff 65%); border: 1px solid #d7e2fb; border-radius: var(--radius); }
.eyebrow, .tool-card > p:first-child { margin: 0 0 .5rem; color: var(--accent); font-size: .85rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(2.3rem, 6vw, 4.5rem); letter-spacing: -.055em; line-height: 1.03; }
.hero > p:not(.eyebrow) { max-width: 680px; color: var(--muted); font-size: 1.1rem; }
.primary-link, .tool-link { display: inline-flex; align-items: center; min-height: 44px; padding: .75rem 1rem; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }
.primary-link:hover { background: var(--accent-dark); }
.hero-links { display: flex; flex-wrap: wrap; gap: .75rem; }
.secondary-link, .section-link { display: inline-flex; align-items: center; min-height: 44px; padding: .75rem 1rem; border: 1px solid #b9c9ee; border-radius: 10px; background: #fff; color: #0845b7; font-weight: 700; text-decoration: none; }
.secondary-link:hover, .section-link:hover { background: #e9f0ff; }

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 2.5rem 0; }
.trust article, .tool-card { padding: 1.35rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.trust h2 { margin: 0; font-size: 1.1rem; }
.trust p, .tool-card > p { color: var(--muted); }

.tool-section { padding: 2rem 0 4rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.section-heading h2 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -.035em; }
.search { display: grid; gap: .35rem; font-weight: 700; }
.search input { width: min(300px, 100%); min-height: 44px; padding: .7rem .8rem; border: 1px solid #b7c3d4; border-radius: 9px; font: inherit; }
.tool-count { color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tool-card { display: flex; min-height: 220px; flex-direction: column; align-items: start; }
.tool-card h3 { margin: .2rem 0; font-size: 1.25rem; }
.tool-card h3 a { color: var(--ink); text-decoration: none; }
.tool-card h3 a:hover { text-decoration: underline; }
.tool-card .tool-link { margin-top: auto; padding: .55rem .8rem; background: #e9f0ff; color: #0845b7; }
.tool-card .tool-link:hover { background: #dbe7ff; }

.content-section { margin-bottom: 4rem; padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.content-section > h2 { max-width: 760px; margin: 0; font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -.035em; line-height: 1.15; }
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.principles article { padding: 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: var(--wash); }
.principles h3 { margin: 0 0 .45rem; font-size: 1.05rem; }
.principles p, .content-note { margin-bottom: 0; color: var(--muted); }
.content-note a { color: var(--accent-dark); }

.content-page { max-width: 880px; padding-bottom: 4rem; }
.page-intro { margin-bottom: 1rem; padding: clamp(2rem, 7vw, 5rem); border: 1px solid #d7e2fb; border-radius: var(--radius); background: linear-gradient(125deg, #e9f0ff, #fff 65%); }
.page-intro h1 { margin: 0; font-size: clamp(2.1rem, 6vw, 4rem); letter-spacing: -.05em; line-height: 1.05; }
.page-intro > p:last-child { max-width: 700px; color: var(--muted); font-size: 1.08rem; }
.content-page > section { padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.content-page > section h2 { margin: 0 0 .55rem; font-size: 1.35rem; }
.content-page > section p { color: var(--muted); }
.content-page a { color: var(--accent-dark); }

footer { display: flex; justify-content: space-between; padding: 2rem 0; color: var(--muted); font-size: .94rem; }

@media (max-width: 760px) {
  .hero { padding: 3.5rem 1.5rem; }
  .trust, .tool-grid, .principles { grid-template-columns: 1fr; }
  .section-heading, footer { flex-direction: column; align-items: start; gap: 1rem; }
  .search, .search input { width: 100%; }
  .site-header { min-height: 64px; align-items: flex-start; }
  .site-header nav { order: 3; width: 100%; gap: .75rem; }
  .site-lang { margin-inline-start: auto; }
}

@media (max-width: 520px) {
  .site-header { flex-direction: column; }
  .site-header nav { width: 100%; }
  .hero { padding: 2.5rem 1.25rem; }
  .page-intro { padding: 2rem 1.25rem; }
  .content-section { padding: 1.25rem; }
}

/* Games & fun: newest-first badges and type filters */
.card-badge { display: inline-flex; align-items: center; margin-inline-start: .45rem; padding: .1rem .5rem; border-radius: 999px; background: #fff1d6; color: #7a4200; font-size: .72rem; font-weight: 800; letter-spacing: .05em; vertical-align: .2em; white-space: nowrap; }
.card-badge[data-kind="new"] { background: #e3f6ea; color: #0b6b35; }
.card-badge[data-kind="hot"] { background: #ffe3dc; color: #a12a07; }
.card-badge[data-kind="hit"] { background: #ede5ff; color: #5420b8; }
.filter-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 .25rem; }
.filter-chips button { min-height: 44px; padding: .5rem .9rem; border: 1px solid #b9c9ee; border-radius: 999px; background: #fff; color: #0845b7; font: inherit; font-weight: 700; cursor: pointer; }
.filter-chips button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.filter-chips button:focus-visible { outline: 3px solid #ffb020; outline-offset: 2px; }
.hero.compact { padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 5vw, 4rem); }
.hero.compact h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
