/* ==========================================================================
   Roxyon · مساعد — one-page design system
   Palette only: palm / deepest / limestone / sand / ink / muted ink / copper
   Type: IBM Plex Sans Arabic (ar) · IBM Plex Sans (lat) · IBM Plex Mono (labels)
   Rules: hairlines instead of cards, no shadows, logical properties throughout.
   ========================================================================== */

:root {
    --palm: #0E3B2E;
    --deepest: #08251C;
    --limestone: #F4EFE6;
    --sand: #E4DACA;
    --ink: #14140F;
    --muted: #4A4A40;
    --copper: #B6733F;

    --maxw: 1180px;
    --gut: clamp(20px, 5vw, 40px);
    --pad-sec: clamp(64px, 9vw, 128px);
    --gap: clamp(16px, 2vw, 24px);

    --f-ar: 'IBM Plex Sans Arabic', Tahoma, 'Segoe UI', system-ui, sans-serif;
    --f-lat: 'IBM Plex Sans', Tahoma, 'Segoe UI', system-ui, sans-serif;
    --f-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --rule: 1px solid var(--sand);
    --rule-palm: 1px solid rgba(244, 239, 230, .18);
    --rule-palm-strong: 1px solid rgba(244, 239, 230, .30);

    --ease: cubic-bezier(.2, .6, .35, 1);
    --t: 250ms;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */

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

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

html body {
    margin: 0;
    background: var(--limestone);
    color: var(--ink);
    font-size: clamp(15.5px, .55vw + 14px, 17px);
    line-height: 1.9;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
    overflow-wrap: break-word;
}

html[lang="ar-SA"] body,
html[lang="ar-SA"] button,
html[lang="ar-SA"] input,
html[lang="ar-SA"] .btn {
    font-family: var(--f-ar);
}

html[lang="en"] body,
html[lang="en"] button,
html[lang="en"] input,
html[lang="en"] .btn {
    font-family: var(--f-lat);
}

html[lang="en"] body {
    line-height: 1.7;
}

h1,
h2,
h3,
p,
figure {
    margin: 0;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    color: inherit;
    font-size: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

input {
    font-size: inherit;
    color: inherit;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--copper);
    color: var(--limestone);
}

/* language pairs ---------------------------------------------------------- */

html[lang="ar-SA"] .i-en {
    display: none !important;
}

html[lang="en"] .i-ar {
    display: none !important;
}

/* isolated Latin tokens inside Arabic (/ Roxyon, GMT+3, .ics, 8:00 PM) ---- */

.tok {
    unicode-bidi: isolate;
}

/* focus ------------------------------------------------------------------- */

:focus-visible {
    outline: 2px solid var(--copper);
    outline-offset: 3px;
}

.stage-band :focus-visible,
.stage-band input:focus-visible {
    outline-color: var(--limestone);
}

.result :focus-visible {
    outline-color: var(--copper);
}

/* --------------------------------------------------------------------------
   Type helpers
   -------------------------------------------------------------------------- */

.mono {
    font-family: var(--f-mono);
    font-size: .75rem;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: .08em;
}

.track {
    text-transform: uppercase;
}

.lbl {
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.5;
}

html[lang="en"] .lbl {
    font-family: var(--f-mono);
    font-weight: 400;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.idx {
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

html[lang="en"] .idx {
    font-family: var(--f-mono);
    letter-spacing: .08em;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--gut);
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
    position: sticky;
    inset-block-start: 0;
    z-index: 60;
    background: transparent;
    border-block-end: 1px solid transparent;
    transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}

.topbar.is-stuck {
    background: var(--limestone);
    border-block-end-color: var(--sand);
}

.topbar-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
}

.brand-mark {
    font-family: var(--f-lat);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1;
    color: var(--ink);
}

.brand-rule {
    width: 1px;
    height: 15px;
    background: var(--sand);
}

.brand-lock {
    font-family: var(--f-ar);
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1;
    color: var(--muted);
}

html[lang="en"] .brand-lock {
    font-family: var(--f-lat);
    letter-spacing: .02em;
}

.topbar-end {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.4vw, 26px);
}

.lang {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    font-size: .75rem;
    line-height: 1;
}

.lang-active-ar,
.lang-active-en {
    font-weight: 600;
    color: var(--ink);
    padding-inline: 2px;
}

.lang-btn {
    font-size: .75rem;
    color: var(--muted);
    padding-inline: 2px;
    min-height: 44px;
    transition: color var(--t) var(--ease);
}

