/* ─────────────────────────────────────────────────────────────────────
   WallsPy — site skeleton
   ─────────────────────────────────────────────────────────────────────

   Design tokens + shared chrome (header, footer, buttons, surfaces).
   Imported by every page on the site so we have a single source of
   truth for colours, type and spacing.

   Palette is pulled directly from the WallsPy logo (three fanned
   wallpaper cards + AI sparkle):
     • cyan  (#22c8e3)   — primary accent / interactive
     • yellow(#fbd028)   — secondary highlight / badges / warnings
     • pink  (#ee4d9f)   — destructive actions only
   On a deep neutral background. The three brand hues all appear in
   the logo mark itself.

   (TitanKoders remains the parent company — it appears only as the
   legal-entity line in the footer; the parent brand will get its own
   domain later.)
*/

:root {
    /* surfaces */
    --bg:           #08080d;
    --bg-grad-a:    #08080d;
    --bg-grad-b:    #11111b;
    --surface:      #16161f;
    --surface-2:    #1c1c27;
    --surface-3:    #25252f;
    --border:       rgba(255, 255, 255, 0.06);
    --border-strong:rgba(255, 255, 255, 0.12);

    /* ambient aurora tints (overridden in light theme) */
    --aura-1: rgba(34, 200, 227, 0.14);
    --aura-2: rgba(251, 208, 40, 0.08);
    --aura-3: rgba(238, 77, 159, 0.10);

    /* text */
    --text:         #f5f5f7;
    --text-mute:    #a1a1aa;
    --text-dim:     #71717a;

    /* brand triad (raw logo colours — reuse for accents, gradients, art) */
    --brand-cyan:   #22c8e3;
    --brand-cyan-2: #5fd9ec;
    --brand-yellow: #fbd028;
    --brand-yellow-2:#fcdf67;
    --brand-pink:   #ee4d9f;
    --brand-pink-2: #f278b6;

    /* accent (interactive) — primary cyan */
    --accent:       var(--brand-cyan);
    --accent-2:     var(--brand-cyan-2);
    --accent-glow:  rgba(34, 200, 227, 0.38);
    --accent-soft:  rgba(34, 200, 227, 0.12);

    /* danger (destructive only — delete account) — brand pink */
    --danger:       var(--brand-pink);
    --danger-2:     var(--brand-pink-2);
    --danger-soft:  rgba(238, 77, 159, 0.12);
    --danger-glow:  rgba(238, 77, 159, 0.32);

    /* feedback */
    --success:      #4ade80;
    --warning:      var(--brand-yellow);

    /* shape */
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  20px;
    --radius-xl:  28px;

    /* type */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo,
                 Consolas, monospace;

    /* motion */
    --ease:        cubic-bezier(0.22, 1, 0.36, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 180ms;
    --t-med:  320ms;
    --t-slow: 560ms;
}

/* ─── light theme overrides (set via data-theme by theme.js) ───────── */
:root[data-theme="light"] {
    --bg:           #eef0f6;
    --bg-grad-a:    #f5f6fb;
    --bg-grad-b:    #e7e9f2;
    --surface:      #ffffff;
    --surface-2:    #f3f4f9;
    --surface-3:    #e8eaf1;
    --border:       rgba(15, 20, 35, 0.08);
    --border-strong:rgba(15, 20, 35, 0.16);
    --text:         #14161f;
    --text-mute:    #4a4f5e;
    --text-dim:     #767c8b;
    --aura-1: rgba(34, 200, 227, 0.20);
    --aura-2: rgba(251, 208, 40, 0.16);
    --aura-3: rgba(238, 77, 159, 0.18);
}
:root[data-theme="light"] .site-header { background: rgba(255, 255, 255, 0.72); }

/* ─── reset ───────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
/*
   The default user-agent rule for [hidden] is `display: none`, but it has
   the lowest specificity and is overridden by *any* `display: ...` in our
   own CSS (e.g. `.alert { display: flex }`). One global !important here
   keeps `<div hidden>` actually hidden everywhere.
*/
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.55;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
input, textarea, button { font-family: inherit; }

/* ─── inline icon system ──────────────────────────────────────────────
   Consistent line-icon set used across the site. Reference a symbol from
   the per-page <svg class="icon-sprite"> with:
       <svg class="ic"><use href="#ic-name"></use></svg>
   Icons inherit text colour via currentColor. */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.14em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ─── accessibility ───────────────────────────────────────────────── */
.skip-link {
    position: fixed;
    left: 14px; top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--accent);
    color: #06121a;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 14px; outline: none; }
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ─── ambient backdrop (subtle aurora behind everything) ──────────── */

body::before {
    /* Three soft radial washes — one per brand colour — for an ambient
       "logo-in-the-room" feel. Kept low opacity so the page chrome stays
       legible. */
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    inset: -10%;                       /* oversized so the slow drift never reveals edges */
    background:
        radial-gradient(700px 500px at 10% 2%,  var(--aura-1), transparent 60%),
        radial-gradient(600px 500px at 92% 16%, var(--aura-2), transparent 60%),
        radial-gradient(800px 700px at 60% 98%, var(--aura-3), transparent 65%),
        linear-gradient(180deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 100%);
    animation: auroraDrift 42s ease-in-out infinite;
}
body::after {
    /* very faint grain for depth on OLEDs */
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ─── ambient background variants (set via data-bg by theme.js) ─────
   Slow, GPU-cheap drift (a single transform, 42s). "minimal" freezes it,
   "off" drops the colour washes entirely. Reduced-motion kills the loop. */
@keyframes auroraDrift {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(0, -2.5%, 0); }
}
:root[data-bg="off"] body::before {
    background: linear-gradient(180deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 100%);
    animation: none;
}
:root[data-bg="minimal"] body::before { animation: none; opacity: 0.55; }
:root[data-bg="off"] body::after { opacity: 0; }
:root[data-bg="orbs"] body::before,
:root[data-bg="particles"] body::before { animation: none; }

/* Moving background layers built by theme.js for "orbs" / "particles".
   Transform + opacity only, so the compositor does the work (cheap). */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-fx .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(46px);
    opacity: 0.45;
    animation: orbDrift 38s ease-in-out infinite;
}
@keyframes orbDrift {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(var(--dx, 3%), var(--dy, -4%), 0); }
}
.bg-fx .pcl {
    position: absolute;
    bottom: -14px;
    border-radius: 50%;
    background: var(--accent);
    animation: pclRise linear infinite;
}
@keyframes pclRise {
    0%   { transform: translateY(0); opacity: 0; }
    12%  { opacity: 0.55; }
    88%  { opacity: 0.4; }
    100% { transform: translateY(-108vh); opacity: 0; }
}

