/* ==========================================================================
   Qabr Sync — site styles
   One file, no build step. Sections: tokens · base · layout · header ·
   components · home sections · footer · inner pages · utilities.
   ========================================================================== */

/* Self-hosted serif (no third-party font requests). Latin subset, variable weight. */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("../fonts/SourceSerif4-Variable-latin.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  /* Warm paper surfaces (daytime counterpart of the app's charcoal) */
  --paper: #F6F1E8;
  --paper-2: #FCFAF5;
  --paper-3: #EEE7D9;
  --line: #E3DBCB;
  --line-strong: #D1C7B2;

  /* Ink */
  --ink: #1C1A16;
  --ink-2: #4A463F;
  --ink-3: #6B655A;

  /* The app's gold, in tones that hold contrast on paper */
  --gold: #CFAF55;        /* fills, dots, on dark */
  --gold-icon: #A8862E;   /* line icons on paper (≥3:1) */
  --gold-text: #7D651F;   /* small text on paper (≥4.5:1) */
  --gold-line: #DCC98F;   /* decorative rings */
  --gold-soft: #F0E5C6;

  /* The app's night palette, used for the Qabr+ card and footer */
  --night: #121110;
  --night-2: #1B1A17;
  --night-line: #2E2B26;
  --cream: #F3EBDA;
  --cream-2: #CFC7B6;
  --cream-3: #9B948A;

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 20px;
  --radius-lg: 28px;
  --pill: 999px;
  --container: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-phone: 0 48px 80px -40px rgba(28, 26, 22, .45), 0 12px 24px -16px rgba(28, 26, 22, .25);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.012em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 1.6rem + 3.4vw, 4.5rem); line-height: 1.02; }
h2 { font-size: clamp(1.875rem, 1.3rem + 1.7vw, 2.75rem); }
h3 { font-size: 1.375rem; letter-spacing: -.005em; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

img, svg { max-width: 100%; height: auto; display: block; }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--gold-icon);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--gold-soft); color: var(--ink); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(64px, 9vw, 120px); }
.section--tint { background: var(--paper-3); }

.section__head { max-width: 640px; margin-bottom: 12px; }
.section__head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin: 0 0 18px;
}

.lead {
  font-size: clamp(1.125rem, 1rem + .5vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-2);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--pill);
  font-family: var(--sans);
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: relative;
  padding-block: 18px;
  z-index: 10;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 48px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -.01em;
  padding: 6px 0;
}
.brand .mark { width: 28px; height: 28px; color: var(--gold-icon); }

.mark { display: block; color: var(--gold-icon); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.site-nav a {
  display: inline-block;
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 11px 14px;
  border-radius: var(--pill);
  transition: color .2s, background-color .2s;
}
.site-nav a:hover { color: var(--ink); background: rgba(28, 26, 22, .05); }
.site-nav a[aria-current="page"] { color: var(--ink); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 500;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle .i-close { display: none; }
.is-open .nav-toggle .i-menu { display: none; }
.is-open .nav-toggle .i-close { display: block; }

@media (max-width: 819px) {
  .js .nav-toggle { display: inline-flex; }

  /* No-JS fallback: links simply wrap onto a second row. */
  .site-header__inner { flex-wrap: wrap; }
  .site-nav { width: 100%; flex-wrap: wrap; justify-content: space-between; }

  /* With JS: a dropdown panel under the header. */
  .js .site-nav {
    display: none;
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    top: calc(100% + 2px);
    width: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: 0 30px 50px -30px rgba(28, 26, 22, .4);
  }
  .js .site-header.is-open .site-nav { display: flex; }
  .js .site-nav ul { flex-direction: column; gap: 2px; }
  .js .site-nav a { display: block; padding: 14px 16px; font-size: 1.0625rem; }
  .js .site-nav__cta { padding: 12px 8px 6px; margin-top: 8px; border-top: 1px solid var(--line); }
  .js .site-nav__cta > * { width: 100%; justify-content: center; }
}

/* ---------- Components ---------- */

/* App Store area — pre-launch state (not a link). */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  white-space: nowrap;
}
.pill--lg { min-height: 52px; padding: 12px 22px; font-size: 1rem; }
.pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
  flex: none;
}

