:root {
  --navy: #1b3a7a;
  --navy-deep: #1f2a3c;
  --blue: #3b82f6;
  --green: #0c8c62;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #182033;
  --muted: #4f5b71;
  --rule: #dfe5ee;
  --link: #1d4ed8;
  --hero-text: #ffffff;
  --hero-muted: rgba(255, 255, 255, 0.82);
  --shadow: 0 10px 30px rgba(24, 32, 51, 0.12);
  --shadow-cover: 0 14px 28px rgba(10, 18, 40, 0.35);
  --chip: #e8eefb;
  --chip-text: #1b3a7a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1522;
    --surface: #171f31;
    --text: #e8edf5;
    --muted: #a7b2c6;
    --rule: #2a3449;
    --link: #8fb4ff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --chip: #202c47;
    --chip-text: #bcd0ff;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1522;
  --surface: #171f31;
  --text: #e8edf5;
  --muted: #a7b2c6;
  --rule: #2a3449;
  --link: #8fb4ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --chip: #202c47;
  --chip-text: #bcd0ff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}
a { color: var(--link); }
img { display: block; max-width: 100%; height: auto; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 16px; z-index: 20; }

/* Top bar */
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; gap: 16px; }
.brand { color: #fff; text-decoration: none; font-weight: 800; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a { color: var(--hero-muted); text-decoration: none; font-size: 0.92rem; font-weight: 500; padding: 6px 12px; border-radius: 999px; }
.topbar nav a:hover, .topbar nav a:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.14); }

