/* =============================================================
   Clypixa — dark SaaS theme with orange accent
   ============================================================= */

:root {
    --bg-0:      #07081a;
    --bg-1:      #0b0c1f;
    --bg-2:      #11132b;
    --text:      #e8eaf2;
    --text-dim:  #a5abc3;
    --text-mute: #8d93aa;
    --line:      rgba(255, 255, 255, 0.08);
    --line-soft: rgba(255, 255, 255, 0.05);

    --accent:        #ff6b1a;
    --accent-soft:   #ff8a3b;
    --accent-glow:   rgba(255, 107, 26, 0.55);
    --accent-hint:   rgba(255, 107, 26, 0.12);

    --success: #8be3a4;
    --info:    #9ec7ff;
    --error:   #ff8f8f;

    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;

    --shadow-card: 0 30px 60px -20px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    --shadow-glow: 0 14px 40px -10px var(--accent-glow);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background:
        radial-gradient(1200px 620px at 12% -8%, rgba(255, 122, 41, 0.14) 0%, transparent 60%),
        radial-gradient(900px 520px at 110% 8%, rgba(255, 158, 59, 0.09) 0%, transparent 55%),
        linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 40%, var(--bg-1) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Subtle grain overlay for depth */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.35;
    z-index: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.045 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

main { position: relative; z-index: 1; }

img { max-width: 100%; display: block; }
a { color: #ffb478; text-decoration: none; transition: color .15s ease; }
a:hover { color: #ffd1a8; }

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 22px;
}

.muted { color: var(--text-mute); }

/* =============================================================
   Navigation
   ============================================================= */
.nav {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    background: rgba(7, 8, 26, 0.65);
    border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 68px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    color: #fff;
    letter-spacing: -0.01em;
}

.nav-links { display: flex; gap: 24px; font-size: 14px; }
.nav-links a { color: #c8ccdd; }
.nav-links a:hover { color: #fff; }

@media (max-width: 560px) {
    .nav-links { gap: 16px; font-size: 13px; }
    .brand-name { display: none; }
}

/* =============================================================
   Hero
   ============================================================= */
.hero {
    padding: 90px 0 40px;
    text-align: center;
    position: relative;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: 0.2px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent-hint);
    border: 1px solid rgba(255, 107, 26, 0.3);
    color: #ffb478;
    margin-bottom: 26px;
}
.badge-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent-soft);
    box-shadow: 0 0 10px var(--accent-soft);
}

.hero-title {
    font-size: clamp(36px, 5.5vw, 64px);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin: 0 0 18px;
    color: #fff;
}
.gradient-text {
    background: linear-gradient(135deg, #ff6b1a 0%, #ffb478 55%, #ffe4c7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-sub {
    font-size: clamp(15px, 1.6vw, 18px);
    color: var(--text-dim);
    max-width: 620px;
    margin: 0 auto 40px;
}

/* =============================================================
   Glass card base
   ============================================================= */
.glass {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
}

/* =============================================================
   Input card
   ============================================================= */
.input-card {
    max-width: 780px;
    margin: 0 auto;
    padding: 22px;
    text-align: left;
}
.input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}
#url-input {
    flex: 1 1 280px;
    min-width: 0;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-md);
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#url-input:focus {
    outline: none;
    border-color: rgba(255, 138, 59, 0.6);
    box-shadow: 0 0 0 4px var(--accent-hint);
}
#url-input::placeholder { color: #6b7289; }
#url-input:disabled { opacity: 0.6; cursor: not-allowed; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease,
                border-color 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