.lang-btn:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--copper);
}

.lang-dot {
    color: var(--sand);
    font-size: .75rem;
}

.lang-active-en,
.lang-btn-ar {
    display: none;
}

html[lang="en"] .lang-active-en {
    display: inline;
}

html[lang="en"] .lang-btn-ar {
    display: inline;
}

html[lang="en"] .lang-active-ar,
html[lang="en"] .lang-btn-en {
    display: none;
}

.signin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--muted);
    transition: color var(--t) var(--ease);
}

.signin:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--copper);
}

.dir-ico {
    flex: none;
}

html[dir="ltr"] .dir-ico {
    transform: scaleX(-1);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
    background: var(--limestone);
    padding-block: clamp(20px, 4vw, 56px) var(--pad-sec);
}

.hero-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 4vw, 34px);
}

.hero-copy {
    order: 2;
    min-width: 0;
}

.hero-aside {
    display: contents;
}

.hero-fig {
    order: 1;
    margin: 0;
    display: flex;
    justify-content: flex-start;
}

.hero-fig img {
    width: auto;
    height: clamp(132px, 18vh, 190px);
    max-width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 50% 20%;
    border-radius: 0;
}

.hero-weave {
    order: 3;
}

.eyebrow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6em;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.2;
}

.eyebrow-dot {
    color: var(--sand);
}

html[lang="en"] .eyebrow-ar,
html[lang="en"] .eyebrow-dot {
    display: none;
}

.eyebrow .mono {
    color: var(--ink);
}

.hero-h1 {
    font-size: clamp(1.875rem, 6vw, 4.5rem);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0;
    color: var(--ink);
    text-wrap: balance;
    margin: 0 0 clamp(14px, 1.6vw, 22px);
}

html[lang="en"] .hero-h1 {
    line-height: 1.18;
    font-weight: 500;
    letter-spacing: -.015em;
}

.hero-ask {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--palm);
    margin: 0 0 clamp(12px, 1.4vw, 18px);
}

html[lang="en"] .hero-ask {
    line-height: 1.35;
}

.hero-lede {
    max-width: 46ch;
    font-size: 1.0625rem;
    line-height: 1.9;
    color: var(--muted);
    margin: 0 0 clamp(24px, 3vw, 34px);
}

html[lang="en"] .hero-lede {
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 16px;
}

.hero-note {
    max-width: 44ch;
    font-size: .8125rem;
    line-height: 1.8;
    color: var(--muted);
    margin: 0 0 clamp(18px, 2vw, 24px);
}

.hero-local {
    max-width: 52ch;
    padding-block-start: 14px;
    border-block-start: var(--rule);
    font-size: .75rem;
    line-height: 1.85;
    color: var(--muted);
    margin: 0;
}

/* buttons ----------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6em;
    min-height: 48px;
    padding: 10px 1.5rem;
    border: 1px solid transparent;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}

.btn-primary {
    background: var(--palm);
    border-color: var(--palm);
    color: var(--limestone);
}

.btn-primary:hover {
    background: var(--deepest);
    border-color: var(--deepest);
}

.btn-ghost {
    background: transparent;
    border-color: rgba(20, 20, 15, .26);
    color: var(--ink);
}

.btn-ghost:hover {
    border-color: var(--ink);
}

.btn-ghost[aria-disabled="true"] {
    color: var(--muted);
    border-color: var(--sand);
    cursor: not-allowed;
}

.btn-ghost[aria-disabled="true"]:hover {
    border-color: var(--sand);
}

.btn-light {
    background: var(--limestone);
    border-color: var(--limestone);
    color: var(--palm);
}

.btn-light:hover {
    background: var(--sand);
    border-color: var(--sand);
}

.btn-outline-lime {
    background: transparent;
    border-color: rgba(244, 239, 230, .42);
    color: var(--limestone);
}

.btn-outline-lime:hover {
    border-color: var(--limestone);
}

.btn-outline-lime:disabled {
    color: rgba(244, 239, 230, .40);
    border-color: rgba(244, 239, 230, .18);
    cursor: not-allowed;
}

/* weave strip ------------------------------------------------------------- */

.weave {
    display: block;
    width: 100%;
    height: 44px;
    margin-block: clamp(16px, 2vw, 22px) 12px;
}

.weave-cap {
    font-size: .6875rem;
    line-height: 1.7;
    color: var(--muted);
    max-width: 40ch;
}

