/**
 * style.css
 * Rotate 360 Studios - design system + site styles.
 * Built from scratch around the real logo palette (sampled directly from
 * images/logo1.jpg) since no original stylesheet survived the site's
 * years offline. No framework, no build step - just this file.
 */

/* ============================================================
   TOKENS
   ============================================================ */
:root {
    /* Color - sampled from the real logo, not guessed */
    --ink: #1a1a1a;
    --ink-soft: #5c5c5c;
    --ink-faint: #8a8a8a;
    --green: #56b300;
    --green-deep: #3d8200;
    --green-pale: #eef8e4;
    --paper: #f7f6f3;
    --surface: #ffffff;
    --line: #e3e1dc;
    --line-strong: #cfccc4;

    /* Type */
    --font-display: 'Space Grotesk', 'Arial Narrow', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Scale */
    --step--1: clamp(0.83rem, 0.8rem + 0.1vw, 0.9rem);
    --step-0:  clamp(1rem, 0.95rem + 0.2vw, 1.05rem);
    --step-1:  clamp(1.2rem, 1.1rem + 0.4vw, 1.3rem);
    --step-2:  clamp(1.5rem, 1.3rem + 0.8vw, 1.75rem);
    --step-3:  clamp(1.9rem, 1.6rem + 1.4vw, 2.4rem);
    --step-4:  clamp(2.4rem, 1.9rem + 2.2vw, 3.4rem);
    --step-5:  clamp(3rem, 2.2rem + 3.6vw, 4.6rem);

    /* Layout */
    --container: 1140px;
    --container-narrow: 760px;
    --radius: 10px;
    --radius-sm: 6px;
    --space-section: clamp(64px, 6vw + 32px, 120px);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
}
img { max-width: 100%; display: block; }
a { color: var(--green-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
}
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
hr { border: none; border-top: 1px solid var(--line); margin: 2.5em 0; }
code, textarea.code { font-family: 'SF Mono', Monaco, Consolas, monospace; }

/* Visible keyboard focus everywhere - not just default browser outline removed-then-forgotten */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--green-deep);
    outline-offset: 2px;
}

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

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 24px; }
.clearfix::after { content: ""; display: block; clear: both; }

.section { padding: var(--space-section) 0; }
.section-tight { padding: clamp(40px, 4vw, 64px) 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.grid { display: grid; gap: 32px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green-deep);
    margin-bottom: 14px;
}
.eyebrow::before {
    content: "";
    width: 16px;
    height: 2px;
    background: var(--green);
    display: inline-block;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--step--1);
    letter-spacing: 0.01em;
    padding: 13px 26px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--green-deep); color: #fff; }

.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); }

.btn-ghost { background: transparent; color: var(--ink-soft); padding: 13px 4px; }
.btn-ghost:hover { color: var(--ink); transform: none; }

.btn-sm { padding: 9px 18px; font-size: 0.82rem; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
#header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    max-width: var(--container);
    margin: 0 auto;
    gap: 24px;
}
#logo img { height: 73px; width: auto; }

#mainNav { display: flex; }
#mainNav > ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; align-items: center; }
#mainNav .nav-cta { margin-left: 8px; }
#mainNav > ul > li { position: relative; }
#mainNav > ul > li > a:not(.btn) {
    display: block;
    padding: 10px 14px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 0.93rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.15s ease;
}
#mainNav > ul > li > a:not(.btn):hover,
#mainNav > ul > li:hover > a:not(.btn) { background: var(--paper); }

#mainNav > ul > li > ul {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    list-style: none;
    margin: 6px 0 0;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}
#mainNav > ul > li:hover > ul { opacity: 1; visibility: visible; transform: translateY(0); }
#mainNav > ul > li > ul li a {
    display: block;
    padding: 9px 12px;
    border-radius: 5px;
    color: var(--ink);
    font-size: 0.9rem;
    text-decoration: none;
}
#mainNav > ul > li > ul li a:hover { background: var(--green-pale); color: var(--green-deep); }

.nav-toggle { display: none; }

