/* Color Palette */
:root {
    /* Core Colors */
    --color-charcoal: #1a1a1a;
    --color-fire-orange: #ff6b35;
    --color-burnt-orange: #E65C00;
    --color-pure-white: #ffffff;
    --color-off-white: #f0f0f0;
    --color-light-gray: #cccccc;
    --color-medium-gray: #888888;

    /* Accent Colors */
    --color-electric-ice: #e0f7ff;

    /* Transparent Colors */
    --color-frame-white: rgba(255, 255, 255, 0.6);
    --color-cta-line: rgba(255, 255, 255, 0.2);
    --color-cta-bg: rgba(224, 247, 255, 0.08);
    --color-cta-bg-alt: rgba(224, 247, 255, 0.04);

    /* Shadows */
    --shadow-drop: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    --shadow-subtle: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

/* Fonts */
@font-face {
    font-family: 'Manic';
    src: url('assets/fonts/MANIC-Regular.woff2') format('woff2'),
         url('assets/fonts/MANIC-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Manic-Alt2';
    src: url('assets/fonts/MANIC-Alternates2-Regular.woff2') format('woff2'),
         url('assets/fonts/MANIC-Alternates2-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Manic', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--color-charcoal);
    background-image: url('assets/background-texture.webp');
    background-repeat: repeat;
    background-size: 400px;
    color: var(--color-pure-white);
    min-height: 100vh;
    line-height: 1.5;
}

/* Layout */
main {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Viewfinder Frame */
.viewfinder-frame {
    position: relative;
    width: 100%;
    max-width: 600px;
    padding: 0.5rem 0;
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.viewfinder-frame::before,
.viewfinder-frame::after,
.frame-bottom::before,
.frame-bottom::after {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: transparent;
}

.viewfinder-frame::before {
    top: 0;
    left: 0;
    background:
        linear-gradient(var(--color-frame-white), var(--color-frame-white)) 0 0 / 20px 2px no-repeat,
        linear-gradient(var(--color-frame-white), var(--color-frame-white)) 0 0 / 2px 20px no-repeat;
}

.viewfinder-frame::after {
    display: none;
}

.frame-top-right {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.5rem;
    letter-spacing: 0.05em;
    color: var(--color-frame-white);
}

.frame-top-right .h-text {
    margin-bottom: 0.1rem;
    padding-right: 1.5em;
}

.frame-top-right .v-text {
    writing-mode: vertical-rl;
}

.frame-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
}

.frame-bottom::before {
    content: "SMALLFIRE.AI";
    bottom: 0;
    left: 0;
    width: auto;
    height: auto;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.5rem;
    letter-spacing: 0.05em;
    color: var(--color-frame-white);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.frame-bottom::after {
    bottom: 0;
    right: 0;
    background:
        linear-gradient(var(--color-frame-white), var(--color-frame-white)) 100% 100% / 20px 2px no-repeat,
        linear-gradient(var(--color-frame-white), var(--color-frame-white)) 100% 100% / 2px 20px no-repeat;
}

.hero-image {
    display: block;
    margin: 0 auto 0.25rem auto;
    width: 182px;
    height: auto;
    filter: var(--shadow-drop);
}

.hero-text {
    font-family: 'Manic-Alt2', 'Manic', sans-serif;
    font-size: 2.5rem;
    line-height: 1.4;
    color: var(--color-off-white);
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.hero-text strong {
    color: var(--color-burnt-orange);
    font-weight: normal;
}

.nowrap {
    white-space: nowrap;
}

.ice {
    color: var(--color-electric-ice);
}

/* CTAs */
.ctas {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
    margin-top: 3rem;
    overflow: visible;
}

.whatsapp-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem 5%;
    text-decoration: none;
    cursor: pointer;
    background-color: var(--color-cta-bg);
    border-radius: 1rem;
    min-height: 160px;
    overflow: visible;
}

.whatsapp-row::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 17%;
    height: 66%;
    width: 1px;
    background-color: var(--color-cta-line);
    transform: translateX(-50%);
}

.whatsapp-text {
    flex: 0 0 50%;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.85rem;
    color: var(--color-pure-white);
    line-height: 1.4;
    padding-right: 2.5rem;
    text-transform: uppercase;
    text-align: left;
    letter-spacing: 0.05em;
}

@media (min-width: 480px) {
    .whatsapp-row {
        gap: 2rem;
        padding: 1rem 10%;
    }

    .whatsapp-text {
        font-size: 0.95rem;
    }
}

@media (max-width: 479px) {
    .whatsapp-text {
        padding-left: 1.5rem;
    }
}

.whatsapp-row:hover .whatsapp-text {
    color: rgba(255, 255, 255, 0.9);
}

.whatsapp-bubble-wrap {
    flex-shrink: 1;
    max-width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: calc(50% + 1.5rem);
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

@media (min-width: 600px) {
    .whatsapp-bubble-wrap {
        left: calc(50% + 2rem);
        right: 2rem;
    }
}

.whatsapp-bubble {
    width: 100%;
    height: auto;
    display: block;
    filter: var(--shadow-subtle);
    transform: scale(1.0125);
}

/* Help Row */
.help-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem 5%;
    text-decoration: none;
    cursor: pointer;
    background-color: var(--color-cta-bg-alt);
    border-radius: 1rem;
    overflow: visible;
    min-height: 160px;
}

.help-row::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 17%;
    height: 66%;
    width: 1px;
    background-color: var(--color-cta-line);
    transform: translateX(-50%);
}

.help-text {
    flex: 0 0 50%;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.85rem;
    color: var(--color-pure-white);
    line-height: 1.4;
    padding-right: 3.5rem;
    text-transform: uppercase;
    text-align: left;
    letter-spacing: 0.05em;
}

@media (min-width: 480px) {
    .help-row {
        gap: 2rem;
        padding: 1rem 10%;
    }

    .help-text {
        font-size: 0.95rem;
    }
}

@media (max-width: 479px) {
    .help-text {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.help-row:hover .help-text {
    color: rgba(255, 255, 255, 0.9);
}

.help-image-wrap {
    flex-shrink: 0;
    width: 45%;
    padding-left: 0;
    position: absolute;
    left: calc(50% + 1.5rem);
    bottom: 17%;
    transform-origin: bottom left;
}

.help-image {
    width: 100%;
    height: auto;
    display: block;
    filter: var(--shadow-drop);
}

/* Combined Row */
.combined-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.combined-left,
.combined-right {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    text-decoration: none;
    cursor: pointer;
    background-color: var(--color-cta-bg-alt);
    border-radius: 1rem;
    min-height: 160px;
}

.combined-left {
    justify-content: flex-start;
    min-width: 0;
}

.combined-right {
    justify-content: flex-end;
    min-width: 0;
}

@media (min-width: 480px) {
    .combined-left {
        padding-left: 1.5rem;
    }
    .combined-right {
        padding-right: 1.5rem;
    }
}

.combined-text-left,
.combined-text-right {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.85rem;
    color: var(--color-pure-white);
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 0;
    flex-shrink: 1;
}

.combined-text-left {
    text-align: left;
    padding-right: 0.75rem;
}

.combined-text-right {
    text-align: right;
}

@media (min-width: 480px) {
    .combined-text-right {
        padding-left: 1rem;
    }
}

.combined-image-left,
.combined-image-right {
    width: auto;
    height: 101px;
    max-height: 80%;
    display: block;
    filter: var(--shadow-drop);
    margin: 0 0.5rem;
    flex-shrink: 0;
}

.combined-image-left {
    margin-left: 1rem;
}

.combined-left:hover .combined-text-left,
.combined-right:hover .combined-text-right {
    color: rgba(255, 255, 255, 0.9);
}

@media (min-width: 480px) {
    .combined-text-left,
    .combined-text-right {
        font-size: 0.95rem;
    }

    .combined-image-left,
    .combined-image-right {
        height: 115px;
    }
}

/* Narrow desktop - tighten spacing for longer text */
@media (min-width: 480px) and (max-width: 650px) {
    .combined-right {
        padding-right: 0.75rem;
        gap: 0.5rem;
    }
    .combined-text-right {
        padding-left: 0;
    }
    .combined-image-right {
        margin-right: 0.25rem;
    }
}

/* Big note callout */
.terms-page .big-note {
    font-family: 'Manic', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 2rem;
    font-weight: normal;
    margin: 1rem 0 1rem 0;
    padding-left: 0;
    color: var(--color-frame-white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.note-arrow {
    width: 2rem;
    height: auto;
    filter: invert(1) opacity(0.6);
    transform: rotate(-55deg);
}

/* Footer */
footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
}

footer a {
    color: var(--color-medium-gray);
    text-decoration: none;
    font-size: 0.875rem;
}

footer a:hover {
    color: var(--color-pure-white);
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--color-medium-gray);
    text-decoration: none;
    font-size: 0.875rem;
}

.back-link:hover {
    color: var(--color-pure-white);
}

/* Terms Page */
.terms-page {
    padding-bottom: 3rem;
}

.terms-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-fire-orange);
    font-weight: normal;
}

.terms-page h2 {
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--color-fire-orange);
    font-weight: normal;
}

.terms-page h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-pure-white);
    font-weight: bold;
}