/* --------------------------------------------------------------------------
   Conversation stage — the single dark moment
   -------------------------------------------------------------------------- */

.stage {
    padding-block: 0 var(--pad-sec);
    background: var(--limestone);
}

#conversation {
    scroll-margin-block-start: 72px;
}

.stage-band {
    max-width: var(--maxw);
    margin-inline: auto;
    background: var(--palm);
    color: var(--limestone);
    border-block: 1px solid var(--deepest);
}

.stage-in {
    padding: clamp(20px, 3vw, 34px) clamp(20px, 3.6vw, 44px) clamp(24px, 3.4vw, 40px);
}

.stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding-block-end: clamp(16px, 2vw, 22px);
}

.stage-id {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.stage-id .idx {
    color: var(--copper);
}

.stage-title {
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--limestone);
    letter-spacing: 0;
}

html[lang="en"] .stage-title {
    font-family: var(--f-mono);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 400;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border: 1px solid rgba(244, 239, 230, .30);
    font-size: .6875rem;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(244, 239, 230, .82);
    letter-spacing: 0;
}

html[lang="en"] .badge {
    font-family: var(--f-mono);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 400;
}

.state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(244, 239, 230, .78);
}

html[lang="en"] .state {
    font-family: var(--f-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 400;
}

.state-dot {
    width: 6px;
    height: 6px;
    flex: none;
    background: transparent;
    border: 1px solid rgba(244, 239, 230, .45);
    transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease);
}

.state[data-state="writing"] .state-dot,
.state[data-state="result"] .state-dot {
    background: var(--copper);
    border-color: var(--copper);
}

.state-word {
    display: none;
}

[data-state="ready"] .state-word[data-word="ready"],
[data-state="writing"] .state-word[data-word="writing"],
[data-state="result"] .state-word[data-word="result"] {
    display: inline;
}

/* tabs -------------------------------------------------------------------- */

.tabs {
    display: flex;
    align-items: stretch;
    gap: clamp(14px, 3vw, 32px);
    border-block-start: var(--rule-palm);
    border-block-end: var(--rule-palm);
}

.tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 8px 0;
    font-size: .9375rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    color: rgba(244, 239, 230, .60);
    transition: color var(--t) var(--ease);
}

.tab:hover {
    color: rgba(244, 239, 230, .88);
}

.tab .idx {
    color: rgba(244, 239, 230, .40);
    transition: color var(--t) var(--ease);
}

.tab[aria-selected="true"] {
    color: var(--limestone);
}

.tab[aria-selected="true"] .idx {
    color: var(--copper);
}

.tab[aria-selected="true"]::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: -1px;
    height: 1px;
    background: var(--copper);
}

/* body grid --------------------------------------------------------------- */

.stage-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(20px, 2.6vw, 28px);
    padding-block: clamp(20px, 3vw, 32px) clamp(4px, .6vw, 8px);
}

.stage-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.stage-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.stage-body:not(.has-result) .stage-main {
    display: none;
}

.presence {
    display: flex;
    align-items: center;
    gap: 14px;
}

.presence-img {
    width: 88px;
    height: 88px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 22%;
}

.presence-txt {
    min-width: 0;
}

.presence-name {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--limestone);
}

.presence-state {
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.6;
    color: rgba(244, 239, 230, .62);
    margin-block-start: 2px;
}

html[lang="en"] .presence-state {
    font-family: var(--f-mono);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 400;
}

/* transcript -------------------------------------------------------------- */

.transcript {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    border: var(--rule-palm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(244, 239, 230, .32) transparent;
    overscroll-behavior-y: contain;
}

.transcript::-webkit-scrollbar {
    width: 6px;
}

.transcript::-webkit-scrollbar-thumb {
    background: rgba(244, 239, 230, .28);
}

.transcript:focus-visible {
    outline: 2px solid var(--limestone);
    outline-offset: 3px;
}

.turns {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tr-start {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-height: 132px;
    justify-content: center;
}

.tr-start-txt {
    font-size: .875rem;
    line-height: 1.8;
    color: rgba(244, 239, 230, .66);
    max-width: 30ch;
}

.linkbtn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--limestone);
    border-block-end: 1px solid rgba(244, 239, 230, .42);
    padding: 0 1px;
    transition: border-color var(--t) var(--ease), color var(--t) var(--ease);
}

.linkbtn:hover {
    border-block-end-color: var(--copper);
    color: #fff;
}

