/* khetam.app: the invite page, the static pages and the landing page (Figma section 8).
   Colors from design/tokens.json, light and dark; Alan Sans and the Phosphor icons ship with the site. */

@import url('alan-sans.css');

@font-face { font-family: 'Phosphor'; src: url('../fonts/phosphor/PhosphorBold.ttf') format('truetype'); font-display: block; }
@font-face { font-family: 'PhosphorFill'; src: url('../fonts/phosphor/PhosphorFill.ttf') format('truetype'); font-display: block; }

:root {
  --surface: #FAF6EC; --surface-raised: #FFFFFF; --surface-sunken: #F1EBDC; --surface-end: #FFFFFF;
  --ink: #1B2B24; --ink-muted: #5B6B63; --brand: #1E4D3B; --on-brand: #FAF6EC;
  --brand-deep: #163A2D; --on-brand-deep: #FAF6EC; --brand-tint: #E3EDE6;
  --gold: #C9A24A; --gold-text: #8A6A1F; --border: #E2DBC9; --divider: rgba(27, 43, 36, 0.1);
  --apple: #000000; --on-apple: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0F1E18; --surface-raised: #16291F; --surface-sunken: #233D31; --surface-end: #0F1E18;
    --ink: #F1ECE0; --ink-muted: #A9B5AD; --brand: #6FB596; --on-brand: #0F1E18;
    --brand-deep: #0A2A1F; --on-brand-deep: #F1ECE0; --brand-tint: #1C3A2D;
    --gold: #D8B560; --gold-text: #E2C47A; --border: #2A4136; --divider: rgba(241, 236, 224, 0.1);
    --apple: #FFFFFF; --on-apple: #000000;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Alan Sans', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-end) 100%);
  line-height: 1.6;
}

a { color: var(--brand); }

.icon { font-family: 'Phosphor'; font-style: normal; font-weight: normal; line-height: 1; display: inline-block; }
.icon.fill { font-family: 'PhosphorFill'; }

.page { max-width: 1040px; margin: 0 auto; padding: 24px 20px 32px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top .logo img { height: 40px; display: block; }
/* The reversed logo is for the dark scheme only. */
.top .logo img.logo-dark { display: none; }
.top .domain { color: var(--ink-muted); font-weight: 600; font-size: 15px; direction: ltr; }

.eyebrow { color: var(--ink-muted); font-size: 17px; margin: 28px 0 16px; text-align: center; }

/* The khatma card: brand-deep with the eight-point star pattern, the name in gold. */
.khatma-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background-color: var(--brand-deep);
  color: var(--on-brand-deep);
  text-align: center;
}
.khatma-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.11;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23C9A24A' stroke-width='1.2'%3E%3Crect x='16' y='16' width='24' height='24'/%3E%3Crect x='16' y='16' width='24' height='24' transform='rotate(45 28 28)'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.khatma-card > * { position: relative; }
.khatma-card .head { padding: 24px 20px 20px; }
.khatma-card .photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; display: block; border: 2px solid var(--gold); }
.khatma-card h1 { color: var(--gold); font-size: 26px; margin: 0; line-height: 1.4; }
.khatma-card .ornament { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 12px; }
.khatma-card .ornament span { width: 56px; height: 1px; background: var(--gold); opacity: 0.8; }
.khatma-card .ornament i { width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg); }
.khatma-card .dedication { font-size: 17px; font-weight: 600; margin: 0; white-space: pre-line; }
.khatma-card .description { font-size: 14px; opacity: 0.8; margin: 6px 0 0; white-space: pre-line; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(250, 246, 236, 0.15); }
.stats div { padding: 14px 8px; }
.stats div + div { border-inline-start: 1px solid rgba(250, 246, 236, 0.15); }
.stats b { display: block; font-size: 20px; }
.stats b.gold { color: var(--gold); }
.stats small { font-size: 14px; opacity: 0.75; }