.btn-primary {
    background: linear-gradient(135deg, #ff6b1a 0%, #ff8a3b 100%);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 18px 44px -8px rgba(255, 107, 26, 0.75);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.1);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); }

.btn-wide { width: 100%; }

/* Notices / status */
.input-notice {
    font-size: 12.5px;
    color: var(--text-mute);
    margin: 14px 2px 0;
}
.status-msg {
    margin-top: 14px;
    min-height: 22px;
    font-size: 14px;
}
.status-msg.error   { color: var(--error); }
.status-msg.info    { color: var(--info); }
.status-msg.success { color: var(--success); }
.status-msg .spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-soft);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    vertical-align: -2px;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================================
   Preview card
   ============================================================= */
.preview {
    max-width: 780px;
    margin: 28px auto 0;
    padding: 22px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 22px;
    text-align: left;
    animation: rise 0.4s ease both;
}
@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.preview-media { position: relative; }
.preview-thumb {
    width: 100%;
    border-radius: var(--r-md);
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--line);
}
.preview-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.preview-meta {
    font-size: 13.5px;
    color: var(--text-dim);
    margin-bottom: 16px;
}
.preview-meta .dot { margin: 0 8px; color: var(--text-mute); }

.format-label {
    display: block;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-mute);
    margin-bottom: 6px;
}
.select-wrap {
    position: relative;
    margin-bottom: 14px;
}
.select-wrap::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px; height: 8px;
    border-right: 2px solid var(--text-dim);
    border-bottom: 2px solid var(--text-dim);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}
.format-select {
    width: 100%;
    padding: 12px 38px 12px 14px;
    font-size: 14px;
    font-family: inherit;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-md);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.format-select:focus {
    outline: none;
    border-color: rgba(255, 138, 59, 0.6);
    box-shadow: 0 0 0 4px var(--accent-hint);
}

.download-notice {
    font-size: 12px;
    color: var(--text-mute);
    margin: 12px 2px 0;
}

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

/* =============================================================
   Sections
   ============================================================= */
.section {
    padding: 90px 0;
    position: relative;
}
.section-tight { padding: 30px 0 100px; }

.section-title {
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 800;
    text-align: center;
    margin: 0 0 8px;
    color: #fff;
    letter-spacing: -0.02em;
}
.section-sub {
    text-align: center;
    color: var(--text-dim);
    margin: 0 0 42px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.step {
    padding: 28px 24px;
    text-align: left;
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.step:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 107, 26, 0.35);
}
.step-num {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    margin-bottom: 14px;
    box-shadow: 0 10px 24px -6px var(--accent-glow);
}
.step h3 {
    font-size: 17px;
    margin: 0 0 6px;
    color: #fff;
}
.step p {
    margin: 0;
    color: var(--text-dim);
    font-size: 14.5px;
}
@media (max-width: 780px) {
    .steps { grid-template-columns: 1fr; }
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.info-card {
    padding: 32px;
}
.info-kicker {
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffb478;
    margin-bottom: 8px;
}
.info-card h2 {
    margin: 0 0 14px;
    font-size: 22px;
    color: #fff;
    line-height: 1.3;
}
.info-card p { color: #b1b7cc; }
.info-card ul {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #b1b7cc;
}
.info-card li { margin-bottom: 6px; }
@media (max-width: 780px) {
    .two-col { grid-template-columns: 1fr; }
}

/* =============================================================
   Legal pages
   ============================================================= */
.legal-page {
    max-width: 780px;
    padding-top: 20px;
}
.legal-page h1 {
    font-size: clamp(28px, 4vw, 42px);
    color: #fff;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}
.legal-page h2 {
    color: #fff;
    margin-top: 36px;
    font-size: 20px;
}
.legal-page p,
.legal-page ul,
.legal-page ol { color: #b1b7cc; }
.contact-email {
    font-size: 18px;
    padding: 16px 20px;
    border-radius: var(--r-md);
    background: var(--accent-hint);
    border: 1px solid rgba(255, 107, 26, 0.25);
    display: inline-block;
    color: #ffd1a8;
}

/* =============================================================
   Footer
   ============================================================= */
.footer {
    border-top: 1px solid var(--line-soft);
    padding: 36px 0;
    margin-top: 40px;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-mute);
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: #fff; }

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