/* ─── header / nav ────────────────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    background: rgba(10, 10, 15, 0.65);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.brand__logo {
    /* The WallsPy logo mark (three fanned wallpaper cards + AI sparkle).
       Served as an external SVG so its gradient IDs stay isolated. */
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: block;
    filter:
        drop-shadow(0 6px 14px rgba(34, 200, 227, 0.25))
        drop-shadow(0 6px 14px rgba(238, 77, 159, 0.18));
    transition: transform var(--t-med) var(--ease-bounce);
}
.brand:hover .brand__logo { transform: translateY(-1px) rotate(-2deg); }
.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-mute);
    font-size: 0.92rem;
    transition: color var(--t-fast) var(--ease),
                background var(--t-fast) var(--ease);
}
.nav a:hover { color: var(--text); background: var(--surface-2); }

/* ─── footer ──────────────────────────────────────────────────────── */

.site-footer {
    margin-top: 80px;
    padding: 40px 24px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.88rem;
}
.site-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
}
.site-footer a {
    color: var(--text-mute);
    transition: color var(--t-fast) var(--ease);
}
.site-footer a:hover { color: var(--text); }
.site-footer__links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

/* ─── shared building blocks ──────────────────────────────────────── */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.card {
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 24px 80px rgba(0, 0, 0, 0.35);
}

/* primary button (accent blue) */
.btn {
    --b-bg: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
    --b-shadow: 0 12px 32px var(--accent-glow);
    --b-color: white;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: 999px;
    color: var(--b-color);
    background: var(--b-bg);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease),
                box-shadow var(--t-fast) var(--ease),
                filter var(--t-fast) var(--ease);
    box-shadow: var(--b-shadow);
}
.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}
.btn:active { transform: translateY(0); filter: brightness(0.96); }
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* secondary / ghost button */
.btn--ghost {
    --b-bg: transparent;
    --b-shadow: none;
    --b-color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-3); filter: none; }

/* destructive button */
.btn--danger {
    --b-bg: linear-gradient(180deg, var(--danger) 0%, var(--danger-2) 100%);
    --b-shadow: 0 12px 32px var(--danger-glow);
}

/* loading spinner that lives inside a button */
.btn__spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    animation: spin 700ms linear infinite;
    display: none;
}
.btn.is-loading .btn__spinner { display: inline-block; }
.btn.is-loading .btn__label   { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* form fields */
.field { display: block; margin-bottom: 18px; }
.field__label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-mute);
    letter-spacing: 0.02em;
}
.field__input,
.field__textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface-3);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color var(--t-fast) var(--ease),
                background var(--t-fast) var(--ease),
                box-shadow var(--t-fast) var(--ease);
}
.field__input:focus,
.field__textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-2);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.field__textarea { resize: vertical; min-height: 100px; }
.field__hint { margin-top: 8px; font-size: 0.82rem; color: var(--text-dim); }