/* The details list. */
.details { margin-top: 16px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 24px; padding: 4px 20px; }
.details .row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.details .row + .row { border-top: 1px solid var(--divider); }
.details .label { color: var(--ink-muted); display: flex; align-items: center; gap: 8px; font-size: 16px; }
.details .label .icon { font-size: 20px; }
.details .value { font-weight: 700; font-size: 16px; text-align: end; }

/* Buttons: filled, no borders, full radius (design rules). */
.button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: 9999px; border: 0;
  font: inherit; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer;
}
.button.primary { background: var(--brand); color: var(--on-brand); width: 100%; margin-top: 20px; }
.button .icon { font-size: 20px; }
.hint { color: var(--ink-muted); font-size: 14px; text-align: center; margin: 10px 0 0; }

.stores { display: flex; gap: 12px; margin-top: 20px; }
.store {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 6px 12px; border-radius: 9999px; min-width: 0;
  background: var(--apple); color: var(--on-apple); text-decoration: none;
}
.store .icon { font-size: 26px; }
.store span { display: flex; flex-direction: column; line-height: 1.2; text-align: start; }
.store small { font-size: 12px; opacity: 0.85; }
.store b { font-size: 16px; direction: ltr; white-space: nowrap; }

.code-box { margin-top: 20px; background: var(--brand-tint); border-radius: 24px; padding: 16px; text-align: center; }
.code-box p { margin: 0; color: var(--ink-muted); font-size: 15px; }
.code-box .code { font-size: 30px; font-weight: 700; letter-spacing: 6px; color: var(--brand); direction: ltr; margin-top: 4px; }

/* On a computer: the QR card beside the invitation (Figma 54:2016). */
.invite-layout { display: block; }
.qr-card { display: none; }

@media (min-width: 900px) {
  .eyebrow { text-align: start; }
  .invite-layout { display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: center; }
  .invite-layout .main { max-width: 600px; }
  .qr-card {
    display: block; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 24px;
    padding: 28px; text-align: center;
  }
  .qr-card .qr { background: #FFFFFF; border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
  .qr-card .qr svg { width: 100%; height: auto; display: block; }
  .qr-card h2 { font-size: 18px; margin: 18px 0 4px; }
  .qr-card p { color: var(--ink-muted); margin: 0; font-size: 15px; }
  .phone-only { display: none !important; }
  .stores { justify-content: flex-start; }
  .store { flex: 0 0 auto; }
}

/* Footer. */
.footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 36px; color: var(--ink-muted); font-size: 14px; }
.footer a { color: var(--ink-muted); text-decoration: none; }
.footer .dot::before { content: '·'; }

/* Static pages (Figma 54:2575). */
.doc { max-width: 720px; margin: 0 auto; }
.doc h1 { font-size: 34px; margin: 28px 0 4px; line-height: 1.3; }
.doc .updated { color: var(--ink-muted); font-size: 14px; margin: 0 0 20px; }
.doc .body { font-size: 17px; }
.doc .body h2 { font-size: 20px; margin: 28px 0 8px; }
.doc .body h3 { font-size: 18px; margin: 22px 0 6px; }
.doc .body p, .doc .body li { color: var(--ink-muted); }
.doc .soon { margin-top: 24px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 24px; padding: 24px; color: var(--ink-muted); text-align: center; }

/* An invite that no longer works, and the landing page. */
.center-card { max-width: 480px; margin: 48px auto 0; text-align: center; }
.center-card .circle {
  width: 112px; height: 112px; border-radius: 50%; background: var(--brand-tint); color: var(--brand);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 48px;
}
.center-card h1 { font-size: 26px; margin: 0 0 8px; line-height: 1.4; }
.center-card p { color: var(--ink-muted); margin: 0; font-size: 17px; }
.center-card .stores { justify-content: center; }
.hero-mark { width: 120px; height: 120px; display: block; margin: 0 auto 20px; }

/* Dark-scheme overrides, last so they win over the rules above. */
@media (prefers-color-scheme: dark) {
  .top .logo img.logo-light { display: none; }
  .top .logo img.logo-dark { display: block; }
  /* As in the app: the khatma card is filled, not brand-deep, on dark screens. */
  .khatma-card { background-color: var(--surface-sunken); }
}