/* App Store area — live state (official badge). */
.store-badge { display: inline-block; border-radius: 8px; line-height: 0; }
.store-badge img { height: 48px; width: auto; }
.store-badge--sm img { height: 40px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 0;
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.link-arrow:hover { text-decoration: underline; }
.link-arrow:hover svg { transform: translateX(3px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 26px;
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--pill);
  transition: transform .2s var(--ease), background-color .2s;
}
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: #D8BB63; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }

/* iPhone frame. Put the frame inside a wrapper that sets the width. */
.phone-wrap { width: 100%; }
.phone {
  position: relative;
  margin: 0;
  width: 100%;
  padding: 3.4%;
  background: #0B0B0A;
  border-radius: 16.4% / 7.86%;
  box-shadow: var(--shadow-phone), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.phone__screen {
  position: relative;
  aspect-ratio: 9 / 19.5;
  overflow: hidden;
  border-radius: 14% / 6.46%;
  background: #141311;
}
.phone__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Dynamic Island */
.phone__screen::after {
  content: "";
  position: absolute;
  top: 2.6%;
  left: 50%;
  width: 31%;
  aspect-ratio: 126 / 37;
  transform: translateX(-50%);
  background: #0B0B0A;
  border-radius: var(--pill);
}

/* Faint concentric rings (the app's home-screen motif) */
.rings {
  position: absolute;
  color: var(--line-strong);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 74%);
  mask-image: radial-gradient(circle, #000 30%, transparent 74%);
}

/* ---------- Home: hero ---------- */
.hero {
  position: relative;
  overflow: clip;
  padding-block: clamp(28px, 5vw, 64px) clamp(64px, 8vw, 112px);
}
.hero__inner {
  display: grid;
  gap: 56px;
  align-items: center;
}
.hero__copy { max-width: 640px; }
.hero__copy .lead { max-width: 32em; }
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin-top: 32px;
}
.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero__visual .rings {
  left: 50%;
  top: 50%;
  width: min(190%, 920px);
  transform: translate(-50%, -50%);
  color: #C2B59B;
}
.hero__visual .phone-wrap { position: relative; width: min(100%, 300px); }

@media (min-width: 900px) {
  .hero__inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 64px; }
  .hero__visual .phone-wrap { width: min(100%, 320px); }
}
@media (max-width: 899px) {
  .hero__visual .phone-wrap { width: min(72%, 260px); }
}

/* Gentle entrance, disabled for reduced motion */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.hero__copy > * { animation: rise .7s var(--ease) both; }
.hero__copy > :nth-child(2) { animation-delay: .06s; }
.hero__copy > :nth-child(3) { animation-delay: .12s; }
.hero__copy > :nth-child(4) { animation-delay: .18s; }
.hero__visual { animation: rise .9s var(--ease) .15s both; }

/* ---------- Home: features ---------- */
.features {
  display: grid;
  gap: 40px 32px;
  margin-top: 48px;
}
@media (min-width: 760px) {
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.feature__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  color: var(--gold-icon);
  background: var(--paper-2);
  border: 1px solid var(--gold-line);
  border-radius: 50%;
}
.feature__icon svg { width: 24px; height: 24px; }
.feature h3 { margin-bottom: .4em; }
.feature p { color: var(--ink-2); max-width: 36ch; }
.feature__note {
  margin-top: 14px;
  padding-left: 14px;
  border-left: 2px solid var(--gold-line);
  font-family: var(--sans);
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--ink-3);
}

.more {
  margin-top: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.more__title {
  margin: 0 0 28px;
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.more__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px 32px;
}
@media (min-width: 640px) { .more__list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .more__list { grid-template-columns: repeat(4, 1fr); } }
.more__list li { display: flex; gap: 14px; align-items: flex-start; }
.more__icon { flex: none; width: 22px; height: 22px; margin-top: 3px; color: var(--gold-icon); }
.more__list strong { display: block; font-weight: 600; font-size: 1.0625rem; margin-bottom: 2px; }
.more__list span { display: block; color: var(--ink-2); font-size: .9375rem; line-height: 1.5; }

/* ---------- Home: screenshots ---------- */
.gallery {
  list-style: none;
  margin: 40px 0 0;
  padding: 12px var(--gutter) 24px;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery__item {
  flex: 0 0 auto;
  width: min(62vw, 236px);
  scroll-snap-align: start;
}
.gallery figcaption {
  margin-top: 18px;
  text-align: center;
  font-size: 1.0625rem;
  color: var(--ink-2);
}
.gallery__hint {
  margin: 4px 0 0;
  text-align: center;
  font-family: var(--sans);
  font-size: .8125rem;
  color: var(--ink-3);
}
@media (min-width: 1180px) {
  .gallery {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 28px;
    max-width: 1280px;
    margin-inline: auto;
    overflow: visible;
  }
  .gallery__item { width: auto; }
  .gallery__hint { display: none; }
}

/* ---------- Home: Qabr+ ---------- */
.plus {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 40px;
  padding: clamp(32px, 5vw, 64px);
  color: var(--cream);
  background: var(--night-2);
  border: 1px solid var(--night-line);
  border-radius: var(--radius-lg);
}
@media (min-width: 860px) {
  .plus { grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
}
.plus > :not(.rings) { position: relative; }
.plus .rings { position: absolute; }
.plus .rings {
  right: -22%;
  top: -55%;
  width: min(90%, 640px);
  color: #3A362D;
}
.plus .eyebrow { color: var(--gold); }
.plus h2 { color: var(--cream); }
.plus p { color: var(--cream-2); }
.plus__list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 12px;
}
.plus__list li {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  font-weight: 600;
  font-size: 1.0625rem;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--night-line);
  border-radius: 16px;
}
.plus__list svg { flex: none; width: 20px; height: 20px; color: var(--gold); }
.plus__price {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--cream-2);
}
.plus__fine {
  margin: 0;
  font-family: var(--sans);
  font-size: .8125rem;
  color: var(--cream-3);
}