.turn {
    max-width: 86%;
    padding: 11px 14px;
    border: 1px solid transparent;
}

.turn-you {
    align-self: flex-start;
    background: rgba(182, 115, 63, .16);
    border-color: rgba(182, 115, 63, .42);
    color: var(--limestone);
}

.turn-musaed {
    align-self: flex-end;
    background: rgba(244, 239, 230, .055);
    border-color: rgba(244, 239, 230, .16);
    color: var(--limestone);
}

.turn:focus {
    outline: 2px solid var(--limestone);
    outline-offset: 3px;
}

.turn-body {
    font-size: .9375rem;
    line-height: 1.85;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

html[lang="en"] .turn-body {
    line-height: 1.65;
}

/* chips ------------------------------------------------------------------- */

.chips-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chips-lbl {
    color: rgba(244, 239, 230, .58);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    max-width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(244, 239, 230, .28);
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.55;
    text-align: start;
    color: var(--limestone);
    transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}

.chip:hover {
    background: rgba(244, 239, 230, .08);
    border-color: var(--limestone);
}

.chip:disabled {
    color: rgba(244, 239, 230, .40);
    border-color: rgba(244, 239, 230, .16);
    cursor: default;
}

.restart {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: .8125rem;
    font-weight: 500;
    color: rgba(244, 239, 230, .68);
    border-block-end: 1px solid transparent;
    transition: color var(--t) var(--ease), border-color var(--t) var(--ease);
}

.restart:hover {
    color: var(--limestone);
    border-block-end-color: rgba(244, 239, 230, .40);
}

/* result card ------------------------------------------------------------- */

.result {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vw, 22px);
    padding: clamp(20px, 2.6vw, 30px);
    background: var(--limestone);
    color: var(--ink);
}

.result-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding-block-end: 12px;
    border-block-end: var(--rule);
}

.result-lbl {
    color: var(--muted);
    margin: 0;
}

.tone {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tone-btn {
    min-height: 32px;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--muted);
    transition: color var(--t) var(--ease);
}

.tone-btn[aria-pressed="true"] {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--copper);
}

.tone-btn:hover {
    color: var(--ink);
}

.tone-slash {
    color: var(--sand);
    font-size: .8125rem;
}

.invite {
    font-size: clamp(1.0625rem, 1.15vw, 1.25rem);
    font-weight: 400;
    line-height: 1.9;
    color: var(--ink);
    letter-spacing: 0;
    text-wrap: pretty;
    margin: 0;
}

html[lang="en"] .invite {
    line-height: 1.7;
}

.result .inv {
    display: none;
}

.result[data-tone="light"] .inv-light,
.result[data-tone="formal"] .inv-formal {
    display: inline;
}

.result-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-block-start: 14px;
    border-block-start: var(--rule);
}

.result-meta {
    color: var(--muted);
    margin: 0;
}

.foot-note {
    color: var(--muted);
}

/* study plan -------------------------------------------------------------- */

.plan {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.plan-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 6px 14px;
    padding-block: 12px;
    border-block-start: var(--rule);
}

.plan-row:first-child {
    border-block-start: 0;
    padding-block-start: 0;
}

.plan-day {
    font-family: var(--f-mono);
    font-size: .6875rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

html[lang="ar-SA"] .plan-day {
    font-family: var(--f-ar);
    font-size: .8125rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--palm);
}

.plan-ch {
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--ink);
    min-width: 0;
    overflow-wrap: break-word;
}

html[lang="en"] .plan-ch {
    font-weight: 500;
}

.plan-min {
    font-size: .8125rem;
    line-height: 1.6;
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

html[lang="en"] .plan-min {
    font-family: var(--f-mono);
    font-size: .75rem;
    letter-spacing: .02em;
}

.plan .on-light {
    display: none;
}

.plan[data-light="1"] .off-light {
    display: none;
}

.plan[data-light="1"] .on-light {
    display: inline;
}

/* the follow-up chip sits under the plan card, on the dark band */
.followup {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* gift ideas -------------------------------------------------------------- */

.ideas {
    display: flex;
    flex-direction: column;
}

.idea {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-block: 14px;
    border-block-start: var(--rule);
    cursor: pointer;
}

.idea:first-child {
    border-block-start: 0;
    padding-block-start: 0;
}

.idea input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.idea-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: none;
    border: 1px solid rgba(20, 20, 15, .26);
    font-size: .75rem;
    line-height: 1;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}

.idea:hover .idea-mark {
    border-color: var(--palm);
    color: var(--ink);
}

.idea input:checked ~ .idea-mark {
    background: var(--palm);
    border-color: var(--palm);
    color: var(--limestone);
}

.idea input:focus-visible ~ .idea-mark {
    outline: 2px solid var(--copper);
    outline-offset: 3px;
}

.idea-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.idea-title {
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--ink);
    overflow-wrap: break-word;
}

