/* ==========================================================================
   Fueera LLC — Software Division
   apps.fueera.com

   Editorial-brutalist: paper ground, hard black rules, oversized display
   type, monospace metadata, per-app accent. Motion lives in motion.js and
   is gated behind the .js class so the page is fully readable without it.
   ========================================================================== */

/* Palette is taken from the Fueera logo artwork itself: paper #F2EEE2,
   ink #222222, terracotta #DE6751. Keeping --paper and --ink exactly on the
   logo's own background colours is what lets the logo sit flush on the page
   in both themes instead of floating in a visible box. */
:root {
    color-scheme: light dark;

    --paper: #f2eee2;
    --paper-2: #e6e1d2;
    --ink: #222222;
    --ink-soft: #6b675e;
    --brand: #de6751;
    --grain: 0.035;

    /* Overridden per app page. */
    --accent: #222222;
    --accent-ink: #f2eee2;
    --brand-bg: #2a303c;

    --rule: 2px;
    --maxw: 1180px;
    --gutter: clamp(18px, 4vw, 56px);

    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    /* Display face is set per page to match that app's App Store artwork.
       Jost is the default: it is the closest open equivalent to the light,
       wide-tracked geometric of the Fueera logo wordmark. */
    --font-display: "Jost", "Futura", "Century Gothic", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --display-tracking: -0.04em;
    --display-weight: 900;
}

/* Dark theme. --paper lands exactly on #222222, the logo artwork's own
   background, so the dark logo reads as part of the page. */
@media (prefers-color-scheme: dark) {
    :root {
        --paper: #222222;
        --paper-2: #2c2c2b;
        --ink: #f2eee2;
        --ink-soft: #a29d92;
        --grain: 0.02;
    }
}

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

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

body {
    margin: 0;
    background-color: var(--paper);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.45;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Paper grain. Cheap, inline, and sits under everything. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    opacity: var(--grain);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }

::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

.mono {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.display {
    font-weight: var(--display-weight);
    letter-spacing: var(--display-tracking);
    line-height: 0.85;
    text-transform: uppercase;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Scroll progress + custom cursor
   -------------------------------------------------------------------------- */

.scroll-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 4px;
    z-index: 120;
    background: transparent;
}

.scroll-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transform-origin: 0 50%;
}

/* Pure white + `difference` blending, so the cursor inverts whatever is under
   it. That works on paper, on charcoal, and on top of the screenshots without
   needing a per-theme colour. */
.cursor {
    position: fixed;
    top: 0; left: 0;
    width: 26px; height: 26px;
    border: 2px solid #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 150;
    opacity: 0;
    transform: translate3d(-100px, -100px, 0);
    transition: width 0.3s var(--ease), height 0.3s var(--ease),
                background-color 0.3s var(--ease), opacity 0.3s;
    display: grid;
    place-items: center;
    mix-blend-mode: difference;
}

.cursor.is-active { opacity: 1; }

.cursor.is-hover { width: 64px; height: 64px; background: #fff; }

.cursor.is-drag { width: 78px; height: 78px; background: #fff; }

.cursor-label {
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 0.14em;
    color: #000;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.cursor.is-drag .cursor-label { opacity: 1; }

/* Pointer devices only — never steal the cursor on touch. */
@media (pointer: coarse), (hover: none) {
    .cursor { display: none; }
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--paper);
    border-bottom: var(--rule) solid var(--ink);
}

.site-nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 56px;
}

.nav-brand { font-weight: 900; letter-spacing: -0.02em; font-size: 1rem; text-transform: uppercase; }
.nav-brand sup { font-size: 0.5em; vertical-align: super; }

.nav-mid { color: var(--ink-soft); display: none; }
@media (min-width: 860px) { .nav-mid { display: block; } }

.nav-back { position: relative; }
.nav-back::after {
    content: "";
    position: absolute;
    left: 0; bottom: -3px;
    width: 100%; height: 2px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: 100% 50%;
    transition: transform 0.4s var(--ease);
}
.nav-back:hover::after { transform: scaleX(1); transform-origin: 0 50%; }

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

.hero {
    background: var(--brand-bg);
    color: #fff;
    border-bottom: var(--rule) solid var(--ink);
    position: relative;
    overflow: hidden;
}

.hero-grid {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(36px, 7vw, 76px) var(--gutter) 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: clamp(24px, 5vw, 64px);
    align-items: end;
}

.hero-icon {
    width: clamp(56px, 8vw, 76px);
    aspect-ratio: 1;
    object-fit: cover;
    border: var(--rule) solid rgba(255, 255, 255, 0.25);
    margin-bottom: 22px;
}

.hero h1 {
    font-size: clamp(2.6rem, 10.5vw, 7.5rem);
    margin-bottom: 0.12em;
}

.hero-tagline {
    font-size: clamp(1rem, 2.4vw, 1.5rem);
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 22px;
    max-width: 20ch;
    letter-spacing: -0.01em;
}

.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }

.hero-meta li {
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.85);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-bottom: clamp(32px, 5vw, 56px); }

.hero-media { align-self: end; }

