/* ==========================================================================
   TrueTapp company site
   Refined minimal, Apple-adjacent. System font stack, light + dark themes.
   ========================================================================== */

/* ---------- Tokens ---------- */

:root {
    --bg: #FCFCFD;
    --surface: #F5F5F7;
    --surface-2: #ECECF0;
    --ink: #0B0C0E;
    --text: #1B1B1F;
    --text-2: #55555E;
    --text-3: #6A6A72;
    --border: rgba(11, 12, 14, 0.10);
    --border-strong: rgba(11, 12, 14, 0.16);
    --accent: #B54F21;
    --accent-fill: #D65E27;
    --accent-press: #E06E38;
    --accent-soft: rgba(214, 94, 39, 0.10);
    --on-accent: #16100B;
    --selection: rgba(214, 94, 39, 0.25);
    --ring: rgba(11, 12, 14, 0.05);
    --shadow-card: 0 1px 2px rgba(11, 12, 14, 0.04), 0 8px 24px rgba(11, 12, 14, 0.06);
    --shadow-lift: 0 2px 4px rgba(11, 12, 14, 0.05), 0 16px 40px rgba(11, 12, 14, 0.10);
    --header-bg: rgba(252, 252, 253, 0.78);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --size-hero: clamp(2.625rem, 7vw, 4.5rem);
    --size-h1: clamp(2.25rem, 5.5vw, 3.5rem);
    --size-h2: clamp(1.625rem, 3.4vw, 2.25rem);
    --size-h3: 1.3125rem;
    --size-body: 1.0625rem;
    --size-small: 0.875rem;

    --radius-s: 10px;
    --radius-m: 16px;
    --radius-l: 24px;
    --squircle: 22.37%;
    --container: 1080px;
    --pad: 1.5rem;

    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0B0C0E;
        --surface: #151619;
        --surface-2: #1E1F24;
        --ink: #F5F5F7;
        --text: #F5F5F7;
        --text-2: #A2A2AA;
        --text-3: #8E8E96;
        --border: rgba(245, 245, 247, 0.12);
        --border-strong: rgba(245, 245, 247, 0.20);
        --accent: #D65E27;
        --accent-fill: #D65E27;
        --accent-press: #F0692C;
        --accent-soft: rgba(240, 105, 44, 0.16);
        --on-accent: #16100B;
        --selection: rgba(240, 105, 44, 0.38);
        --ring: rgba(245, 245, 247, 0.06);
        --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
        --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.45), 0 16px 40px rgba(0, 0, 0, 0.5);
        --header-bg: rgba(11, 12, 14, 0.72);
    }
}

/* ---------- Base ---------- */

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--size-body);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.prose a,
.app-desc a,
.error-page p a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.018em;
    color: var(--text);
    text-wrap: balance;
}

h1 { font-size: var(--size-h1); }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); letter-spacing: -0.012em; }

p {
    margin: 0 0 1em;
}

.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    padding: 0.75rem 1.25rem;
    background: var(--accent-fill);
    color: var(--on-accent);
    border-radius: 0 0 var(--radius-s) 0;
}

.skip-link:focus {
    left: 0;
}

:focus-visible {
    outline: 2px solid var(--accent-fill);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: var(--selection);
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    backdrop-filter: saturate(1.6) blur(18px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s ease;
}

.site-header.is-scrolled {
    border-bottom-color: var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 60px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text);
    font-weight: 650;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}

.brand:hover {
    text-decoration: none;
}

