/* Reading Path — one stylesheet for every page (home, Support, Privacy Policy).
   Contents: 1 Fonts · 2 Tokens · 3 Base · 4 Typography · 5 Header · 6 Buttons · 7 Home page · 8 Support and Privacy · 9 Footer · 10 Breakpoints */

/* ===== 1. Fonts (self-hosted, Latin subset, SIL OFL 1.1) =====
   Only weights 400, 500 and 600 are loaded. Never use bold (700) anywhere, or browsers fake it. */
@font-face { font-family: "Lora"; src: url("fonts/lora-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("fonts/lora-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/source-sans-3-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ===== 2. Tokens ===== */
:root {
  /* colour */
  --parchment: #F4EBDA;
  --navy: #12324A;
  --teal: #1F6B6B;
  --sage: #E3EDE3;
  --cream: #FBF5E8;

  /* fonts */
  --font-heading: "Lora", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;

  /* type scale: every piece of text on the site uses one of these */
  --fs-h1: clamp(2.25rem, 4vw, 3.5rem);     /* page headline                     Lora 600 */
  --fs-h2: clamp(1.75rem, 3vw, 2.5rem);     /* section headings                  Lora 500 */
  --fs-h3: 1.35rem;                         /* card titles, policy sub-headings  Lora 600 */
  --fs-body: 1.125rem;                      /* paragraphs, 18px (16px on phones) Source Sans 3 400 */
  --fs-ui: 1rem;                            /* navigation, buttons, links        Source Sans 3 600 */
  --fs-label: 0.9375rem;                    /* small uppercase labels            Source Sans 3 600, 0.08em */
  --fs-byline: 0.9375rem;                   /* "by Luna Studio" under the name  Source Sans 3 400 */
  --fs-brand: 1.85rem;                      /* "Reading Path" next to the logo   Lora 600 */
  --measure: 52ch;                          /* about 62 characters per line */
}

/* ===== 3. Base ===== */
* { box-sizing: border-box; }
html { background: var(--parchment); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--navy);
  font: 400 var(--fs-body)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
}
/* Lighthouse scene: stays put while the page scrolls (a fixed layer also works on iOS) */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  background: var(--parchment) url("img/bg.webp") no-repeat left bottom / cover;
}
@media (orientation: landscape) { body::before { background-position: center 80%; } }

main, footer { position: relative; z-index: 1; }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }
.panel { background: rgba(244,235,218,.9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 1.5rem; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }

/* ===== 4. Typography ===== */
h1 { font: 600 var(--fs-h1)/1.15 var(--font-heading); margin: 0 0 1.25rem; text-wrap: balance; }
.section-title { font: 500 var(--fs-h2)/1.25 var(--font-heading); margin: 0 0 1.5rem; text-wrap: balance; }
.feature h3, .doc h2, .doc summary, .doc .summary { font: 600 var(--fs-h3)/1.3 var(--font-heading); }

.tagline { margin: 0; font: 600 var(--fs-label)/1.5 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--teal); text-wrap: balance; }
.platform { margin: 0; color: var(--teal); }

/* navigation, buttons, small links: Source Sans 3 600 */
.site-nav a, .nav-toggle, .button, .skip, .platform, .doc .updated, footer a { font: 600 var(--fs-ui)/1.6 var(--font-body); }

.lead-copy, .preview-copy, .band-support p, .doc p, .doc li { max-width: var(--measure); text-wrap: pretty; }

/* ===== 5. Header and navigation ===== */
.skip {
  position: absolute; left: -999px; top: .5rem; z-index: 20;
  padding: .6rem 1rem; border-radius: .5rem;
  background: var(--navy); color: var(--parchment); text-decoration: none;
}
.skip:focus { left: 1rem; }

.site-header { position: relative; z-index: 5; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-top: 1.25rem; padding-bottom: .5rem; }
.brand { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-content: center; column-gap: .8rem; }
.brand-mark { grid-row: 1 / span 2; align-self: center; line-height: 0; }
.brand-mark img { width: 4.75rem; height: 4.75rem; }
.logo { align-self: end; font: 600 var(--fs-brand)/1.1 var(--font-heading); color: var(--navy); text-decoration: none; }
.byline { align-self: start; font: 400 var(--fs-byline)/1.3 var(--font-body); color: #4A5D6C; text-decoration: none; }
.byline:hover { color: var(--navy); text-decoration: underline; }

.site-nav ul { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: block; padding: .5rem .9rem; border-radius: 999px; color: var(--navy); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: rgba(255,255,255,.75); }
.nav-toggle { display: none; min-height: 44px; padding: .4rem 1.1rem; color: var(--navy); background: rgba(255,255,255,.75); border: 2px solid var(--navy); border-radius: 999px; cursor: pointer; }

/* ===== 6. Buttons ===== */
.button {
  display: inline-block; padding: .9rem 2rem; border-radius: 999px;
  color: var(--parchment); background: var(--navy); text-decoration: none;
  box-shadow: 0 10px 18px -10px rgba(18,50,74,.6);
  transition: transform .15s ease, box-shadow .15s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 14px 20px -10px rgba(18,50,74,.6); }

/* ===== 7. Home page ===== */
/* introduction */
.land-hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; align-items: center; padding-block: 2.5rem 3.5rem; }
.hero-copy { padding: 2rem 1.75rem; }
.lead-copy { margin: 1.25rem 0 2rem; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }

/* two overlapping app screens */
.device-pair { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 30rem; justify-self: center; }
.device { padding: .4rem; background: #1d1d1f; border-radius: 1.3rem; box-shadow: 0 26px 40px -24px rgba(18,50,74,.6), 0 0 0 2px #3a3a3c inset; }
.device img { display: block; width: 100%; height: auto; border-radius: .9rem; }
.device-front { order: 2; width: 52%; z-index: 2; box-shadow: 0 34px 46px -22px rgba(18,50,74,.7), 0 0 0 2px #3a3a3c inset; }
.device-back { order: 1; width: 61%; margin: 4.5rem -13% 0 0; z-index: 1; }   /* landscape screen, tucked behind the portrait one */

/* full-width colour bands */
.band { position: relative; z-index: 1; padding: 3.5rem 0; scroll-margin-top: 0; }
.band-features { background: var(--sage); }
.band-preview { background: var(--cream); }
.band-support { background: var(--parchment); text-align: center; }
.band .section-title { text-align: center; margin-bottom: 2rem; }
.band-support .section-title { margin-bottom: .5rem; }
.band-support p { margin: 0 auto 1.5rem; }

/* feature cards */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.feature { padding: 2rem 1.25rem; text-align: center; background: rgba(255,255,255,.85); border-radius: 1.25rem; }
.feature .icon { display: grid; place-items: center; width: 5rem; height: 5rem; margin: 0 auto 1.25rem; border-radius: 50%; color: var(--teal); background: rgba(31,107,107,.12); }
.feature .icon svg { width: 2.75rem; height: 2.75rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 0 0 .6rem; text-wrap: balance; }
.feature p { margin: 0; text-wrap: pretty; }

/* app preview: the screenshot grid appears by itself once figures are added */
.preview-copy { margin: 0 auto; text-align: center; }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1.25rem; margin-top: 1.75rem; }
.shots:empty { display: none; }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; height: auto; border-radius: 1.1rem; border: 1px solid rgba(18,50,74,.15); box-shadow: 0 16px 26px -18px rgba(18,50,74,.6); }
.shots figcaption { margin-top: .5rem; font-size: var(--fs-ui); }

/* ===== 8. Support and Privacy pages ===== */
.doc { max-width: 36rem; margin: 1.5rem 0; padding: 2.5rem 2.25rem; }
.doc h1 { margin-bottom: .5rem; }
.doc .updated { margin: 0 0 2rem; color: var(--teal); }
.doc h2 { margin: 2.25rem 0 .5rem; }
.doc p { margin: 0 0 1rem; }
.doc ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.doc li { margin-bottom: .4rem; }
.doc a { color: var(--navy); font-weight: 600; }
.doc .summary { margin: 0 0 1.5rem; padding: .25rem 0 .25rem 1rem; border-left: 4px solid var(--teal); }
.doc details { padding: .9rem 0; border-top: 1px solid rgba(18,50,74,.2); }
.doc details:last-of-type { border-bottom: 1px solid rgba(18,50,74,.2); }
.doc summary { cursor: pointer; }
.doc details p { margin: .6rem 0 0; }

/* ===== 9. Footer ===== */
footer { padding: 0 0 calc(1.5rem + env(safe-area-inset-bottom, 0px)); font-size: var(--fs-ui); }
footer .wrap > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding: .75rem 1.5rem; background: rgba(244,235,218,.9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 999px; }
footer a { color: var(--navy); }
footer .links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
footer .links a { white-space: nowrap; }

/* ===== 10. Breakpoints ===== */
@media (max-width: 960px) {
  .land-hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 1.5rem; }
  .hero-copy { padding: 1.5rem 1.25rem; }
  .features { grid-template-columns: 1fr; }
  .feature { width: 100%; max-width: 34rem; margin-inline: auto; }
}
@media (max-width: 640px) {
  :root { --fs-body: 1rem; --fs-brand: 1.3rem; --fs-byline: 0.8125rem; }
  .band { padding: 2.5rem 0; }
  .doc { padding: 1.75rem 1.25rem; }
  .brand { column-gap: .6rem; }
  .brand-mark img { width: 3.5rem; height: 3.5rem; }

  /* menu becomes a button (only when JavaScript is available; otherwise the links stay visible) */
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; position: absolute; left: 1.5rem; right: 1.5rem; top: 100%; padding: .5rem; border-radius: 1.25rem; background: #F8F1E3; box-shadow: 0 24px 34px -22px rgba(18,50,74,.7); }
  .js .site-nav.open { display: block; }
  .js .site-nav ul { flex-direction: column; }
  .site-nav a { padding: .85rem 1rem; }
}
@media (max-width: 420px) {
  .device-back { margin-top: 3rem; }
}
@media (max-width: 360px) {
  :root { --fs-brand: 1.15rem; --fs-byline: 0.75rem; }
  .brand { column-gap: .5rem; }
  .brand-mark img { width: 3rem; height: 3rem; }
  .nav-toggle { padding: .4rem .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