.hero-shot {
    max-height: clamp(320px, 52vh, 520px);
    width: auto;
    margin-bottom: -2px;
    will-change: transform;
}

@media (max-width: 820px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-actions { padding-bottom: 24px; }
    .hero-shot { max-height: 380px; margin-inline: auto; }
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 26px;
    border: 2px solid var(--ink);
    background: var(--accent);
    color: var(--accent-ink);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    position: relative;
    will-change: transform;
    transition: box-shadow 0.3s var(--ease), background-color 0.3s, color 0.3s;
}

.btn:hover { box-shadow: 6px 6px 0 var(--ink); }

.btn-ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
}

.btn-ghost:hover { background: #fff; color: var(--ink); border-color: #fff; box-shadow: 6px 6px 0 var(--accent); }

.btn .glyph { width: 15px; height: 15px; flex: none; }

/* --------------------------------------------------------------------------
   Marquee
   -------------------------------------------------------------------------- */

.marquee {
    overflow: hidden;
    background: var(--accent);
    color: var(--accent-ink);
    border-bottom: var(--rule) solid var(--ink);
    padding: 12px 0;
    user-select: none;
}

.marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
}

.marquee-track span {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    font-size: clamp(1.3rem, 4vw, 2.6rem);
    padding-inline: 0.35em;
    white-space: nowrap;
}

.marquee-track span::after { content: "◆"; padding-left: 0.7em; font-size: 0.5em; vertical-align: middle; }

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

.section { padding: clamp(56px, 9vw, 120px) 0; border-bottom: var(--rule) solid var(--ink); }

.section-head { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); margin-bottom: clamp(32px, 5vw, 60px); }

.section-kicker { display: block; color: var(--ink-soft); margin-bottom: 18px; }

.section h2 {
    font-size: clamp(1.9rem, 6.5vw, 4.4rem);
    margin: 0 0 18px;
    font-weight: var(--display-weight);
    letter-spacing: var(--display-tracking);
    line-height: 0.92;
    text-transform: uppercase;
}

.lede { font-size: clamp(1rem, 1.7vw, 1.2rem); max-width: 62ch; margin: 0; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Features
   -------------------------------------------------------------------------- */

.features {
    max-width: var(--maxw);
    margin: 0 auto;
    padding-inline: var(--gutter);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 18px;
}

.feature {
    border: var(--rule) solid var(--ink);
    background: var(--paper);
    padding: 26px 24px 28px;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s var(--ease), background-color 0.35s, color 0.35s, box-shadow 0.35s var(--ease);
}

.feature:hover {
    background: var(--ink);
    color: var(--paper);
    transform: translate(-5px, -5px);
    box-shadow: 9px 9px 0 var(--accent);
}

.feature-num {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    color: var(--accent);
    margin-bottom: 34px;
}

.feature:hover .feature-num { color: var(--accent); }

.feature h3 {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
    text-transform: uppercase;
    line-height: 1.05;
}

.feature p { margin: 0; font-size: 0.95rem; color: inherit; opacity: 0.78; }

/* --------------------------------------------------------------------------
   Screenshot gallery — drag to scroll
   -------------------------------------------------------------------------- */

.shots-section { padding-bottom: clamp(48px, 7vw, 90px); }

.shots {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-block: 8px 28px;
    /* 100%, never vw: vw includes the scrollbar and pushes the page sideways. */
    padding-inline: max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter)));
    scrollbar-width: none;
    cursor: grab;
}

.shots::-webkit-scrollbar { display: none; }
.shots.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.shots.is-dragging img { pointer-events: none; }

.shot { flex: 0 0 auto; margin: 0; scroll-snap-align: center; }

.shot img {
    width: 252px;
    aspect-ratio: 828 / 1792;
    height: auto;
    border: var(--rule) solid var(--ink);
    background: var(--brand-bg);
    transition: transform 0.4s var(--ease);
}

.shot:hover img { transform: translateY(-6px); }

.shot figcaption {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Home page — app index
   -------------------------------------------------------------------------- */

.home-hero { border-bottom: var(--rule) solid var(--ink); padding: clamp(48px, 9vw, 110px) 0 clamp(32px, 5vw, 60px); }

/* The logo wipes up out of a mask, the same gesture the headlines use, so it
   reads as part of the page rather than an image dropped on top of it. */
.logo-mask {
    display: block;
    overflow: hidden;
    width: clamp(210px, 32vw, 330px);
    margin-bottom: clamp(26px, 4vw, 44px);
    line-height: 0;
}

.logo-mask picture { display: block; }
.logo-mask img { width: 100%; height: auto; }

.js .logo-mask[data-reveal] { opacity: 1; transform: none; }
.js .logo-mask img { transform: translateY(104%); transition: transform 1.1s var(--ease) 0.1s; }
.js .logo-mask.is-in img { transform: none; }

.home-hero h1 { font-size: clamp(2.4rem, 9vw, 6.4rem); margin-bottom: 24px; }

.home-hero .lede { font-size: clamp(1rem, 1.8vw, 1.25rem); max-width: 58ch; }

.app-row {
    display: grid;
    grid-template-columns: auto 64px 1fr auto;
    align-items: center;
    gap: clamp(14px, 3vw, 30px);
    padding: clamp(20px, 3.4vw, 34px) var(--gutter);
    border-bottom: var(--rule) solid var(--ink);
    max-width: var(--maxw);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    transition: color 0.4s var(--ease);
}

/* z-index 0 (not -1): a negative index would drop the wipe behind the page
   background entirely, since .app-row paints no background of its own. */
.app-row::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--row-accent, var(--ink));
    transform: scaleY(0);
    transform-origin: 50% 100%;
    transition: transform 0.45s var(--ease);
    z-index: 0;
}