.brand svg,
.brand img {
    width: 30px;
    height: 30px;
    flex: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.site-nav a {
    padding: 0.4375rem 0.8125rem;
    border-radius: 999px;
    color: var(--text-2);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover {
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
}

.site-nav a[aria-current="page"] {
    color: var(--text);
    background: var(--surface-2);
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    margin-left: 0.75rem;
    padding: 0.1875rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8125rem;
}

.lang-switch a {
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    color: var(--text-2);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.lang-switch a:hover {
    text-decoration: none;
    color: var(--text);
}

.lang-switch a[aria-current="true"] {
    background: var(--ink);
    color: var(--bg);
}

.nav-toggle {
    display: none;
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    color: var(--text);
    cursor: pointer;
    border-radius: var(--radius-s);
}

.nav-toggle svg {
    width: 22px;
    height: 22px;
}

.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 719px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        margin: 0;
        padding: 0.75rem var(--pad) 1.25rem;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        display: none;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        padding: 0.75rem 1rem;
        font-size: 1.0625rem;
    }

    .lang-switch {
        margin: 0.5rem 0 0;
        align-self: flex-start;
    }

    .lang-switch a {
        padding: 0.625rem 1rem;
    }
}

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

.hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(4.5rem, 12vw, 8.5rem) clamp(3.5rem, 9vw, 6.5rem);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-radial-gradient(
        circle at 82% 18%,
        transparent 0,
        transparent 118px,
        var(--ring) 118px,
        var(--ring) 120px
    );
    -webkit-mask-image: radial-gradient(720px 620px at 82% 18%, #000 20%, transparent 72%);
    mask-image: radial-gradient(720px 620px at 82% 18%, #000 20%, transparent 72%);
    pointer-events: none;
}

.hero .container {
    position: relative;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.3125rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-fill);
}

.hero h1 {
    max-width: 15ch;
    margin-bottom: 0.4em;
    font-size: var(--size-hero);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.04;
}

.hero .lead {
    max-width: 54ch;
    font-size: clamp(1.125rem, 2vw, 1.3125rem);
    line-height: 1.55;
    color: var(--text-2);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.75rem 1.625rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--font);
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent-fill);
    color: var(--on-accent);
}

.btn-primary:hover {
    background: var(--accent-press);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--surface);
}

/* ---------- Sections ---------- */

.section {
    padding-block: clamp(3rem, 8vw, 5.5rem);
}

.section-alt {
    background: var(--surface);
}

