/* Hatim Çemberi web. Colours, spacing and radii come from tokens.css (generated from src/theme/tokens.ts).
   Mobile-first; "sky" pages use the night gradient in every theme (spec §6.2), "page" follows the system theme. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 1.0625rem; /* body 17 */
  line-height: 1.41;
  font-variant-ligatures: no-common-ligatures; /* Turkish dotted/dotless i safety (spec §6.3/1) */
  background: var(--c-bg);
  color: var(--c-text);
  overflow-wrap: anywhere;
}
img, svg { max-width: 100%; }
a { color: var(--c-primary); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--space-4); top: var(--space-2); z-index: 10; padding: var(--space-2) var(--space-4); background: var(--c-surface); color: var(--c-text); border-radius: var(--radius-chip); }

/* ───────── type scale (spec §6.3) ───────── */
.display { font-family: var(--font-display); font-weight: 600; font-size: 2rem; line-height: 1.19; margin: 0; letter-spacing: -0.01em; }
.title1 { font-family: var(--font-display); font-weight: 600; font-size: 1.625rem; line-height: 1.23; margin: 0 0 var(--space-4); }
.title2 { font-weight: 700; font-size: 1.25rem; line-height: 1.3; margin: 0 0 var(--space-3); }
.headline { font-weight: 600; font-size: 1.0625rem; line-height: 1.3; margin: 0; font-variant-numeric: tabular-nums; }
.subhead { font-weight: 500; font-size: 0.9375rem; margin: 0; }
.footnote { font-weight: 500; font-size: 0.8125rem; line-height: 1.38; margin: 0; }
.lead { font-size: 1.0625rem; margin: 0; }
.small { font-size: 0.875rem; }
.muted { color: var(--c-text-muted); }
.center { text-align: center; }

/* ───────── layout ───────── */
.topbar { max-width: 560px; margin: 0 auto; padding: var(--space-4) var(--space-4) 0; }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 48px; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.0625rem; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; }
main { max-width: 560px; margin: 0 auto; padding: var(--space-4) var(--space-4) var(--space-8); }
.footer { max-width: 560px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-10); font-size: 0.875rem; color: var(--c-text-muted); }
.footer ul { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-wrap: wrap; gap: 0 var(--space-4); }
.footer a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }
.footer p { margin: 0; }

/* ───────── night sky ───────── */
body.sky {
  --c-text: var(--sky-text);
  --c-text-muted: var(--sky-muted);
  --c-primary: var(--sky-taken);
  color: var(--sky-text);
  background-color: var(--sky-from);
  background-image: url('/assets/girih.svg'), linear-gradient(180deg, var(--sky-from) 0%, var(--sky-to) 100%);
  background-repeat: repeat, no-repeat;
  background-size: 288px 288px, 100% 100%;
}
html.tone-sky { background: var(--sky-to); }
body.sky .footer { color: var(--sky-muted); }
.invite { display: flex; flex-direction: column; gap: var(--space-6); }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding-top: var(--space-4); }
.hero .display { max-width: 22ch; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.invited { margin: 0; font-weight: 500; font-size: 1rem; color: var(--sky-muted); }
.meta { margin: 0; font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.012em; }
.ring-wrap { margin: var(--space-3) 0; width: min(240px, 60vw, 32vh); min-width: 168px; aspect-ratio: 1; }
.ring-wrap svg, .ring-wrap img { width: 100%; height: 100%; display: block; }
.ring-wrap.faded { opacity: 0.45; }
.state-text { margin: var(--space-2) 0 0; font-weight: 700; font-size: 1.25rem; line-height: 1.3; max-width: 26ch; }
.message { padding-top: var(--space-10); }
.message .title1 { margin: 0; }

.seg-suggested { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { fill-opacity: 0.2; } 50% { fill-opacity: 0.35; } }

/* ───────── buttons (≥48 px targets; primary 56 px) ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 56px; width: 100%; padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-button); border: 1.5px solid transparent;
  font: inherit; font-weight: 600; font-size: 1.0625rem; line-height: 1.25; text-align: center; text-decoration: none;
  cursor: pointer; transition: transform 150ms ease, background-color 150ms ease;
}
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: progress; }
.btn.primary { background: var(--c-primary); color: var(--c-on-primary); }
.btn.secondary { background: transparent; color: var(--c-text); border-color: var(--c-text-muted); }
.btn.ghost { background: transparent; color: var(--c-primary); min-height: 48px; }
.btn.small { min-height: 48px; width: auto; font-size: 1rem; padding: var(--space-2) var(--space-4); }
body.sky .btn.primary { background: var(--sky-taken); color: var(--sky-on-primary); }
body.sky .btn.secondary { color: var(--sky-text); border-color: var(--sky-muted); }
body.sky .btn.ghost { color: var(--sky-text); text-decoration: underline; text-underline-offset: 3px; }
.cta { display: flex; flex-direction: column; gap: var(--space-3); }
.store-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); width: 100%; }

/* ───────── sheets (claim, member, app box) ───────── */
.sheet, .app-box {
  background: var(--sky-surface); color: var(--sky-text);
  border: 1px solid var(--sky-border); border-radius: var(--radius-sheet);
  padding: var(--space-6) var(--space-5); display: flex; flex-direction: column; gap: var(--space-3);
}
.sheet[hidden], .sheet [hidden], .app-box [hidden], [hidden] { display: none !important; }
.app-box .muted, .sheet .muted { color: var(--sky-muted); }
.app-box .title2, .sheet .title2 { margin: 0; }
.fallback { margin: calc(var(--space-2) * -1) 0 0; text-align: center; font-size: 0.9375rem; }
.fallback a { display: inline-flex; align-items: center; min-height: 44px; color: var(--sky-muted); }
.emphasis { margin: 0; font-weight: 600; color: var(--sky-text); }
.code-box { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-4); border-radius: var(--radius-card); background: var(--sky-surface-alt); }
.code-label { font-size: 0.8125rem; font-weight: 600; color: var(--sky-muted); width: 100%; }
.code { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.625rem; letter-spacing: 0.12em; white-space: nowrap; flex: 1 1 auto; user-select: all; }