.app-row > * { position: relative; z-index: 1; }

.app-row:hover::before { transform: scaleY(1); }
.app-row:hover { color: var(--row-ink, #fff); }
.app-row:hover .app-row-cat, .app-row:hover .app-row-desc { color: inherit; opacity: 0.8; }
.app-row:hover .app-row-idx { color: inherit; }

.app-row-idx { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; color: var(--ink-soft); }

.app-row-icon { width: 64px; height: 64px; object-fit: cover; border: var(--rule) solid var(--ink); }

.app-row h2 {
    font-size: clamp(1.3rem, 3.4vw, 2.4rem);
    font-weight: var(--display-weight);
    letter-spacing: var(--display-tracking);
    text-transform: uppercase;
    margin: 0 0 4px;
    line-height: 0.95;
}

.app-row-cat { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }

.app-row-desc { margin: 8px 0 0; font-size: 0.95rem; color: var(--ink-soft); max-width: 52ch; }

.app-row-go { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em; white-space: nowrap; }
.app-row-go span { display: inline-block; transition: transform 0.4s var(--ease); }
.app-row:hover .app-row-go span { transform: translateX(8px); }

@media (max-width: 760px) {
    .app-row { grid-template-columns: auto 1fr; row-gap: 10px; }
    .app-row-icon { grid-row: 1; width: 52px; height: 52px; }
    .app-row-body { grid-column: 1 / -1; }
    .app-row-go { grid-column: 1 / -1; }
    .app-row-desc { max-width: none; }
}

/* --------------------------------------------------------------------------
   Long-form document pages (privacy policy)
   -------------------------------------------------------------------------- */

.doc-head { border-bottom: var(--rule) solid var(--ink); padding: clamp(44px, 8vw, 96px) 0 clamp(28px, 4vw, 48px); }

.doc-head h1 { font-size: clamp(2.2rem, 8vw, 5.4rem); margin-bottom: 16px; }

.doc { padding: clamp(40px, 6vw, 80px) 0; }

.prose { max-width: 72ch; margin: 0 auto; padding-inline: var(--gutter); }

.prose h2 {
    font-size: clamp(1.05rem, 2.2vw, 1.4rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.015em;
    margin: 46px 0 14px;
    padding-top: 22px;
    border-top: var(--rule) solid var(--ink);
}

.prose > p:first-child { font-size: clamp(1.05rem, 1.9vw, 1.25rem); color: var(--ink); }

.prose p, .prose li { color: var(--ink-soft); margin: 0 0 14px; }

.prose li { position: relative; padding-left: 24px; }
.prose li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }

.prose strong { color: var(--ink); font-weight: 800; }
.prose a { border-bottom: 2px solid var(--accent); }

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

.cta-section { background: var(--brand-bg); color: #fff; padding: clamp(60px, 10vw, 130px) 0; text-align: center; border-bottom: var(--rule) solid var(--ink); }

.cta-section h2 { font-size: clamp(2.2rem, 9vw, 6rem); margin: 0 0 14px; }

.cta-section p { color: rgba(255, 255, 255, 0.6); margin: 0 0 32px; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; }

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

.site-footer { padding: clamp(36px, 5vw, 60px) 0; }

.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: baseline; }

.site-footer a { border-bottom: 2px solid transparent; transition: border-color 0.3s; }
.site-footer a:hover { border-bottom-color: var(--ink); }

.footer-links { display: flex; flex-wrap: wrap; gap: 16px 26px; }

/* --------------------------------------------------------------------------
   Motion primitives (only armed once JS confirms it is running)
   -------------------------------------------------------------------------- */

.js [data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Word-level masks: each word sits in its own overflow-hidden box and rises
   into place, staggered by --line-delay. */
.js .split-line {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding-bottom: 0.08em;
}

.js .split-line > span {
    display: inline-block;
    transform: translateY(115%);
    transition: transform 1.05s var(--ease);
    transition-delay: var(--line-delay, 0ms);
}

.js [data-split].is-in .split-line > span { transform: none; }

/* Anyone who asks for less motion gets none of it — and still sees everything. */
@media (prefers-reduced-motion: reduce) {
    .js [data-reveal],
    .js .split-line > span,
    .js .logo-mask img {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .marquee-track { animation: none !important; transform: none !important; }
    .cursor { display: none !important; }
    .feature, .btn, .shot img, .app-row::before, .app-row-go span { transition: none !important; }
    html { scroll-behavior: auto !important; }
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
