/* ==========================================================================
   Sveiflan — landing page (palette 2a: navy / cream)
   ========================================================================== */

:root {
  --ink: #1b2430;
  --paper: #f7f3ea;
  --green: #3a5a8c;
  --green-dark: #1c2f4d;
  --muted: #6b6f76;
  --line: rgba(0, 0, 0, .08);

  --radius-btn: 4px;
  --radius-viewer: 6px;
  --radius-card: 8px;
  --radius-pill: 100px;

  --pad-x: 40px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; margin: 0; }
p { margin: 0; }
a { color: inherit; transition: color .15s; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  z-index: 10;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* ------------------------------ Nav ------------------------------------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--pad-x);
  border-bottom: 1px solid var(--line);
  position: relative;
}

.wordmark {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 26px;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 26px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--green-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  background: var(--ink);
  margin: 0 auto;
  transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ------------------------------ Hero ------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  gap: 20px;
}

.badge {
  display: inline-flex;
  width: fit-content;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green-dark);
  background: rgba(58, 90, 140, .15);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

.hero h1 {
  font-weight: 900;
  font-size: 44px;
  line-height: 1.06;
}

.lede {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 440px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }

.btn {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius-btn);
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--ink); color: var(--paper); padding: 14px 26px; }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { border: 1px solid var(--ink); color: var(--ink); padding: 13px 26px; }
.btn-outline:hover { border-color: var(--green-dark); color: var(--green-dark); }

.hero-media { position: relative; background: var(--green-dark); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ------------------------------ Reader ---------------------------------- */

.reader {
  padding: 72px var(--pad-x);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.section-head { text-align: center; max-width: 520px; }
.section-head h2 { font-size: 30px; margin-bottom: 10px; }
.section-head p { font-size: 15px; color: var(--muted); }

/* Heyzine embed. The frame's shape must match Heyzine's own page-layout
   setting (config.js `spread`), otherwise the viewer letterboxes itself:
   an open A4 spread is ~1.41:1, a single A4 page ~0.71:1. Some breathing
   room is added around the page for the viewer's own chrome. */
.flip-embed {
  width: 100%;
  border-radius: var(--radius-viewer);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  background: #111;

  /* Default (and the empty state) uses the wider frame. */
  max-width: 900px;
  aspect-ratio: 1.414 / 1;
}

.flip-embed[data-layout="spread"] { max-width: 900px; aspect-ratio: 1.414 / 1; }
.flip-embed[data-layout="single"] { max-width: 560px; aspect-ratio: .78 / 1; }

.flip-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Shown until config.js has a flipbookUrl. */
.flip-embed[data-state="empty"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px;
  background: var(--green-dark);
}
.flip-embed-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.flip-embed-placeholder img {
  max-height: 240px;
  width: auto;
  border-radius: var(--radius-btn);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.flip-embed-placeholder p {
  font-size: 13px;
  color: var(--paper);
  opacity: .85;
}

.reader-download { font-size: 13px; }
.reader-download a {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
}
.reader-download a:hover { text-decoration: underline; }

/* ------------------------------ Cards ----------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0 var(--pad-x) 64px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-margin-top: 90px;
}
.accent-bar { width: 32px; height: 4px; background: var(--green); border-radius: 2px; }
.card h3 { font-size: 19px; }
.card p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

.card-link {
  margin-top: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
  text-decoration: none;
}
.card-link:hover { text-decoration: underline; }

/* ------------------------------ Footer ---------------------------------- */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 26px var(--pad-x);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------ Responsive ------------------------------ */

@media (max-width: 900px) {
  :root { --pad-x: 24px; }

  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    z-index: 5;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 16px var(--pad-x); border-top: 1px solid var(--line); }

  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 44px var(--pad-x); order: 2; }
  .hero-media { order: 1; aspect-ratio: 4 / 3; }
  .hero h1 { font-size: 34px; }

  .reader { padding: 56px var(--pad-x); }
  .section-head h2 { font-size: 26px; }

  /* Heyzine always drops to a single page at this width regardless of the
     `spread` setting, so both layouts get the same portrait frame. */
  .flip-embed,
  .flip-embed[data-layout="spread"],
  .flip-embed[data-layout="single"] { max-width: 100%; aspect-ratio: .72 / 1; }

  .cards { grid-template-columns: 1fr; padding-bottom: 48px; }

  .footer { flex-direction: column; text-align: center; }
}

@media (max-width: 360px) {
  .flip-embed[data-state="empty"] { padding: 24px; }
  .flip-embed-placeholder img { max-height: 200px; }
}