.field { font-weight: 600; font-size: 0.9375rem; }
.input {
  width: 100%; min-height: 52px; padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-button); border: 1.5px solid var(--sky-border);
  background: var(--sky-surface-alt); color: var(--sky-text); font: inherit; font-size: 1.0625rem;
}
.input:focus { outline: none; border-color: var(--sky-taken); box-shadow: 0 0 0 3px rgba(92, 195, 185, 0.35); }
.input[aria-invalid="true"] { border-color: var(--sky-coral); }
.field-hint, .preview, .terms, .age { margin: 0; font-size: 0.9375rem; color: var(--sky-muted); }
.preview strong { color: var(--sky-text); }
.consent { display: flex; gap: var(--space-3); align-items: flex-start; min-height: 48px; padding: var(--space-3); margin: 0 calc(var(--space-3) * -1); border-radius: var(--radius-card); cursor: pointer; line-height: 1.45; }
.consent input { flex: none; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--sky-taken); }
.consent.shake { animation: shake 360ms ease-in-out; background: rgba(240, 139, 115, 0.12); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-4px); } }
.row-link { display: flex; align-items: center; min-height: 44px; color: var(--sky-taken); font-weight: 600; }
.terms a { color: var(--sky-taken); }
.error { margin: 0; color: var(--sky-coral); font-weight: 600; min-height: 0; }
.error:empty { display: none; }
.notice { margin: 0; font-weight: 600; }
.notice:empty { display: none; }
.selected { margin: 0; font-weight: 600; text-align: center; }
.note { margin: 0; color: var(--sky-text); }

.juz-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-2); }
.juz {
  min-height: 52px; border-radius: var(--radius-chip); font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 1.0625rem;
  border: 1.5px solid var(--sky-empty); background: transparent; color: var(--sky-text); cursor: pointer;
}
.juz[data-status="taken"] { background: rgba(92, 195, 185, 0.2); border-color: var(--sky-taken); color: var(--sky-muted); cursor: not-allowed; }
.juz[data-status="read"] { background: var(--seg-read, var(--sky-read)); border-color: transparent; color: var(--sky-on-primary); cursor: not-allowed; }
.juz[aria-checked="true"] { background: var(--sky-taken); border-color: var(--sky-text); color: var(--sky-on-primary); box-shadow: 0 0 0 2px var(--sky-text); }
.mercy .juz[data-status="read"] { --seg-read: var(--sky-mercy); }

.my-juz { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.my-juz li { display: flex; flex-direction: column; gap: var(--space-2); }
.my-juz .juz-line { font-weight: 600; }

/* ───────── landing ───────── */
.features ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.features li { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--sky-border); border-radius: var(--radius-card); padding: var(--space-4); color: var(--sky-muted); }
.features strong { color: var(--sky-text); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.steps li { display: flex; gap: var(--space-4); align-items: flex-start; color: var(--sky-muted); }
.steps strong { color: var(--sky-text); }
.step-n { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--sky-taken); color: var(--sky-text); font-weight: 700; }

/* ───────── documents (theme pages) ───────── */
.doc { line-height: 1.6; }
.doc h2 { font-weight: 700; font-size: 1.25rem; line-height: 1.3; margin: var(--space-8) 0 var(--space-3); }
.doc p, .doc ul, .doc ol { margin: 0 0 var(--space-4); }
.doc ul, .doc ol { padding-left: 1.25rem; }
.doc li { margin-bottom: var(--space-2); }
.doc .lead { margin-bottom: var(--space-4); }
.doc .btn { width: auto; }
.doc details { border-bottom: 1px solid var(--c-border); }
.doc summary { min-height: 52px; display: flex; align-items: center; cursor: pointer; font-weight: 600; padding: var(--space-2) 0; }
.doc details p { color: var(--c-text-muted); }
.toc { background: var(--c-surface-alt); border-radius: var(--radius-card); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-6); }
.toc ol { margin: 0; padding-left: 0; list-style: none; columns: 1; }
.toc li { margin: 0; }
.toc a { display: inline-flex; min-height: 40px; align-items: center; }
mark.placeholder { background: var(--c-primary-soft); color: var(--c-on-primary-soft); border-radius: 4px; padding: 0 4px; }
.contact { font-weight: 600; }

@media (min-width: 600px) {
  .display { font-size: 2.25rem; }
  .toc ol { columns: 2; column-gap: var(--space-6); }
}

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