/* Hero */
.hero {
  background:
    radial-gradient(60% 80% at 85% 10%, rgba(59, 130, 246, 0.38), transparent 60%),
    radial-gradient(50% 70% at 5% 95%, rgba(12, 140, 98, 0.38), transparent 60%),
    linear-gradient(135deg, var(--navy), var(--navy-deep));
  color: var(--hero-text);
  padding: 120px 0 0;
  border-bottom: 6px solid;
  border-image: linear-gradient(90deg, var(--blue), var(--green)) 1;
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.4fr 0.9fr; gap: 48px; align-items: center; }
.eyebrow { margin: 0 0 12px; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--hero-muted); }
.hero h1 { margin: 0; font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.2rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; }
.hero h1 span { background: linear-gradient(90deg, #7fb0ff, #4fd1a5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { max-width: 38rem; margin: 22px 0 0; font-size: 1.18rem; color: var(--hero-muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-weight: 600; text-decoration: none; font-size: 0.98rem; border: 1px solid transparent; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: #fff; color: var(--navy); }
.btn.primary:hover { background: #eef3ff; }
.btn.ghost { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.12); }
.btn:focus-visible, .card:focus-visible, .cover-link:focus-visible { outline: 3px solid #7fb0ff; outline-offset: 3px; }

.portrait { justify-self: center; position: relative; width: min(340px, 78vw); }
.portrait::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; background: conic-gradient(from 200deg, var(--blue), var(--green), var(--blue)); opacity: 0.9; }
.portrait img { position: relative; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 6px solid var(--navy-deep); }

/* Cover fan in the hero */
.fan { display: flex; justify-content: center; align-items: flex-end; margin-top: 64px; height: 190px; padding: 0 16px; }
.fan a { display: block; width: clamp(78px, 13vw, 130px); margin-inline: clamp(-14px, -1.4vw, -6px); transform: translateY(var(--y, 40px)) rotate(var(--r, 0deg)); transition: transform .25s ease; transform-origin: bottom center; }
.fan a:hover, .fan a:focus-visible { transform: translateY(0) rotate(0deg) scale(1.06); z-index: 3; }
.fan img { border-radius: 4px; box-shadow: var(--shadow-cover); }
@media (max-width: 560px) { .fan a:nth-child(n+6) { display: none; } .fan { height: 150px; margin-top: 44px; } }

/* Sections */
section { padding: 72px 0 8px; }
.section-head { max-width: 46rem; margin-bottom: 30px; }
.kicker { margin: 0 0 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); }
h2 { margin: 0 0 12px; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; }
h3 { margin: 0 0 6px; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.section-head p { margin: 0; color: var(--muted); font-size: 1.05rem; }

.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
.about-grid p { margin: 0 0 16px; }
.facts { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 22px 24px; box-shadow: var(--shadow); }
.facts h3 { margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { background: var(--chip); color: var(--chip-text); font-size: 0.88rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.facts p { color: var(--muted); font-size: 0.95rem; margin: 16px 0 0; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 24px; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; border-top: 4px solid var(--blue); }
.card:nth-child(2n) { border-top-color: var(--green); }
.card:nth-child(3n) { border-top-color: var(--navy); }
a.card:hover { transform: translateY(-3px); border-color: var(--blue); }
.card p { margin: 0 0 14px; color: var(--muted); font-size: 0.97rem; }
.card .more { margin-top: auto; font-weight: 600; color: var(--link); font-size: 0.95rem; }
.tag { align-self: flex-start; margin-bottom: 12px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--chip-text); background: var(--chip); padding: 3px 10px; border-radius: 999px; }

/* Featured book */
.feature { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 40px; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); margin-bottom: 36px; }
.feature img { border-radius: 4px; box-shadow: var(--shadow-cover); }
.feature p { margin: 0 0 14px; color: var(--muted); }
.feature .btn { background: var(--navy); color: #fff; }
.feature .btn:hover { background: var(--blue); }

/* Book grid */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 20px; list-style: none; margin: 0; padding: 0; }
.shelf li { display: flex; flex-direction: column; gap: 10px; }
.cover-link { display: block; transition: transform .2s ease; }
.cover-link:hover { transform: translateY(-4px) rotate(-1deg); }
.shelf img { border-radius: 3px; box-shadow: var(--shadow-cover); width: 100%; }
.shelf .no { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--green); }
.shelf .t { font-weight: 700; font-size: 0.97rem; line-height: 1.3; }
.shelf .t a { color: var(--text); text-decoration: none; }
.shelf .t a:hover { color: var(--link); text-decoration: underline; }
.shelf .d { font-size: 0.86rem; color: var(--muted); line-height: 1.45; }
.subhead { margin: 40px 0 16px; font-size: 1rem; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }

.note { margin-top: 28px; padding: 16px 20px; border-left: 4px solid var(--green); background: var(--surface); border-radius: 0 10px 10px 0; color: var(--muted); font-size: 0.95rem; }
.note strong { color: var(--text); }

/* Kvadrat */
.kvadrat { background: linear-gradient(135deg, var(--navy), var(--navy-deep)); color: #fff; border-radius: 18px; padding: 36px; display: grid; grid-template-columns: 1.4fr auto; gap: 28px; align-items: center; box-shadow: var(--shadow); }
.kvadrat h2 { color: #fff; margin-bottom: 10px; }
.kvadrat p { margin: 0; color: var(--hero-muted); max-width: 40rem; }
.kvadrat .btn.primary { white-space: nowrap; }

footer { padding: 56px 0 48px; color: var(--muted); font-size: 0.92rem; }
footer .wrap { border-top: 1px solid var(--rule); padding-top: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer a { color: var(--muted); }

@media (max-width: 860px) {
  .hero { padding-top: 104px; }
  .hero-grid, .about-grid, .feature, .kvadrat { grid-template-columns: 1fr; }
  .hero-grid { gap: 36px; }
  .portrait { order: -1; width: min(240px, 62vw); }
  .feature { padding: 22px; gap: 24px; }
  .feature img { max-width: 220px; }
  .kvadrat { padding: 26px; }
  .topbar nav { display: none; }
}

/* Hero pill */
.hero-pill { display: inline-flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 26px; padding: 8px 16px 8px 8px; border-radius: 999px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.22); color: #fff; text-decoration: none; font-size: 0.93rem; font-weight: 500; }
.hero-pill span { background: #4fd1a5; color: #06281d; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.hero-pill:hover { background: rgba(255,255,255,0.18); }
.hero-pill:focus-visible { outline: 3px solid #7fb0ff; outline-offset: 3px; }

/* BoardBridge */
.bb { padding: 80px 0 72px; margin-top: 72px; background: linear-gradient(180deg, var(--chip) 0%, var(--bg) 100%); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.bb-intro { max-width: 52rem; }
.bb-intro p { margin: 0 0 14px; color: var(--muted); font-size: 1.05rem; }
.bb-intro .actions { margin-top: 24px; }
.btn.solid { background: var(--navy); color: #fff; }
.btn.solid:hover { background: var(--blue); }
.btn.outline { color: var(--navy); border-color: var(--navy); background: transparent; }
.btn.outline:hover { background: var(--surface); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.solid { background: var(--blue); }
  :root:not([data-theme="light"]) .btn.outline { color: #bcd0ff; border-color: #5b7fc7; }
}
:root[data-theme="dark"] .btn.solid { background: var(--blue); }
:root[data-theme="dark"] .btn.outline { color: #bcd0ff; border-color: #5b7fc7; }
.bb .btn:focus-visible, .shot a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.bb-gallery { display: grid; grid-template-columns: 1.7fr 1fr; gap: 36px 40px; margin-top: 48px; align-items: start; }
.shot { margin: 0; }
.shot a { display: block; text-decoration: none; transition: transform .2s ease; }
.shot a:hover { transform: translateY(-4px); }
.shot figcaption { margin-top: 14px; color: var(--muted); font-size: 0.93rem; line-height: 1.5; }
.shot figcaption strong { color: var(--text); }
.shot.desk img { width: 100%; border-radius: 0 0 10px 10px; border: 1px solid var(--rule); border-top: 0; box-shadow: var(--shadow); background: #fff; }
.frame { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: #e3e8f1; border: 1px solid var(--rule); border-bottom: 0; border-radius: 10px 10px 0 0; }
.frame span { width: 10px; height: 10px; border-radius: 50%; background: #b9c2d3; }
.frame em { margin-left: 10px; font-style: normal; font-size: 0.78rem; color: #55627a; background: #f6f8fb; padding: 2px 14px; border-radius: 999px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .frame { background: #232d45; }
  :root:not([data-theme="light"]) .frame span { background: #46526e; }
  :root:not([data-theme="light"]) .frame em { background: #171f31; color: #a7b2c6; }
}
:root[data-theme="dark"] .frame { background: #232d45; }
:root[data-theme="dark"] .frame span { background: #46526e; }
:root[data-theme="dark"] .frame em { background: #171f31; color: #a7b2c6; }

.shot.phone { justify-self: center; width: min(300px, 80%); grid-row: span 1; }
.phone-frame { background: #0c1220; padding: 10px; border-radius: 34px; box-shadow: var(--shadow-cover); }
.phone-frame img { width: 100%; border-radius: 26px; }
.bb-points { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 24px 26px; box-shadow: var(--shadow); }
.bb-points ul { margin: 12px 0 14px; padding-left: 20px; }
.bb-points li { margin-bottom: 6px; }
.bb-points p { margin: 0 0 14px; color: var(--muted); font-size: 0.92rem; }
.bb-points .more { font-weight: 600; }
@media (max-width: 860px) {
  .bb { padding-top: 56px; margin-top: 56px; }
  .bb-gallery { grid-template-columns: 1fr; gap: 32px; }
  .bb-intro .actions .btn { width: 100%; justify-content: center; }
}