.idea-desc {
    font-size: .875rem;
    line-height: 1.7;
    color: var(--muted);
    overflow-wrap: break-word;
}

.caption {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-block-start: 16px;
    border-block-start: var(--rule);
}

.caption-lbl {
    color: var(--copper);
    margin: 0;
}

.caption-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.9;
    color: var(--ink);
    text-wrap: pretty;
    overflow-wrap: break-word;
}

html[lang="en"] .caption-text {
    line-height: 1.7;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid rgba(20, 20, 15, .30);
    font-size: .875rem;
    font-weight: 500;
    color: var(--ink);
    transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}

.btn-copy:hover {
    background: rgba(14, 59, 46, .06);
    border-color: var(--palm);
}

.btn-copy.is-copied {
    border-color: var(--copper);
    color: var(--copper);
}

.copy-off {
    display: none;
}

.btn-copy.is-copied .copy-on {
    display: none;
}

.btn-copy.is-copied .copy-off {
    display: inline;
}

/* calendar block ---------------------------------------------------------- */

.cal {
    border: var(--rule-palm);
    padding: clamp(18px, 2.4vw, 26px);
}

.cal-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-block-end: 16px;
    border-block-end: var(--rule-palm);
}

.cal-title {
    font-size: 1.0625rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--limestone);
}

html[lang="en"] .cal-title {
    line-height: 1.35;
}

.cal-hint {
    color: rgba(244, 239, 230, .60);
    margin: 0;
}

.cal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px 20px;
    padding-block: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.field-lbl {
    color: rgba(244, 239, 230, .60);
}

.field input {
    width: 100%;
    min-height: 44px;
    padding: 8px 0;
    background: transparent;
    border: 0;
    border-block-end: 1px solid rgba(244, 239, 230, .30);
    border-radius: 0;
    color: var(--limestone);
    font-size: .9375rem;
    line-height: 1.5;
    transition: border-color var(--t) var(--ease);
}

.field input[type="date"] {
    font-family: var(--f-mono);
    font-size: .875rem;
    color-scheme: dark;
}

.field input[type="text"] {
    font-family: var(--f-ar);
}

.field input:hover {
    border-block-end-color: rgba(244, 239, 230, .55);
}

.field input:focus {
    border-block-end-color: var(--copper);
}

.field-val {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 0;
    border-block-end: 1px solid rgba(244, 239, 230, .22);
    font-size: .9375rem;
    line-height: 1.5;
    color: rgba(244, 239, 230, .86);
}

.cal-act {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-block-start: 16px;
    border-block-start: var(--rule-palm);
}

.cal-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: .9375rem;
    font-weight: 500;
    line-height: 1.7;
    color: var(--limestone);
}

.cal-summary::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: none;
    background: var(--copper);
}

/* --------------------------------------------------------------------------
   What Musaed does — light band
   -------------------------------------------------------------------------- */

.how {
    background: var(--limestone);
    border-block-start: 1px solid var(--sand);
    padding-block: var(--pad-sec);
}

.how-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.how-title {
    margin: 0;
    font-size: clamp(1.625rem, 4.6vw, 3rem);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--palm);
    max-width: 20ch;
    text-wrap: balance;
}

html[lang="en"] .how-title {
    line-height: 1.15;
    max-width: 22ch;
}

.how-lede {
    margin: 0;
    font-size: clamp(.9375rem, 1.1vw, 1.0625rem);
    line-height: 1.9;
    color: var(--muted);
    max-width: 52ch;
    text-wrap: pretty;
}

html[lang="en"] .how-lede {
    line-height: 1.7;
}

.how-list {
    list-style: none;
    margin: clamp(40px, 6vw, 64px) 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.how-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-block: 22px;
    border-block-start: 1px solid var(--sand);
}

.how-item .idx {
    color: var(--copper);
}

.how-item-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--ink);
}

.how-item-txt {
    margin: 0;
    font-size: .9375rem;
    line-height: 1.85;
    color: var(--muted);
    max-width: 34ch;
}

