/* ==========================================================================
   Appica — secondary pages (privacy, terms, subscriptions, support)
   ========================================================================== */

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 210; background: var(--iri); transform-origin: left; transform: scaleX(var(--p, 0)); }

.page { position: relative; z-index: 1; }

/* ----- Page hero ---------------------------------------------------------- */

.doc-hero { position: relative; overflow-x: clip; padding: clamp(150px, 18vw, 230px) var(--pad) clamp(60px, 7vw, 100px); max-width: calc(var(--max) + var(--pad) * 2); margin: 0 auto; }
.doc-hero__title { margin: 22px 0 0; font-size: clamp(56px, 10vw, 168px); max-width: 12ch; }
.doc-hero__row { margin-top: clamp(40px, 5vw, 70px); display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; }
.doc-hero__lede { margin: 0; max-width: 52ch; font-size: clamp(18px, 1.5vw, 22px); color: var(--fg-dim); }
.doc-hero__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-dim); }
.doc-hero__glow {
  position: absolute; z-index: -1; right: -10vw; top: 6vw; width: 50vw; height: 50vw; border-radius: 50%;
  background: conic-gradient(from 90deg, #ff4f9a, #f0b93a, #ef8f74, #6fe3ff, #39d98a, #ff4f9a);
  filter: blur(110px); opacity: .22; animation: spin 24s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }
@media (max-width: 760px) { .doc-hero__row { grid-template-columns: 1fr; } .doc-hero__meta { align-items: flex-start; } }

.icons-row { display: flex; gap: 8px; }
.icons-row img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line); transition: transform .5s var(--ease); }
.icons-row img:hover { transform: translateY(-4px) rotate(-6deg); }
.icons-row img.pixel { image-rendering: pixelated; }

/* ----- At-a-glance cards -------------------------------------------------- */