.section-head {
    max-width: 44rem;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.section-head .kicker {
    display: block;
    margin-bottom: 0.625rem;
    color: var(--accent);
    font-size: var(--size-small);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-head p {
    margin: 0.625rem 0 0;
    color: var(--text-2);
    font-size: 1.125rem;
}

/* ---------- App icon (squircle) ---------- */

.app-icon {
    border-radius: var(--squircle);
    box-shadow: inset 0 0 0 1px var(--border);
    background: var(--surface-2);
    flex: none;
}

/* ---------- Featured app ---------- */

.featured {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(1.75rem, 4vw, 3.5rem);
    align-items: center;
    padding: clamp(1.75rem, 4vw, 3.25rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    background:
        radial-gradient(140% 120% at 12% 0%, var(--accent-soft) 0%, transparent 55%),
        var(--surface);
}

.featured-icon {
    display: grid;
    place-items: center;
}

.featured-icon .screen-card {
    width: min(272px, 62vw);
}

.featured-app-icon {
    display: block;
    width: 56px;
    height: 56px;
    margin-bottom: 0.875rem;
}

.featured-copy .app-kicker {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent);
    font-size: var(--size-small);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.featured-copy h2 {
    margin-bottom: 0.35em;
}

.featured-copy .store-name {
    color: var(--text-3);
    font-size: var(--size-small);
    font-weight: 500;
}

.featured-copy p {
    color: var(--text-2);
    max-width: 46ch;
}

@media (max-width: 767px) {
    .featured {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .featured-copy p {
        margin-inline: auto;
    }

    .featured-app-icon {
        margin-inline: auto;
    }

    .featured-copy .badge-row {
        justify-content: center;
    }
}

/* ---------- App Store badge ---------- */

.badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.store-badge img {
    height: 48px;
    width: auto;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.store-badge:hover img {
    transform: translateY(-1px);
    opacity: 0.88;
}

.badge-light { display: inline; }
.badge-dark { display: none; }

@media (prefers-color-scheme: dark) {
    .badge-light { display: none; }
    .badge-dark { display: inline; }
}

/* ---------- Apps grid ---------- */

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.app-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    background: var(--bg);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.section-alt .app-card {
    background: var(--bg);
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
    border-color: var(--border-strong);
}

.app-card .app-icon {
    width: 64px;
    height: 64px;
}

.app-card h3 {
    margin: 0;
}

.app-card h3 a {
    color: var(--text);
}

.app-card h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.app-card h3 a:hover {
    text-decoration: none;
}

.app-card .app-store-name {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-3);
    font-size: 0.8125rem;
    font-weight: 500;
}

.app-card p {
    margin: 0;
    color: var(--text-2);
    font-size: 0.9843rem;
}

.app-card .card-cta {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

/* ---------- Portfolio (apps page) ---------- */

.app-detail {
    display: grid;
    grid-template-columns: minmax(0, 160px) minmax(0, 1fr);
    gap: clamp(1.5rem, 3.5vw, 2.75rem);
    padding-block: clamp(2.5rem, 6vw, 4rem);
    border-top: 1px solid var(--border);
}

.app-detail:first-of-type {
    border-top: 0;
}

.app-detail .app-icon {
    width: clamp(96px, 14vw, 160px);
    height: auto;
    aspect-ratio: 1;
    box-shadow: var(--shadow-card), inset 0 0 0 1px var(--border);
}

.app-detail h2 {
    margin-bottom: 0.15em;
}

.app-detail .app-subtitle {
    margin: 0 0 1rem;
    color: var(--text-2);
    font-size: 1.1875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.app-detail .app-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.125rem 0;
    padding: 0;
    list-style: none;
}

.app-detail .app-meta li {
    padding: 0.3125rem 0.8125rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 0.8125rem;
    font-weight: 600;
}

.app-detail .app-desc {
    max-width: 62ch;
    color: var(--text-2);
}

.app-detail .app-desc p {
    margin-bottom: 0.75em;
}

.visit-site[data-pending] {
    display: none;
}

.visit-site {
    font-weight: 600;
}

@media (max-width: 599px) {
    .app-detail {
        grid-template-columns: 1fr;
    }

    .app-detail .app-icon {
        width: 112px;
    }
}

/* ---------- Prose (about, privacy, terms) ---------- */

.prose {
    max-width: 44rem;
}

.prose h2 {
    margin-top: 2.25em;
    font-size: 1.5rem;
}

.prose h3 {
    margin-top: 1.75em;
}

.prose p,
.prose li {
    color: var(--text-2);
}

.prose ul,
.prose ol {
    padding-left: 1.375rem;
}

.prose li {
    margin-bottom: 0.375em;
}

.prose strong {
    color: var(--text);
}

.page-hero {
    padding-block: clamp(3.5rem, 9vw, 6rem) clamp(1.5rem, 4vw, 2.5rem);
}

.page-hero .lead {
    max-width: 54ch;
    color: var(--text-2);
    font-size: clamp(1.125rem, 2vw, 1.25rem);
}

.breadcrumbs {
    margin-bottom: 1.5rem;
    font-size: var(--size-small);
    color: var(--text-3);
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumbs li + li::before {
    content: "/";
    margin-right: 0.375rem;
    color: var(--text-3);
}

.breadcrumbs a {
    color: var(--text-2);
}

/* ---------- Stats (about) ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-block: 2.5rem;
}

.stat {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    background: var(--surface);
}

.stat .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.stat .stat-label {
    color: var(--text-2);
    font-size: var(--size-small);
    font-weight: 500;
}

/* ---------- Press kit ---------- */

.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.asset-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    background: var(--bg);
}

.asset-card .asset-preview {
    display: grid;
    place-items: center;
    min-height: 120px;
    border-radius: var(--radius-s);
    background: var(--surface);
    padding: 1.25rem;
}

.asset-card .asset-preview.on-dark {
    background: #0B0C0E;
}

.asset-card .asset-preview img,
.asset-card .asset-preview svg {
    max-height: 80px;
    width: auto;
}

.asset-card h3 {
    margin: 0;
    font-size: 1.0625rem;
}

.asset-card .asset-links {
    display: flex;
    gap: 0.875rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

/* ---------- Contact ---------- */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.contact-card {
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    background: var(--bg);
}

.contact-card h2 {
    font-size: 1.3125rem;
    margin-bottom: 0.375em;
}

.contact-card p {
    color: var(--text-2);
}

.contact-card .btn {
    margin-top: 0.5rem;
}

/* ---------- CTA band ---------- */

.cta-band {
    position: relative;
    overflow: hidden;
    padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem);
    border-radius: var(--radius-l);
    background: var(--ink);
    color: var(--bg);
    text-align: center;
}

.cta-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-radial-gradient(
        circle at 50% 130%,
        transparent 0,
        transparent 88px,
        rgba(240, 133, 78, 0.14) 88px,
        rgba(240, 133, 78, 0.14) 90px
    );
    pointer-events: none;
}

.cta-band > * {
    position: relative;
}

.cta-band h2 {
    color: inherit;
}

.cta-band p {
    max-width: 46ch;
    margin-inline: auto;
    opacity: 0.75;
}

.cta-band .btn-primary {
    margin-top: 1rem;
}

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

.site-footer {
    margin-top: clamp(3rem, 8vw, 5rem);
    border-top: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.9375rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding-block: 3rem 2rem;
}

.footer-brand .brand {
    margin-bottom: 0.75rem;
}

.footer-brand p {
    max-width: 30ch;
    color: var(--text-2);
    font-size: var(--size-small);
}

.footer-col h3 {
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
}

.footer-col ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--text-2);
}

.footer-col a:hover {
    color: var(--text);
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    align-items: center;
    padding-block: 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--text-3);
    font-size: 0.8125rem;
}

@media (max-width: 767px) {
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* ---------- 404 ---------- */

.error-page {
    display: grid;
    place-items: center;
    min-height: 55vh;
    text-align: center;
    padding-block: 4rem;
}

.error-page .error-code {
    display: block;
    font-size: clamp(4rem, 14vw, 7rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text);
}

.error-page p {
    color: var(--text-2);
    max-width: 40ch;
}

/* ---------- Reveal animation ---------- */

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(14px);
        animation: reveal 0.7s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
    }

    .reveal:nth-child(2) { animation-delay: 0.08s; }
    .reveal:nth-child(3) { animation-delay: 0.16s; }
    .reveal:nth-child(4) { animation-delay: 0.24s; }
    .reveal:nth-child(5) { animation-delay: 0.32s; }

    @keyframes reveal {
        to {
            opacity: 1;
            transform: none;
        }
    }
}

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

    .btn,
    .app-card,
    .store-badge img {
        transition: none;
    }
}

