/* EasyEye Puzzles: designed to be easy on the eyes */
:root {
  --bg: #fffaf0;
  --surface: #ffffff;
  --surface-2: #fdf1d6;
  --ink: #14213d;
  --ink-soft: #3c4a66;
  --brand: #1d3a8a;
  --brand-ink: #ffffff;
  --accent: #ffc83d;
  --accent-ink: #14213d;
  --line: #e6dcc6;
  --focus: #e4572e;
  --it: #1f7a4d;
  --fr: #2b4fb3;
  --en: #b3262e;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(20, 33, 61, .10);
  --font: "Atkinson Hyperlegible", "Verdana", system-ui, sans-serif;
  --step: 1;
  font-size: calc(20px * var(--step));
}
html[data-size="l"] { --step: 1.15; }
html[data-size="xl"] { --step: 1.3; }

html[data-contrast="high"] {
  --bg: #000000;
  --surface: #000000;
  --surface-2: #111111;
  --ink: #ffffff;
  --ink-soft: #ffffff;
  --brand: #ffff00;
  --brand-ink: #000000;
  --accent: #ffff00;
  --accent-ink: #000000;
  --line: #ffffff;
  --focus: #00ffff;
  --it: #7dffb0;
  --fr: #9fc0ff;
  --en: #ff9a9a;
  --shadow: none;
}
html[data-contrast="high"] .book-card,
html[data-contrast="high"] .card,
html[data-contrast="high"] .panel { border: 2px solid #fff; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 12px 18px; z-index: 100; font-weight: 700; }
.skip-link:focus { left: 16px; top: 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Accessibility bar */
.a11y-bar { background: var(--ink); color: var(--bg); font-size: .8rem; }
html[data-contrast="high"] .a11y-bar { background: #000; color: #fff; border-bottom: 2px solid #fff; }
.a11y-bar .container { display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding-block: 6px; }
.a11y-bar span { opacity: .9; }
.a11y-btn {
  font: inherit; font-weight: 700; cursor: pointer; min-height: 40px; min-width: 44px;
  background: transparent; color: inherit; border: 2px solid currentColor; border-radius: 10px; padding: 4px 12px;
}
.a11y-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 84px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.3rem; }
.logo-mark { width: 48px; height: 48px; flex: none; }
.logo > span { line-height: 1.2; }
@media (max-width: 480px) {
  .logo { font-size: 1.05rem; }
  .logo small { display: none !important; }
  .logo-mark { width: 40px; height: 40px; }
  .a11y-bar span { display: none; }
}
.logo small { display: block; font-size: .7rem; font-weight: 400; color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; }
.nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.nav a { display: block; padding: 10px 16px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 700; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); color: var(--brand); }
.nav-toggle { display: none; font: inherit; font-weight: 700; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 12px; padding: 10px 16px; min-height: 48px; cursor: pointer; }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .nav a { padding: 14px 16px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 12px 26px; border-radius: 14px; font-weight: 700; font-size: 1rem;
  text-decoration: none; border: 3px solid transparent; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.15); text-decoration: none; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-ghost:hover { background: var(--surface-2); }

/* Hero */
.hero { padding: 64px 0 72px; background:
  radial-gradient(circle at 85% 15%, rgba(255, 200, 61, .35), transparent 40%),
  radial-gradient(circle at 10% 90%, rgba(29, 58, 138, .10), transparent 45%), var(--bg); }
html[data-contrast="high"] .hero { background: #000; }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; background: var(--surface-2); color: var(--brand); font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: .85rem; margin-bottom: 18px; }
.hero p.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 36ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-stack { position: relative; height: 460px; }
.hero-stack img { position: absolute; width: 56%; border-radius: 12px; box-shadow: 0 18px 40px rgba(20,33,61,.25); border: 4px solid #fff; }
.hero-stack img:nth-child(1) { left: 0; top: 40px; transform: rotate(-7deg); }
.hero-stack img:nth-child(2) { left: 22%; top: 0; z-index: 2; }
.hero-stack img:nth-child(3) { right: 0; top: 60px; transform: rotate(7deg); }
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-stack { height: 360px; max-width: 460px; width: 100%; margin-inline: auto; }
}

/* Sections */
section { padding: 64px 0; }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head p { color: var(--ink-soft); margin: 0; max-width: 60ch; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 980px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.card { background: var(--surface); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card .icon { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: 14px; }
.card .icon svg { width: 30px; height: 30px; }
.card p { color: var(--ink-soft); margin: 0; }

/* Language tiles */
.langs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .langs { grid-template-columns: repeat(2, 1fr); } }
.lang-tile { display: block; background: var(--surface); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border: 3px solid transparent; }
.lang-tile:hover { border-color: var(--brand); }
.lang-tile .flag { font-size: 2.2rem; line-height: 1; margin-bottom: 10px; display: flex; gap: 0; height: 28px; width: 42px; border-radius: 4px; overflow: hidden; }
.lang-tile .flag i { flex: 1; }
.lang-tile strong { display: block; font-size: 1.2rem; }
.lang-tile span { color: var(--ink-soft); font-size: .9rem; }

/* Book grid */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filter-group .label { font-weight: 700; margin-right: 6px; min-width: 110px; }
.chip { font: inherit; font-weight: 700; min-height: 48px; padding: 8px 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.result-count { color: var(--ink-soft); margin: 4px 0 24px; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px; }
.book-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s ease; }
.book-card[hidden] { display: none; }
.book-card:hover { transform: translateY(-4px); }
.book-card .cover { aspect-ratio: 621 / 810; background: var(--surface-2); overflow: hidden; }
.book-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.book-card h3 { font-size: 1.1rem; margin: 0; }
.book-card h3 a { color: var(--ink); text-decoration: none; }
.book-card h3 a::after { content: ""; position: absolute; inset: 0; }
.book-card { position: relative; }
.book-card .sub { color: var(--ink-soft); font-size: .9rem; margin: 0; }
.book-card .more { margin-top: auto; font-weight: 700; color: var(--brand); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.tag-it { background: var(--it); color: #fff; }
.tag-fr { background: var(--fr); color: #fff; }
.tag-en { background: var(--en); color: #fff; }
.tag-lv { background: var(--accent); color: var(--accent-ink); }
html[data-contrast="high"] .tag { background: #000; color: #fff; border: 2px solid #fff; }

.coming-soon { display: none; text-align: center; padding: 40px 24px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.coming-soon.show { display: block; }

/* Book detail */
.breadcrumb { font-size: .9rem; margin-bottom: 20px; color: var(--ink-soft); }
.book-detail { display: grid; grid-template-columns: 420px 1fr; gap: 48px; align-items: start; }
@media (max-width: 900px) { .book-detail { grid-template-columns: 1fr; } }
.book-detail .cover-lg { border-radius: 14px; box-shadow: 0 18px 40px rgba(20,33,61,.22); overflow: hidden; }
.book-detail .original { color: var(--ink-soft); font-size: 1.1rem; font-style: italic; margin-top: -6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 24px 0; padding: 0; list-style: none; }
.facts li { background: var(--surface); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.facts b { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.check-list { list-style: none; padding: 0; margin: 0 0 1.5em; }
.check-list li { position: relative; padding-left: 40px; margin-bottom: 10px; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .2em; width: 26px; height: 26px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314213d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 16px no-repeat; }
.buy-box { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin: 24px 0; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.buy-box p { margin: 0; flex: 1 1 220px; color: var(--ink-soft); }
.samples { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.samples figure { margin: 0; background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.samples button { all: unset; cursor: zoom-in; display: block; border-radius: 8px; overflow: hidden; }
.samples button:focus-visible { outline: 4px solid var(--focus); }
.samples figcaption { font-size: .85rem; color: var(--ink-soft); padding: 10px 4px 0; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 92vh; width: auto; border-radius: 8px; background: #fff; }
.lightbox .close { position: absolute; top: 16px; right: 16px; }

/* Steps / CTA */
.cta { background: var(--brand); color: var(--brand-ink); border-radius: 28px; padding: 48px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.cta p { margin: 0; opacity: .92; }
@media (max-width: 760px) { .cta { grid-template-columns: 1fr; padding: 32px 24px; } }

.faq details { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 14px; }
.faq summary { cursor: pointer; padding: 20px 24px; font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 24px 20px; color: var(--ink-soft); }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.4em; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--ink); color: #e9ecf4; padding: 48px 0 32px; margin-top: 40px; }
html[data-contrast="high"] .site-footer { background: #000; border-top: 2px solid #fff; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.copyright { border-top: 1px solid rgba(255,255,255,.2); margin-top: 32px; padding-top: 20px; font-size: .85rem; opacity: .85; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