html[lang="en"] .how-item-txt {
    line-height: 1.65;
}

.how-note {
    margin: clamp(32px, 4vw, 48px) 0 0;
    padding-block-start: 16px;
    border-block-start: 1px solid var(--sand);
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Closing
   -------------------------------------------------------------------------- */

.close {
    background: var(--palm);
    color: var(--limestone);
    padding-block: clamp(72px, 10vw, 128px);
}

.close-in {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.close-title {
    margin: 0;
    font-size: clamp(1.875rem, 5.4vw, 3.5rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
    color: var(--limestone);
    text-wrap: balance;
}

html[lang="en"] .close-title {
    line-height: 1.1;
}

.close-sub {
    margin: 0;
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(244, 239, 230, .72);
    max-width: 40ch;
}

.close .btn {
    margin-block-start: 12px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.foot {
    background: var(--limestone);
    border-block-start: 1px solid var(--sand);
    padding-block: clamp(28px, 4vw, 44px) clamp(24px, 3.4vw, 34px);
}

.foot-row1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding-block-end: 18px;
    border-block-end: 1px solid var(--sand);
}

.foot-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.foot-lock {
    font-size: .9375rem;
    font-weight: 500;
    color: var(--ink);
}

.foot-line {
    margin: 0;
    font-size: .8125rem;
    line-height: 1.6;
    color: var(--muted);
}

.foot-signin {
    min-height: 44px;
    color: var(--ink);
}

.foot-row2 {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-block-start: 16px;
}

.foot-row2 p {
    margin: 0;
    font-size: .75rem;
    line-height: 1.7;
    color: var(--muted);
    max-width: 64ch;
}

html[lang="en"] .foot-row2 p {
    font-size: .8125rem;
}

/* --------------------------------------------------------------------------
   Reveal on scroll — section heads only, once
   -------------------------------------------------------------------------- */

.has-reveal .rv {
    opacity: 0;
    transform: translateY(10px);
}

.has-reveal .rv.rv-in {
    opacity: 1;
    transform: none;
    transition: opacity 320ms var(--ease), transform 320ms var(--ease);
}

/* --------------------------------------------------------------------------
   Breakpoints
   -------------------------------------------------------------------------- */

@media (max-width: 559px) {
    .plan-row {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 2px 12px;
    }

    .plan-day {
        grid-column: 1;
        grid-row: 1;
    }

    .plan-min {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .plan-ch {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (min-width: 560px) {
    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .cal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .topbar-in {
        min-height: 66px;
    }

    .hero {
        padding-block: clamp(34px, 4.4vw, 68px) var(--pad-sec);
    }

    .hero-grid {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 0;
        column-gap: var(--gap);
        align-items: start;
    }

    .hero-copy {
        grid-column: 1 / span 7;
        order: 0;
    }

    .hero-aside {
        display: block;
        grid-column: 8 / span 5;
        padding-block-start: 34px;
    }

    .hero-fig {
        order: 0;
        justify-content: flex-end;
    }

    .hero-weave {
        order: 0;
    }

    .hero-fig img {
        width: 100%;
        max-width: 420px;
        height: auto;
        aspect-ratio: 4 / 5;
    }

    .hero-h1 {
        font-size: clamp(2.5rem, 5.2vw, 4.5rem);
    }

    /* stage */
    .stage-body {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        column-gap: var(--gap);
    }

    .stage-side {
        grid-column: 1 / span 5;
    }

    .stage-main {
        grid-column: 6 / span 7;
    }

    /* what Musaed does */
    .how-grid {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        column-gap: var(--gap);
        align-items: start;
    }

    .how-title {
        grid-column: 1 / span 7;
    }

    .how-lede {
        grid-column: 9 / span 4;
    }

    .how-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: var(--gap);
    }

    .how-item {
        padding-block: 20px 4px;
    }

    .foot-row2 {
        flex-direction: row;
        justify-content: space-between;
        gap: 24px;
    }
}

@media (max-width: 430px) {
    .tab .idx {
        display: none;
    }

    .tabs {
        gap: 14px;
    }

    .tab {
        font-size: .875rem;
    }

    .turn {
        max-width: 94%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .has-reveal .rv {
        opacity: 1 !important;
        transform: none !important;
    }
}

@media print {
    .topbar,
    .hero-actions,
    .chips-wrap,
    .restart {
        display: none;
    }
}