/* ---------- Utilities ---------- */

.text-center { text-align: center; }
.muted { color: var(--text-2); }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Screenshot cards and hero visual ---------- */

.screen-card {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    box-shadow: var(--shadow-lift);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 6.5fr) minmax(0, 5.5fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.hero-visual {
    position: relative;
    min-height: 420px;
    display: grid;
    align-items: center;
}

.hero-visual::before {
    content: "";
    position: absolute;
    inset: 4% -6%;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--accent-soft) 0%, transparent 74%);
    pointer-events: none;
}

.hero-visual .screen-front {
    position: relative;
    z-index: 2;
    width: min(272px, 58%);
    justify-self: center;
    margin-left: 22%;
    transform: rotate(3.5deg);
}

.hero-visual .screen-back {
    position: absolute;
    z-index: 1;
    left: 0;
    top: 10%;
    width: min(232px, 50%);
    transform: rotate(-8deg);
}

.float-icon {
    position: absolute;
    z-index: 3;
    border-radius: 22.37%;
    box-shadow: var(--shadow-lift);
}

.fi-1 { top: 3%; right: 2%; width: 68px; height: 68px; }
.fi-2 { bottom: 12%; left: 2%; width: 56px; height: 56px; }
.fi-3 { bottom: -1%; right: 16%; width: 60px; height: 60px; }
.fi-4 { bottom: 15%; left: 27%; width: 64px; height: 64px; }
.fi-5 { top: 1%; left: 9%; width: 52px; height: 52px; }