/* ---------- Home: privacy ---------- */
.privacy {
  display: grid;
  gap: 40px;
}
@media (min-width: 900px) {
  .privacy { grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
}
.privacy__copy p { color: var(--ink-2); }
.privacy__points {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
}
.privacy__points li {
  display: grid;
  gap: 4px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-strong);
}
.privacy__points strong { font-weight: 600; font-size: 1.125rem; }
.privacy__points span { color: var(--ink-2); }

/* ---------- Home: closing CTA ---------- */
.cta { text-align: center; border-top: 1px solid var(--line); }
.cta__inner {
  max-width: 640px;
  display: grid;
  justify-items: center;
  gap: 6px;
}
.cta .mark { width: 40px; height: 40px; margin-bottom: 18px; }
.cta p { margin-bottom: 26px; font-size: 1.125rem; color: var(--ink-2); }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 48px;
  background: var(--night);
  color: var(--cream-2);
  font-family: var(--sans);
  font-size: .9375rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}
.brand--footer { color: var(--cream); font-family: var(--serif); }
.brand--footer .mark { color: var(--gold); }
.site-footer nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px 28px;
}
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 0;
  color: var(--cream-2);
  text-decoration: none;
}
.site-footer nav a:hover { color: var(--cream); text-decoration: underline; }
.site-footer__copy { margin: 0; color: var(--cream-3); }
.site-footer :focus-visible { outline-color: var(--gold); }

/* ---------- Inner pages (Privacy, Support) ---------- */
.page { padding-block: clamp(32px, 6vw, 72px) clamp(64px, 9vw, 120px); }
.page__head { max-width: 720px; margin-bottom: 40px; }
.page__head h1 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem); }
.meta {
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-3);
}

.prose { max-width: 70ch; }
.prose h2 {
  font-size: 1.5rem;
  margin: 2.4em 0 .6em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
}
.prose h3 { font-size: 1.125rem; margin: 1.6em 0 .4em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.25em; margin: 0 0 1em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--gold-icon); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); }

.contents {
  margin: 24px 0 0;
  padding: 24px 28px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.contents__title {
  margin: 0 0 12px;
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.contents ol {
  margin: 0;
  padding-left: 1.4em;
  font-family: var(--sans);
  font-size: .9375rem;
  line-height: 1.5;
  columns: 2;
  column-gap: 32px;
}
.contents li { margin-bottom: 0; break-inside: avoid; }
.contents a { color: var(--ink-2); text-decoration: none; padding: 10px 0; display: block; }
.contents a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 600px) { .contents ol { columns: 1; } }

/* Owner-facing draft markers — delete before publishing. */
.draft-notice {
  margin: 0 0 40px;
  padding: 20px 24px;
  background: #FFF3CC;
  border: 1px solid #E8D48C;
  border-radius: 16px;
  color: #5A4300;
  font-family: var(--sans);
  font-size: .9375rem;
  line-height: 1.55;
}
.draft-notice strong { color: inherit; }
.draft-notice code {
  font-size: .9em;
  padding: 1px 6px;
  background: rgba(90, 67, 0, .1);
  border-radius: 6px;
}
mark.todo {
  padding: .12em .45em;
  background: #FFF3CC;
  color: #5A4300;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: .88em;
  line-height: 1.4;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
mark.todo::before {
  content: "TODO";
  margin-right: .5em;
  font-size: .78em;
  font-weight: 700;
  letter-spacing: .08em;
}

/* Support topics */
.topics {
  list-style: none;
  margin: 40px 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
@media (min-width: 640px) { .topics { grid-template-columns: repeat(2, 1fr); } }
.topic {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 26px 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.topic h2 { font-size: 1.25rem; margin: 0; }
.topic p { margin: 0 0 6px; font-size: 1rem; color: var(--ink-2); }
.topic .link-arrow { margin-top: auto; }

.tips {
  max-width: 70ch;
  padding: 24px 28px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tips h2 { font-size: 1.25rem; margin: 0 0 10px; }
.tips ul { margin: 0; padding-left: 1.25em; color: var(--ink-2); }
.tips li { margin-bottom: .35em; }
.tips li::marker { color: var(--gold-icon); }

/* ---------- Utilities / preferences ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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