/* status badges / inline alerts */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    margin-bottom: 18px;
    border: 1px solid var(--border-strong);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.alert--danger  { background: var(--danger-soft); border-color: rgba(238, 77, 159, 0.4); color: #fbb8d8; }
.alert--warning { background: rgba(251, 208, 40, 0.08); border-color: rgba(251, 208, 40, 0.35); color: #fde68a; }
.alert--info    { background: var(--accent-soft); border-color: rgba(34, 200, 227, 0.4); color: #b8ecf6; }
.alert--success { background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.4); color: #bbf7d0; }

/* generic page entrance — fade up on load */
.page-enter > * { animation: pageEnter 540ms var(--ease) both; }
.page-enter > *:nth-child(1) { animation-delay: 0ms; }
.page-enter > *:nth-child(2) { animation-delay: 60ms; }
.page-enter > *:nth-child(3) { animation-delay: 120ms; }
.page-enter > *:nth-child(4) { animation-delay: 180ms; }
.page-enter > *:nth-child(5) { animation-delay: 240ms; }
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── appearance settings (FAB + panel, injected by theme.js) ──────── */
.theme-fab {
    position: fixed; right: 18px; bottom: 18px; z-index: 80;
    width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border-strong);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.theme-fab:hover { transform: translateY(-2px); background: var(--surface-3); }
.theme-fab svg { width: 22px; height: 22px; }
.theme-panel {
    position: fixed; right: 18px; bottom: 74px; z-index: 80;
    width: 280px; max-width: calc(100vw - 36px);
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    padding: 16px;
    opacity: 0; visibility: hidden; transform: translateY(8px) scale(0.98);
    transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility var(--t-fast);
}
.theme-panel.is-open { opacity: 1; visibility: visible; transform: none; }
.theme-row + .theme-row { margin-top: 16px; }
.theme-row h4 {
    margin: 0 0 9px; font-size: 0.74rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim);
}
.seg {
    display: flex; gap: 4px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 999px; padding: 4px;
}
.seg button {
    flex: 1; border: none; background: transparent; color: var(--text-mute);
    padding: 7px 6px; border-radius: 999px;
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.seg button.is-active { background: var(--accent); color: #06121a; }
.optset { display: flex; flex-wrap: wrap; gap: 6px; }
.optset button {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-mute);
    padding: 6px 12px; border-radius: 999px;
    font-size: 0.8rem; font-weight: 600; cursor: pointer;
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.optset button:hover { color: var(--text); }
.optset button.is-active { background: var(--accent); color: #06121a; border-color: transparent; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
    width: 28px; height: 28px; border-radius: 50%;
    border: none; cursor: pointer; padding: 0;
    outline: 2px solid transparent; outline-offset: 2px;
    transition: outline-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.swatch:hover { transform: scale(1.1); }
.swatch.is-active { outline-color: var(--text); }

/* ─── FAQ accordion (homepage + /faq) ─────────────────────────────── */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq__item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    overflow: hidden;
    transition: border-color var(--t-fast) var(--ease);
}
.faq__item[open] { border-color: var(--border-strong); }
.faq__item summary {
    list-style: none;
    cursor: pointer;
    padding: 17px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--text);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
    content: "";
    flex: none;
    width: 9px; height: 9px;
    margin-right: 3px;
    border-right: 2px solid var(--text-mute);
    border-bottom: 2px solid var(--text-mute);
    transform: rotate(45deg);
    transition: transform var(--t-fast) var(--ease);
}
.faq__item[open] summary::after { transform: rotate(-135deg); }
.faq__item summary:hover { color: var(--accent-2); }
.faq__a {
    padding: 0 20px 18px;
    color: var(--text-mute);
    font-size: 0.96rem;
    line-height: 1.62;
}
.faq__a a { color: var(--accent-2); font-weight: 600; }
.faq__group { margin-top: 34px; }
.faq__group:first-of-type { margin-top: 0; }
.faq__group-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-2);
    margin: 0 0 14px;
}
.faq-more { text-align: center; margin-top: 22px; }
.faq-more a { color: var(--accent-2); font-weight: 600; }

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

/* ─── responsive trim ─────────────────────────────────────────────── */

@media (max-width: 720px) {
    .site-header__inner { padding: 12px 16px; gap: 12px; }
    .nav { gap: 2px; }
    .nav a { padding: 6px 10px; font-size: 0.86rem; }
    .brand { font-size: 0.95rem; }
    .container { padding: 0 16px; }
    .site-footer__inner { gap: 12px; }
}

@media (max-width: 420px) {
    /* On very small screens the nav can crowd the brand. Hide nav labels
       that aren't critical and let the brand mark do the work. */
    .brand span:last-child { display: none; }
}