@media (prefers-reduced-motion: no-preference) {
    .float-icon {
        animation: floaty 6s ease-in-out infinite alternate;
    }

    .fi-2 { animation-duration: 7.5s; animation-delay: -2.5s; }
    .fi-3 { animation-duration: 9s; animation-delay: -4s; }
    .fi-4 { animation-duration: 8s; animation-delay: -1.5s; }
    .fi-5 { animation-duration: 7s; animation-delay: -3.5s; }

    @keyframes floaty {
        from { translate: 0 -8px; }
        to { translate: 0 10px; }
    }
}

@media (max-width: 879px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        min-height: 0;
        margin-top: 2rem;
        justify-items: center;
    }

    .hero-visual .screen-front {
        width: min(240px, 70%);
        margin-left: 0;
    }

    .hero-visual .screen-back,
    .float-icon {
        display: none;
    }
}

/* ---------- App screenshots on the portfolio page ---------- */

.app-shot {
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 1.25rem;
}

.app-shot .screen-card {
    width: min(280px, 78vw);
}

.app-shot-wide .screen-card {
    width: min(560px, 92vw);
}

@media (min-width: 960px) {
    .app-detail {
        grid-template-columns: minmax(0, 160px) minmax(0, 1fr) minmax(0, 264px);
    }

    .app-shot {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
        justify-self: end;
        margin-top: 0;
    }

    .app-shot-wide {
        grid-column: 1 / -1;
        grid-row: auto;
        justify-self: center;
    }
}

/* ---------- SnapSong audio demos ---------- */

.audio-demo {
    margin-top: 1.5rem;
}

.audio-demo-label {
    margin: 0 0 0.625rem;
    font-size: var(--size-small);
    font-weight: 600;
    color: var(--text-2);
}

.track-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 340px;
}

.track {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem;
    padding-right: 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
}

.track-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: var(--accent-fill);
    color: var(--on-accent);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.track-play:hover {
    background: var(--accent-press);
}

.track-play svg {
    width: 16px;
    height: 16px;
}

.track .icon-pause { display: none; }
.track.is-playing .icon-pause { display: block; }
.track.is-playing .icon-play { display: none; }

.track-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.track-time {
    margin-left: auto;
    color: var(--text-3);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.track.is-playing .track-time { display: none; }

.track-eq {
    display: none;
    margin-left: auto;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.track.is-playing .track-eq { display: inline-flex; }

.track-eq i {
    width: 3px;
    height: 8px;
    border-radius: 1px;
    background: var(--accent-fill);
}

@media (prefers-reduced-motion: no-preference) {
    .track.is-playing .track-eq i {
        animation: eq 0.9s ease-in-out infinite alternate;
    }

    .track-eq i:nth-child(2) { animation-delay: -0.3s; }
    .track-eq i:nth-child(3) { animation-delay: -0.6s; }

    @keyframes eq {
        from { height: 4px; }
        to { height: 14px; }
    }
}

@media (max-width: 767px) {
    .featured .track-list {
        margin-inline: auto;
        text-align: left;
    }
}

/* ---------- Featured song stage ---------- */

.song-stage {
    position: relative;
    display: grid;
    place-items: center;
}

.song-stage .song-slide {
    grid-area: 1 / 1;
    width: min(280px, 64vw);
    height: auto;
    opacity: 0;
    transition: opacity 0.8s ease;
    filter: drop-shadow(0 18px 44px rgba(11, 12, 14, 0.30));
}

.song-stage .song-slide.is-active {
    opacity: 1;
}