.terms-page p {
    margin-bottom: 1rem;
    color: var(--color-light-gray);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.1rem;
}

.terms-page ul, .terms-page ol {
    margin-bottom: 1rem;
    padding-left: 1.25rem;
    color: var(--color-light-gray);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.1rem;
}

.terms-page li {
    margin-bottom: 0.5rem;
}

.terms-page a {
    color: var(--color-fire-orange);
}

.terms-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 1rem;
}

.terms-page th, .terms-page td {
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem;
    text-align: left;
}

.terms-page th {
    background: rgba(255,255,255,0.05);
}

.terms-page hr {
    border: none;
    border-top: 1px solid var(--color-frame-white);
    margin: 2rem 0;
}

.terms-page footer a {
    color: var(--color-medium-gray);
}

.terms-page footer a:hover {
    color: var(--color-pure-white);
}

.terms-page .lead-phrase {
    font-family: 'Manic', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 2.5rem;
    color: var(--color-fire-orange);
    font-weight: normal;
}

.terms-page p:has(.lead-phrase) {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.terms-page p:has(.lead-phrase):first-of-type {
    margin-top: 3rem;
}

/* Responsive */
@media (min-width: 768px) {
    .hero-image {
        width: 234px;
    }

    .hero-text {
        font-size: 3rem;
    }

    main {
        padding: 3rem 2rem;
    }
}

/* Responsive visibility utilities */
.desktop-only {
    display: none;
}
.mobile-only {
    display: inline;
}
@media (min-width: 480px) {
    .desktop-only {
        display: inline;
    }
    .mobile-only {
        display: none;
    }
}

/* Hero easter egg */
.viewfinder-frame {
    position: relative;
    -webkit-user-select: none;
    user-select: none;
}
.hero-easter-egg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 181px;
    height: calc(182px * 1149 / 700); /* keep container same size */
    object-fit: contain;
    object-position: center 68%; /* mobile: 2px lower than desktop */
    filter: var(--shadow-drop);
    opacity: 0;
    pointer-events: none;
}
@media (min-width: 768px) {
    .hero-easter-egg {
        width: 233px;
        height: calc(234px * 1149 / 700); /* keep container same size */
        object-position: center 66%; /* desktop alignment */
    }
}
.viewfinder-frame.pressed .hero-easter-egg {
    opacity: 1;
}
.viewfinder-frame.pressed .hero-default {
    opacity: 0;
}