.glance { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.glance__card {
  position: relative; overflow: hidden; padding: 26px 24px 28px; border-radius: var(--radius);
  background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
  min-height: 220px; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .6s var(--ease), box-shadow .4s;
}
.glance__card:hover { transform: translateY(-6px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.glance__card::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 80%; aspect-ratio: 1; border-radius: 50%; background: var(--c, #fff); filter: blur(60px); opacity: .18; transition: opacity .5s; }
.glance__card:hover::after { opacity: .32; }
.glance__card:nth-child(1) { --c: var(--c-reel); } .glance__card:nth-child(2) { --c: var(--c-legends); }
.glance__card:nth-child(3) { --c: var(--c-gambits); } .glance__card:nth-child(4) { --c: var(--c-dice); }
.glance__icon { width: 40px; height: 40px; color: var(--c); }
.glance__card h3 { margin: 30px 0 8px; font-size: 24px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.glance__card p { margin: 0; color: var(--fg-dim); font-size: 15px; }
@media (max-width: 960px) { .glance { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .glance { grid-template-columns: 1fr; } }

/* ----- Document body ------------------------------------------------------ */

.doc { max-width: var(--max); margin: 0 auto; padding: clamp(70px, 9vw, 130px) var(--pad) clamp(90px, 12vw, 160px); display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(40px, 7vw, 120px); }
.toc { position: sticky; top: 110px; align-self: start; }
.toc p { margin: 0 0 16px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc a { display: flex; gap: 12px; padding: 7px 0; font-size: 14.5px; color: var(--fg-dim); transition: color .3s, transform .4s var(--ease); }
.toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: 11px; padding-top: 3px; opacity: .6; }
.toc a:hover { color: var(--fg); }
.toc a.is-active { color: var(--fg); transform: translateX(6px); }
.toc a.is-active::before { opacity: 1; color: var(--c-legends); }
@media (max-width: 960px) { .doc { grid-template-columns: minmax(0, 1fr); } .toc { position: static; } .toc ol { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .toc ol { grid-template-columns: 1fr; } }

.prose { max-width: 780px; counter-reset: sec; }
.prose > section { padding-top: 24px; margin-bottom: clamp(56px, 6vw, 84px); scroll-margin-top: 90px; }
.prose h2 { counter-increment: sec; display: flex; align-items: baseline; gap: 18px; margin: 0 0 22px; font-size: clamp(30px, 3.2vw, 46px); font-weight: 600; letter-spacing: -.04em; line-height: 1.05; }
.prose h2::before { content: counter(sec, decimal-leading-zero); font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--fg-dim); transform: translateY(-.6em); }
.prose.no-count h2::before { display: none; }
.prose h3 { margin: 32px 0 10px; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.prose p, .prose li { color: var(--fg-dim); font-size: 17px; line-height: 1.7; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--fg-faint, var(--paper-faint)); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose a:not(.btn) { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; transition: text-decoration-color .3s; }
.prose a:not(.btn):hover { text-decoration-color: var(--fg); }

.callout { margin: 24px 0; padding: 22px 24px; border-radius: 18px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.callout p:last-child { margin-bottom: 0; }
.callout--iri { background: linear-gradient(var(--ink-2), var(--ink-2)) padding-box, var(--iri) border-box; border: 1px solid transparent; box-shadow: none; }
.callout__label { display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg); }

.table-wrap { overflow-x: auto; margin: 22px 0 26px; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.table th, .table td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table th { font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-dim); background: var(--ink-2); }
.table td { color: var(--fg-dim); }
.table td:first-child { color: var(--fg); font-weight: 500; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #fff); box-shadow: 0 0 12px var(--c, #fff); }
.dot--off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix th img { width: 28px; height: 28px; border-radius: 7px; margin: 0 auto 6px; }
.matrix th img.pixel { image-rendering: pixelated; }

.app-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--ink-3); color: var(--fg); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.app-chip img { width: 20px; height: 20px; border-radius: 6px; }

/* ----- Subscriptions ------------------------------------------------------ */

.plans { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.plan {
  --c: #fff;
  position: relative; overflow: hidden; border-radius: 26px; padding: 26px;
  background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column; gap: 18px;
  transition: transform .6s var(--ease);
}
.plan:hover { transform: translateY(-6px); }
.plan::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); }
.plan__head { display: flex; align-items: center; gap: 14px; }
.plan__head img { width: 52px; height: 52px; border-radius: 13px; }
.plan__head h3 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.plan__head span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.plan__prices { display: grid; gap: 8px; }
.price { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--ink-3); }
.price b { font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.price span { font-size: 14px; color: var(--fg-dim); }
.price em { display: block; font-family: var(--mono); font-style: normal; font-size: 11px; letter-spacing: .04em; color: var(--c); margin-top: 2px; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; color: var(--fg-dim); }
.plan li { display: flex; gap: 10px; }
.plan li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; background: var(--c); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.plans__note { max-width: var(--max); margin: 18px auto 0; padding: 0 var(--pad); font-size: 13px; color: var(--paper-faint); }

.timeline { list-style: none; margin: 30px 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; counter-reset: step; }
.timeline li { position: relative; padding: 22px 18px 20px; border-radius: 18px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 14.5px; line-height: 1.5; margin: 0; }
.timeline li b { display: block; color: var(--fg); font-size: 16px; margin: 26px 0 6px; letter-spacing: -.01em; }
.timeline li::before { counter-increment: step; content: counter(step); position: absolute; top: 16px; left: 18px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--ink); background: var(--iri); background-size: 400% 100%; }
.timeline li:nth-child(2)::before { background-position: 33% 0; } .timeline li:nth-child(3)::before { background-position: 66% 0; } .timeline li:nth-child(4)::before { background-position: 100% 0; }
@media (max-width: 760px) { .timeline { grid-template-columns: 1fr 1fr; } }

.steps-phone { display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: center; margin: 28px 0; }
.mini-phone { position: relative; width: 240px; aspect-ratio: 9 / 18; border-radius: 40px; padding: 9px; background: linear-gradient(145deg, #2b2b31, #0b0b0d 40%); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.16), 0 40px 80px -30px #000; }
.mini-phone__screen { height: 100%; border-radius: 32px; background: #1c1c1e; overflow: hidden; padding: 46px 12px 12px; font-size: 12px; color: #fff; position: relative; }
.mini-phone__screen::before { content: ""; position: absolute; top: 10px; left: 50%; width: 76px; height: 22px; margin-left: -38px; border-radius: 12px; background: #000; }
.mini-phone__title { font-size: 20px; font-weight: 700; margin: 0 4px 12px; letter-spacing: -.02em; transition: opacity .3s; }
.mini-phone__list { border-radius: 12px; background: #2c2c2e; overflow: hidden; }
.mini-phone__row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); transition: background .3s; }
.mini-phone__row:last-child { border-bottom: 0; }
.mini-phone__row i { width: 22px; height: 22px; border-radius: 6px; background: var(--c, #8e8e93); flex: none; }
.mini-phone__row span { flex: 1; }
.mini-phone__row::after { content: "›"; color: #8e8e93; font-size: 16px; }
.mini-phone__row.is-tap { background: rgba(255,255,255,.14); }
.mini-phone__row--danger { color: #ff453a; justify-content: center; }
.mini-phone__row--danger::after { display: none; }
.mini-phone__view { display: none; } .mini-phone__view.is-on { display: block; animation: slide-in .5s var(--ease); }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: s; }
.steps-list li { counter-increment: s; position: relative; display: block; padding: 12px 14px 12px 54px; border-radius: 14px; transition: background .4s, color .4s; margin: 0; cursor: pointer; }
.steps-list li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.steps-list li.is-on { background: var(--ink-2); color: var(--fg); }
.steps-list li.is-on::before { background: var(--paper); color: var(--ink); box-shadow: none; }
@media (max-width: 760px) { .steps-phone { grid-template-columns: 1fr; justify-items: center; } }

/* ----- Support ------------------------------------------------------------ */

.support-grid { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) clamp(90px, 12vw, 160px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 100px); align-items: start; }
@media (max-width: 960px) { .support-grid { grid-template-columns: 1fr; } }

.picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 auto; max-width: var(--max); padding: 0 var(--pad) 50px; }
.picker button {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border-radius: 999px;
  background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 500;
  transition: background .4s, box-shadow .4s, transform .5s var(--ease);
}
.picker button img { width: 32px; height: 32px; border-radius: 9px; }
.picker button:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.picker button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: none; }
.picker button.all { padding-left: 18px; }

.form { position: sticky; top: 100px; padding: clamp(24px, 3vw, 36px); border-radius: 28px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.form h2 { margin: 0 0 6px; font-size: 32px; font-weight: 600; letter-spacing: -.04em; }
.form > p { margin: 0 0 26px; color: var(--fg-dim); font-size: 15px; }
.field { position: relative; margin-bottom: 14px; }
.field label { display: block; margin-bottom: 7px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-dim); }
.field input, .field select, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 0; outline: 0;
  background: var(--ink-3); color: var(--fg); font-size: 16px;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .3s;
  appearance: none; -webkit-appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f1ede4' stroke-width='1.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 40px; }
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: inset 0 0 0 1.5px var(--paper); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 22px; font-size: 14px; color: var(--fg-dim); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--paper); }
.form .btn { width: 100%; justify-content: center; }
.form__note { margin: 14px 0 0; font-size: 13px; color: var(--paper-faint); text-align: center; }
.form__sent { display: none; text-align: center; padding: 30px 0; }
.form.is-sent .form__fields { display: none; }
.form.is-sent .form__sent { display: block; animation: slide-in .6s var(--ease); }
.form__sent b { display: block; font-size: 28px; letter-spacing: -.03em; margin-bottom: 8px; }

.faq-group { margin-bottom: 44px; scroll-margin-top: 100px; }
.faq-group[hidden] { display: none; }
.faq-group__head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.faq-group__head img { width: 44px; height: 44px; border-radius: 12px; }
.faq-group__head h3 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.faq { border-top: 1px solid var(--line); }
.faq:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 0; font-size: 17px; font-weight: 500; letter-spacing: -.01em; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary i { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong); transition: transform .5s var(--ease), background .3s; }
.faq summary i::before, .faq summary i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; margin: -.75px 0 0 -5px; background: currentColor; }
.faq summary i::after { transform: rotate(90deg); transition: transform .5s var(--ease); }
.faq[open] summary i { transform: rotate(180deg); background: var(--paper); color: var(--ink); }
.faq[open] summary i::after { transform: rotate(0deg); }
.faq__a { overflow: hidden; }
.faq__a p, .faq__a li { margin: 0 0 14px; color: var(--fg-dim); font-size: 16px; line-height: 1.65; max-width: 62ch; }
.faq__a ol, .faq__a ul { padding-left: 20px; margin: 0 0 14px; }
.faq__a a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }

.empty-state { display: none; color: var(--fg-dim); }

.contact-cards { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) 60px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.contact-card { padding: 24px; border-radius: 22px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 6px; transition: transform .6s var(--ease), box-shadow .4s; }
.contact-card:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.contact-card span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-dim); }
.contact-card b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.contact-card p { margin: 0; color: var(--fg-dim); font-size: 14.5px; }
@media (max-width: 860px) { .contact-cards { grid-template-columns: 1fr; } }