@media (max-width: 900px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: 1px solid var(--line-strong);
        border-radius: var(--radius-sm);
        background: var(--surface);
        cursor: pointer;
    }
    .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
        content: ""; display: block; width: 18px; height: 2px; background: var(--ink); position: relative;
    }
    .nav-toggle span::before { content: ""; position: absolute; top: -6px; width: 18px; height: 2px; background: var(--ink); }
    .nav-toggle span::after { content: ""; position: absolute; top: 6px; width: 18px; height: 2px; background: var(--ink); }

    #mainNav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    }
    #mainNav.open { display: block; }
    #mainNav > ul { flex-direction: column; padding: 8px; gap: 0; }
    #mainNav > ul > li > a { padding: 12px 14px; }
    #mainNav > ul > li > ul {
        position: static;
        box-shadow: none;
        border: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        margin: 0 0 0 12px;
    }
    #mainNav > ul > li.subnav-open > ul { display: block; }
}

/* ============================================================
   FOOTER
   ============================================================ */
#footer {
    background: var(--ink);
    color: #cfcfcf;
    padding: 56px 0 28px;
    margin-top: var(--space-section);
}
#footer a { color: #fff; }
#footer .footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 700px) { #footer .footer-grid { grid-template-columns: 1fr; } }
#footer h6 { color: #fff; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 14px; }
#footer ul { list-style: none; padding: 0; margin: 0; }
#footer li { margin-bottom: 8px; font-size: 0.92rem; }
#footer .footer-bottom {
    border-top: 1px solid #333;
    margin-top: 40px;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #888;
    flex-wrap: wrap;
    gap: 8px;
}
#footer .footer-bottom a { color: #aaa; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
}
.card-feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.card-feature:hover { border-color: var(--green); transform: translateY(-2px); }
.card-feature .icon-badge {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--green-pale);
    color: var(--green-deep);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}

/* ============================================================
   PROCESS STEPS (genuinely sequential content - How It Works)
   ============================================================ */
.process-steps { list-style: none; padding: 0; margin: 0; }
.process-step {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 24px;
    padding: 28px 0;
    border-top: 1px solid var(--line);
}
.process-step:first-child { border-top: none; }
.process-step .step-number {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--line-strong);
}

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */
.page-header-band {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 44px 0;
}
.page-title {
    font-size: var(--step-3);
    margin: 0;
}
.page-subtitle { color: var(--ink-soft); font-size: var(--step-1); margin: 10px 0 0; max-width: 640px; }

/* ============================================================
   CONTENT LAYOUT (article + sidebar)
   ============================================================ */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 56px;
    align-items: start;
}
.content-layout.no-sidebar { grid-template-columns: 1fr; max-width: var(--container-narrow); }
@media (max-width: 860px) {
    .content-layout { grid-template-columns: 1fr; }
}
.content-body h2 { font-size: var(--step-2); margin-top: 1.6em; }
.content-body h2:first-child { margin-top: 0; }
.content-body h3 { font-size: var(--step-1); margin-top: 1.4em; }
.content-body img.content-img-right { float: right; max-width: 280px; margin: 0 0 20px 28px; border-radius: var(--radius-sm); }
.content-body img.content-img-left { float: left; max-width: 280px; margin: 0 28px 20px 0; border-radius: var(--radius-sm); }
.content-body .clear { clear: both; }

