:root {
  --paper: #f3f1ea;
  --ink: #17332b;
  --muted: #66736d;
  --line: rgba(23, 51, 43, .16);
  --accent: #22b879;
  --accent-dark: #08714d;
  --warm: #ecd9bd;
  --white: #fffef9;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 18px; letter-spacing: -.02em; }
.brand svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand b { font-weight: 740; }
.eyebrow { margin: 0 0 20px; color: var(--accent-dark); font-size: 12px; font-weight: 760; letter-spacing: .14em; text-transform: uppercase; }

.invite-hero { position: relative; min-height: 100svh; overflow: hidden; padding: 28px clamp(24px, 6vw, 88px) 44px; background: var(--paper); }
.invite-hero::before { content: ""; position: absolute; inset: 0 0 0 54%; background: var(--warm); }
.invite-nav { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; }
.secure-note { display: flex; align-items: center; gap: 8px; color: #456058; font-size: 13px; }
.secure-note i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(34,184,121,.14); }
.invite-copy { position: relative; z-index: 3; width: min(580px, 46vw); padding-top: clamp(92px, 16vh, 170px); }
.invite-copy h1 { margin: 0; max-width: 650px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(62px, 8vw, 126px); font-weight: 400; line-height: .87; letter-spacing: -.065em; }
.lead { max-width: 470px; margin: 34px 0 0; color: #4f625c; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.55; }
.store-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.store-button { min-width: 164px; padding: 15px 20px; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: white; text-align: center; text-decoration: none; font-size: 14px; font-weight: 700; transition: transform .18s ease, background .18s ease; }
[data-platform="ios"] .store-ios, [data-platform="android"] .store-android { background: var(--accent-dark); border-color: var(--accent-dark); }

.signal-visual { position: absolute; z-index: 2; top: 50%; left: 76%; width: min(42vw, 620px); aspect-ratio: 1; transform: translate(-50%, -48%); }
.signal-orbit { position: absolute; border: 1px solid rgba(23,51,43,.28); border-radius: 50%; animation: breathe 5s ease-in-out infinite; }
.orbit-one { inset: 12%; }.orbit-two { inset: 0; animation-delay: -.9s; }
.signal-core { position: absolute; inset: 31%; display: flex; align-items: center; justify-content: center; gap: 18px; border-radius: 50%; background: var(--ink); box-shadow: 0 28px 80px rgba(23,51,43,.22); }
.signal-core::after { content: ""; position: absolute; right: 16%; bottom: 13%; width: 22%; height: 22%; background: var(--ink); transform: rotate(45deg); }
.signal-core span { position: relative; z-index: 2; width: 11%; aspect-ratio: 1; border-radius: 50%; background: var(--paper); }
.signal-node { position: absolute; width: 18px; height: 18px; border: 5px solid var(--paper); border-radius: 50%; background: var(--accent-dark); box-shadow: 0 10px 24px rgba(23,51,43,.2); }
.node-one { top: 10%; left: 46%; }.node-two { right: 7%; bottom: 28%; }.node-three { bottom: 7%; left: 22%; }
.scroll-cue { position: absolute; z-index: 4; right: clamp(24px,6vw,88px); bottom: 34px; display: flex; gap: 20px; align-items: center; text-decoration: none; color: #334d46; font-size: 13px; }
.scroll-cue span { font-size: 22px; animation: nudge 1.8s ease-in-out infinite; }

.steps-section { padding: clamp(84px, 12vw, 160px) clamp(24px, 9vw, 140px); background: var(--paper); }
.section-heading { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8vw; align-items: start; }
.section-heading .eyebrow { grid-column: 1; color: #68d9a9; }
.section-heading h2 { grid-column: 1; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(45px, 6vw, 88px); font-weight: 400; line-height: .98; letter-spacing: -.045em; }
.section-heading > p:last-child { grid-column: 2; grid-row: 1 / span 2; max-width: 520px; margin: 33px 0 0; color: #b9c6c1; font-size: 19px; line-height: 1.55; }
.secret-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.copy-button, .small-copy { border: 1px solid rgba(255,255,255,.34); background: transparent; color: inherit; cursor: pointer; }
.copy-button { min-width: 142px; padding: 14px 18px; border-radius: 2px; transition: background .18s ease, color .18s ease, transform .18s ease; }
.copy-button.copied { background: var(--accent); border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }

.steps-section .section-heading { display: block; }
.steps-section .section-heading .eyebrow { color: var(--accent-dark); }
.steps-section .section-heading h2 { max-width: 820px; }
.steps-section .steps-intro { max-width: 610px; margin: 28px 0 0; color: var(--muted); font-size: 19px; line-height: 1.55; }
.steps-section .section-heading .expiry { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.steps-list { margin: 76px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.steps-list li { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 20px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.steps-list li > span { color: var(--accent-dark); font-family: Georgia, serif; font-size: 19px; }
.steps-list b { font-size: clamp(20px,2.4vw,30px); font-weight: 600; letter-spacing: -.02em; }
.steps-list p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.step-credential { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 28px; align-items: center; max-width: 860px; margin-top: 24px; padding: 20px; background: var(--ink); color: var(--paper); }
.step-credential > div { min-width: 0; }
.step-credential > div > span { display: block; margin-bottom: 8px; color: #99aaa4; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.step-credential strong { display: block; overflow-wrap: anywhere; font-size: clamp(18px,2.1vw,27px); font-weight: 560; letter-spacing: -.02em; }
.optional-step { display: grid; grid-template-columns: 88px minmax(0,620px); column-gap: 20px; margin-top: clamp(68px,9vw,112px); padding-top: 28px; border-top: 1px solid var(--line); }
.optional-step .eyebrow { grid-column: 1; margin: 4px 0 0; color: var(--accent-dark); line-height: 1.45; }
.optional-step h3 { grid-column: 2; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(32px,4vw,52px); font-weight: 400; letter-spacing: -.035em; }
.optional-step > p:last-child { grid-column: 2; max-width: 570px; margin: 16px 0 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.steps-outro { max-width: 860px; margin: clamp(68px,9vw,112px) 0 0 108px; padding-top: 28px; border-top: 1px solid var(--line); }
.steps-outro p { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(25px,3vw,40px); line-height: 1.2; letter-spacing: -.025em; }
.steps-outro p + p { margin-top: 24px; color: var(--accent-dark); font-family: inherit; font-size: 17px; line-height: 1.5; letter-spacing: 0; }

.state-page, .success-page { min-height: 100svh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(28px,7vw,96px); overflow: hidden; }
.state-page .brand, .success-page .brand { position: absolute; top: 30px; left: clamp(28px,7vw,96px); }
.state-page h1, .success-page h1 { position: relative; z-index: 2; margin: 28px 0 0; font-family: Georgia, serif; font-size: clamp(52px,9vw,120px); font-weight: 400; line-height: .91; letter-spacing: -.055em; }
.state-page > p, .success-page > p { position: relative; z-index: 2; max-width: 520px; color: var(--muted); font-size: 18px; line-height: 1.55; }
.state-page .signal-visual { left: 78%; }
.state-mark, .success-mark { color: var(--accent-dark); font-size: 14px; font-weight: 800; letter-spacing: .12em; }

.admin-shell { background: #f6f5f0; }
.admin-header { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px,5vw,72px); border-bottom: 1px solid var(--line); }
.admin-header > span { color: var(--muted); font-size: 13px; }
.admin-main { display: grid; grid-template-columns: minmax(360px,.85fr) minmax(520px,1.15fr); min-height: calc(100svh - 82px); }
.admin-form-section, .invite-list-section { padding: clamp(42px,6vw,86px); }
.admin-form-section { border-right: 1px solid var(--line); }
.admin-title h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(44px,5vw,72px); font-weight: 400; line-height: .96; letter-spacing: -.045em; }
.admin-title > p:last-child { max-width: 500px; margin-top: 20px; color: var(--muted); line-height: 1.5; }
.invite-form { display: grid; gap: 22px; margin-top: 54px; }
.invite-form label span { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.invite-form input, .invite-form select { width: 100%; height: 52px; padding: 0 14px; border: 1px solid rgba(23,51,43,.22); border-radius: 2px; outline: none; background: var(--white); color: var(--ink); transition: border .16s ease, box-shadow .16s ease; }
.invite-form input:focus, .invite-form select:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(34,184,121,.13); }
.invite-form small { display: block; margin-top: 7px; color: var(--muted); }
.primary-action { height: 56px; display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding: 0 18px; border: 0; border-radius: 2px; background: var(--ink); color: white; cursor: pointer; font-weight: 700; transition: background .18s ease; }
.primary-action i { font-size: 22px; font-style: normal; }
.form-error { padding: 13px 15px; border-left: 3px solid #a83c31; background: #f4e4df; color: #76271f; }
.list-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.list-heading h2 { margin: 0; font-size: 20px; }.list-heading > span { color: var(--muted); }
.invite-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.invite-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.invite-row strong, .invite-row > div > span { display: block; }.invite-row strong { margin-bottom: 6px; }.invite-row > div > span { overflow-wrap: anywhere; color: var(--muted); font-size: 13px; }
.invite-meta { display: flex; align-items: center; gap: 12px; }.invite-meta form { margin: 0; }
.status { font-size: 12px; }.status.active { color: var(--accent-dark); }.status.expired { color: #8b7467; }
.small-copy, .text-danger { padding: 7px 9px; border-radius: 2px; background: transparent; cursor: pointer; font-size: 12px; }
.small-copy { border-color: var(--line); color: var(--ink); }.small-copy.copied { background: var(--accent); }
.text-danger { border: 0; color: #9a3d32; }.empty-row { padding: 30px 0; color: var(--muted); }

.success-page { align-items: center; text-align: center; }
.success-page .eyebrow { margin: 28px 0 0; }.success-page h1 { margin-top: 6px; font-size: clamp(54px,7vw,92px); }
.success-mxid { margin: 8px 0 32px !important; color: var(--ink) !important; }
.share-link { width: min(760px,100%); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 10px; background: var(--ink); color: white; text-align: left; }
.share-link code { align-self: center; overflow: hidden; padding: 0 8px; text-overflow: ellipsis; white-space: nowrap; }
.share-link .copy-button { border-color: rgba(255,255,255,.3); }
.secondary-action { margin-top: 24px; color: var(--accent-dark); font-weight: 700; }

.entrance { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes breathe { 50% { transform: scale(1.035); opacity: .68; } }
@keyframes nudge { 50% { transform: translateY(5px); } }

@media (hover: hover) and (pointer: fine) {
  .store-button:hover { transform: translateY(-2px); background: #24483e; }
  .copy-button:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
  .primary-action:hover { background: var(--accent-dark); }
}

@media (max-width: 900px) {
  .invite-hero { min-height: 100svh; padding-bottom: 90px; }
  .invite-hero::before { inset: 54% 0 0; }
  .invite-copy { width: 100%; padding-top: 68px; }
  .invite-copy h1 { font-size: clamp(58px,16vw,92px); }
  .lead { margin-top: 24px; }
  .signal-visual { top: auto; bottom: -9vw; left: 50%; width: min(76vw,440px); transform: translate(-50%,0); opacity: .88; }
  .scroll-cue { display: none; }
  .section-heading { display: block; }.section-heading > p:last-child { margin-top: 28px; }
  .admin-main { display: block; }.admin-form-section { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .invite-nav .secure-note { display: none; }
  .invite-copy { padding-top: 56px; }.invite-copy .eyebrow { margin-bottom: 14px; }
  .invite-copy h1 { font-size: clamp(54px,17vw,78px); }
  .store-actions { display: grid; grid-template-columns: 1fr 1fr; }.store-button { min-width: 0; padding-inline: 10px; }
  .signal-visual { bottom: -1vw; }
  .steps-section { padding-block: 82px; }
  .steps-list li { grid-template-columns: 48px 1fr; }
  .step-credential { grid-template-columns: 1fr; gap: 18px; margin-left: -68px; padding: 18px; }
  .step-credential .copy-button { width: 100%; }
  .optional-step { grid-template-columns: 1fr; }
  .optional-step .eyebrow, .optional-step h3, .optional-step > p:last-child { grid-column: 1; }
  .optional-step h3 { margin-top: 14px; }
  .steps-outro { margin-left: 0; }
  .admin-header { height: 70px; }.admin-header > span { display: none; }
  .admin-main { min-height: calc(100svh - 70px); }.admin-form-section, .invite-list-section { padding: 42px 22px; }
  .invite-row { grid-template-columns: 1fr; gap: 14px; }.invite-meta { flex-wrap: wrap; }
  .share-link { grid-template-columns: 1fr; }.share-link code { padding: 10px 8px; }.success-page > p { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