.sidebar-widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.sidebar-widget h6 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0 0 14px;
}
.sidebar-widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar-widget li { margin-bottom: 10px; }
.sidebar-widget li a { color: var(--ink); }
.sidebar-widget li a:hover { color: var(--green-deep); }
.sidebar-widget.cta-widget { background: var(--ink); border-color: var(--ink); color: #ddd; }
.sidebar-widget.cta-widget h6 { color: #fff; }
.sidebar-widget.cta-widget p { color: #bbb; font-size: 0.92rem; }
.sidebar-widget.cta-widget .btn-primary { background: var(--green); color: var(--ink); }
.sidebar-widget.cta-widget .btn-primary:hover { background: #fff; }

/* ============================================================
   PRICING TABLE
   ============================================================ */
.pricing-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.price-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
}
.price-card.featured { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.price-card .price-title { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 4px; }
.price-card .price-value { font-family: var(--font-display); font-size: 1.7rem; color: var(--green-deep); margin-bottom: 4px; }
.price-card .price-desc { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 16px; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 20px; flex-grow: 1; }
.price-card li { font-size: 0.9rem; padding: 7px 0; border-top: 1px solid var(--line); }
.price-card li:first-child { border-top: none; }

/* ============================================================
   FAQ ACCORDION
   ============================================================ */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 18px 4px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
}
.faq-trigger .faq-icon { font-size: 1.3rem; color: var(--green); flex-shrink: 0; margin-left: 16px; transition: transform 0.2s ease; }
.faq-trigger[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-panel { padding: 0 4px 20px; color: var(--ink-soft); }
.faq-panel[hidden] { display: none; }

/* ============================================================
   CLIENT LOGO GRID
   ============================================================ */
.client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px; }
.client-tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    aspect-ratio: 16/10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.client-tile img { max-height: 118px; width: auto; filter: grayscale(1) opacity(0.7); transition: filter 0.2s ease; }
.client-tile:hover img { filter: none; }

/* ============================================================
   DEMO / PRODUCT GRID
   ============================================================ */
.demo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .demo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .demo-grid { grid-template-columns: repeat(2, 1fr); } }
.demo-tile {
    display: block;
    text-decoration: none;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.demo-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,0.08); text-decoration: none; }
.demo-tile .demo-thumb-wrap { aspect-ratio: 4/3; overflow: hidden; background: #fafafa; position: relative; }
.demo-tile .demo-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.demo-tile .demo-thumb-wrap::after {
    content: "Click to rotate \21BB";
    position: absolute; inset: auto 0 0 0;
    background: rgba(26,26,26,0.78);
    color: #fff;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    padding: 7px 10px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.15s ease;
}
.demo-tile:hover .demo-thumb-wrap::after { transform: translateY(0); }
.demo-tile .demo-tile-title { padding: 12px 14px; font-family: var(--font-display); font-size: 0.92rem; font-weight: 500; }

/* ============================================================
   HOMEPAGE HERO
   ============================================================ */
.hero { padding: clamp(32px, 4vw, 56px) 0 0; overflow: hidden; }
.hero-inner {
    display: grid;
    grid-template-columns: 1fr 460px;
    gap: 48px;
    align-items: center;
}
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
}
.hero h1 {
    font-size: var(--step-4);
    max-width: 13ch;
}
.hero h1 .accent { color: var(--green); }
.hero-lede { font-size: var(--step-1); color: var(--ink-soft); max-width: 46ch; margin: 18px 0 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-visual {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hero-visual img { max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.hero-visual .rotate-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    background: var(--ink);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    padding: 7px 12px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.hero-visual .rotate-badge .spin-icon { display: inline-block; animation: spin 3.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   LIVE VIEWER SHOWCASE (below the fold)
   ============================================================ */
.viewer-showcase {
    background: var(--ink);
    color: #ddd;
    padding: var(--space-section) 0;
}
.viewer-showcase .eyebrow { color: var(--green); }
.viewer-showcase h2 { color: #fff; font-size: var(--step-3); }
.viewer-showcase p.lede { color: #aaa; font-size: var(--step-1); max-width: 56ch; }
.viewer-frame-wrap {
    margin-top: 36px;
    max-width: 640px;
}
.viewer-frame-wrap iframe { display: block; width: 100%; border: 0; height: 460px; }

/* ============================================================
   MODAL (used by new-demos.php)
   ============================================================ */
.demo-modal { position: fixed; inset: 0; z-index: 9999; }
.demo-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.85); }
.demo-modal-frame {
    position: relative;
    width: 90vw;
    max-width: 720px;
    height: 80vh;
    max-height: 640px;
    margin: 5vh auto;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.demo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--ink);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.92rem;
    flex-shrink: 0;
}
.demo-modal-close { background: none; border: none; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.demo-modal-close:hover { opacity: 0.7; }
.demo-modal-frame iframe { flex: 1; border: 0; width: 100%; }
@media (max-width: 600px) { .demo-modal-frame { width: 95vw; height: 85vh; } }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.max-w-prose { max-width: 60ch; }
.stack-sm > * + * { margin-top: 12px; }
.lede { font-size: var(--step-1); color: var(--ink-soft); }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head.centered { margin-left: auto; margin-right: auto; text-align: center; }
