/* PinkCrab — Kinetic WordPress Engineering
   Tokens derived from the Stitch "Kinetic Engineering Collective" design system. */

:root {
    /* Dark theme (design default) */
    --bg: #101415;
    --bg-lowest: #0b0f10;
    --surface-1: #191c1e;
    --surface-2: #1d2022;
    --surface-3: #272a2c;
    --surface-4: #323537;
    --text: #e0e3e5;
    --text-muted: #b9bcc0;
    --text-soft: #e3c2bd;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.22);
    --primary: #feaaaa;
    --on-primary: #5a1010;
    --primary-strong: #f87e7e;
    --on-primary-strong: #4a0d0d;
    --tertiary: #bfc6dd;
    --error: #ffb4ab;
    --status: #9fe8c6;
    --grid-line: rgba(255, 255, 255, 0.03);
    --selection-bg: #feaaaa;
    --selection-text: #5a1010;

    /* Buttons keep the exact logo pink in BOTH themes */
    --btn-bg: #feaaaa;
    --btn-text: #5a1010;
    --btn-bg-hover: #f87e7e;
    --btn-text-hover: #4a0d0d;
    --focus: #feaaaa;

    --font-display: "Montserrat", system-ui, sans-serif;
    --font-body: "Hanken Grotesk", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;

    --container-max: 1280px;
    --radius: 0.25rem;
    --radius-lg: 0.5rem;

    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #fff7f9;
    --bg-lowest: #fbeaef;
    --surface-1: #fbf0f4;
    --surface-2: #f7e8ee;
    --surface-3: #f1dfe6;
    --surface-4: #e9d4dd;
    --text: #1e1e23;
    --text-muted: #47474d;
    --text-soft: #4f4f56;
    --border: rgba(33, 24, 28, 0.14);
    --border-strong: rgba(33, 24, 28, 0.3);
    --primary: #f87e7e;
    --on-primary: #5a1010;
    --primary-strong: #f87e7e;
    --on-primary-strong: #4a0d0d;
    --focus: #211a1d;
    --tertiary: #3f4659;
    --error: #ba1a1a;
    --status: #00694a;
    --grid-line: rgba(33, 24, 28, 0.05);
    --selection-bg: #feaaaa;
    --selection-text: #5a1010;

    color-scheme: light;
}

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

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--selection-bg);
    color: var(--selection-text);
}

img {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    margin: 0;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

h3 {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--primary);
}

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

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

@media (min-width: 768px) {
    .container {
        padding-inline: 48px;
    }
}

.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;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 100;
    background: var(--btn-bg);
    color: var(--btn-text);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 16px;
}

.accent {
    color: var(--primary);
}

/* ---------- Icons ---------- */

.icon {
    width: 1.25em;
    height: 1.25em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.icon-lg {
    width: 2rem;
    height: 2rem;
}

.icon-xl {
    width: 3rem;
    height: 3rem;
}

.primary-tint { color: var(--primary); }
.error-tint { color: var(--error); }
.tertiary-tint { color: var(--tertiary); }
.muted-tint { color: var(--text-muted); }

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.button-primary {
    background: var(--btn-bg);
    color: var(--btn-text);
}

.button-primary:hover {
    background: var(--btn-bg-hover);
    color: var(--btn-text-hover);
}

.button-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.button-ghost:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.icon-button:hover {
    color: var(--primary);
    border-color: var(--border-strong);
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 80px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    text-decoration: none;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--primary);
}

.site-nav {
    display: none;
}

.nav-list {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list a {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-list a:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-cta {
    display: none;
    padding: 10px 24px;
}

@media (min-width: 900px) {
    .site-nav { display: block; }
    .header-cta { display: inline-flex; }
    .menu-toggle { display: none; }
}

/* Theme toggle: show the icon for the theme you'd switch TO */
.icon-moon { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }
:root[data-theme="light"] .icon-sun { display: none; }

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

.mobile-menu {
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu a {
    display: block;
    padding: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius);
}

.mobile-menu a:hover {
    color: var(--primary);
    background: var(--surface-2);
}

.mobile-menu a.button {
    display: inline-flex;
    color: var(--on-primary);
    margin-top: 8px;
}

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

.section {
    padding-block: 56px;
    border-bottom: 1px solid var(--border);
}

.section-last {
    border-bottom: 0;
}

.section-head {
    margin-bottom: 48px;
    max-width: 48rem;
}

.section-head-center {
    margin-inline: auto;
    text-align: center;
}

.lead {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-soft);
    margin: 12px 0 0;
}

.heading-with-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Blueprint grid backdrop */
.tech-grid {
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 48px 48px;
}

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

.hero {
    padding-block: 64px 56px;
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-logo {
    width: clamp(8rem, 20vw, 12rem);
    height: auto;
}

.hero h1 {
    margin-top: 24px;
    max-width: 56rem;
}

.hero .lead {
    max-width: 42rem;
    margin-top: 20px;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
    width: 100%;
    max-width: 24rem;
}

@media (min-width: 640px) {
    .hero-actions {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        width: auto;
        max-width: none;
    }
}

/* Terminal — always dark, in both themes, so the logo-pink prompts always work */
.terminal {
    width: 100%;
    max-width: 48rem;
    margin-top: 48px;
    background: #272a2c;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-lg);
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    text-align: left;
    color: #b9bcc0;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #323537;
}

.dot-red { background: #ff5f56; }
.dot-amber { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-title {
    margin-left: 8px;
    color: #b9bcc0;
}

.terminal-body p,
.hud-body p {
    margin: 0 0 8px;
}

.t-prompt { color: #feaaaa; }
.t-dim { color: #bfc6dd; }
.t-status { color: #9fe8c6; margin-top: 16px; }

.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #feaaaa;
    animation: blink 1.2s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ---------- Cards & grids ---------- */

.card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: var(--border-strong);
}

.card-copy {
    color: var(--text-soft);
    margin: 12px 0 0;
}

.card-icon {
    display: block;
    margin-bottom: 16px;
}

.card h3 {
    margin-top: 0;
}

.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-4,
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Vibe / HUD ---------- */

.vibe-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
}

@media (min-width: 1024px) {
    .vibe-grid { grid-template-columns: 1fr 1fr; }
}

.check-list {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--text-soft);
}

.check-list li {
    display: flex;
    align-items: center;
    gap: 12px;
}

.check-list .icon {
    color: var(--primary);
}

.hud {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    padding: 24px;
    background: #272a2c;
    border-color: rgba(255, 255, 255, 0.22);
}

.hud-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #b9bcc0;
}

.hud-dots {
    display: flex;
    gap: 8px;
}

.hud-dots .dot {
    width: 8px;
    height: 8px;
}

.dot-live {
    background: #feaaaa;
}

.hud-body {
    color: #b9bcc0;
}

.pulse {
    animation: blink 1.6s ease-in-out infinite;
}

/* ---------- Reviews ---------- */

.reviews {
    max-width: 64rem;
}

.review {
    display: grid;
    gap: 16px;
    margin: 0;
    padding-block: 20px;
}

.review-quote {
    margin: 0;
    max-width: 62ch;
}

.review-quote p {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text);
}

.review-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-stars {
    display: inline-flex;
    gap: 2px;
    color: var(--primary);
}

.review-stars .icon {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    stroke: none;
}

.review-name {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    text-underline-offset: 4px;
}

.review-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

@media (min-width: 768px) {
    .review {
        grid-template-columns: 12rem 1fr;
        grid-template-areas: "meta quote";
        gap: 48px;
    }

    .review-meta { grid-area: meta; }
    .review-quote { grid-area: quote; }
}

/* ---------- Audit CTA ---------- */

.audit-card {
    text-align: center;
    padding: 32px;
}

@media (min-width: 768px) {
    .audit-card { padding: 48px; }
}

.audit-card > .icon-xl {
    margin-bottom: 20px;
}

.audit-card .lead {
    max-width: 42rem;
    margin-inline: auto;
    margin-bottom: 24px;
}

.audit-form {
    display: grid;
    gap: 20px;
    max-width: 40rem;
    margin-inline: auto;
    text-align: left;
}

@media (min-width: 640px) {
    .audit-form { grid-template-columns: 1fr 1fr; }
    .audit-form .field-wide,
    .audit-form .form-submit { grid-column: 1 / -1; }
}

.audit-form .form-submit {
    justify-self: center;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

.field-hint {
    font-weight: 400;
    color: var(--text-muted);
}

.audit-form input,
.audit-form textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 12px 16px;
    font: inherit;
    color: var(--text);
}

.audit-form textarea {
    min-height: 8rem;
    resize: vertical;
}

.audit-form input::placeholder,
.audit-form textarea::placeholder {
    color: var(--text-muted);
}

.audit-form input:focus,
.audit-form textarea:focus {
    border-color: var(--focus);
    outline: 2px solid var(--focus);
    outline-offset: 0;
}

.audit-form [aria-invalid="true"] {
    border-color: var(--error);
}

.audit-form[hidden],
.turnstile-box[hidden] {
    display: none;
}

.audit-form .hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.turnstile-box {
    display: flex;
    justify-content: center;
}

/* Only add space when Cloudflare actually shows a challenge. */
.turnstile-box.is-visible {
    margin-top: 16px;
}

.turnstile-box:empty {
    display: none;
}

.audit-aside {
    margin: 24px 0 0;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.audit-aside [hidden] {
    display: none;
}

.audit-aside a {
    color: var(--text-soft);
    text-underline-offset: 4px;
}

.audit-aside a:hover {
    color: var(--primary);
}

.form-status:empty {
    display: none;
}

.form-status {
    min-height: 1.5rem;
    margin: 16px 0 0;
    font-weight: 600;
    color: var(--status);
}

.form-status.is-sent {
    margin: 0;
    font-size: 1.25rem;
}

.form-status.is-error {
    color: var(--error);
}

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

.site-footer {
    background: var(--bg-lowest);
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-block: 36px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.footer-bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
}

@media (min-width: 900px) {
    .footer-bottom {
        flex-wrap: nowrap;
    }
}

.footer-copy {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

@media (min-width: 900px) {
    .footer-copy {
        white-space: nowrap;
    }
}

.footer-legal {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.6;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

@media (min-width: 900px) {
    .footer-nav {
        flex-wrap: nowrap;
    }
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    text-underline-offset: 4px;
}

.footer-nav a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.footer-nav a.button {
    color: var(--on-primary);
    text-decoration: none;
}

/* ---------- Privacy dialog ---------- */

.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    letter-spacing: inherit;
    color: var(--text-muted);
    cursor: pointer;
    text-underline-offset: 4px;
}

.link-button:hover {
    color: var(--primary);
    text-decoration: underline;
}

.dialog {
    background: var(--surface-1);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: min(32rem, calc(100vw - 32px));
}

.dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.dialog-inner {
    padding: 32px;
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.dialog-head h2 {
    font-size: 1.375rem;
}

.dialog-list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--text-soft);
}

.dialog-note {
    margin: 24px 0 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* ---------- Light-mode adjustments ----------
   The logo pink (#feaaaa) is too light to be legible AS TEXT on light
   backgrounds, so in light mode it appears as fills with dark text. */

:root[data-theme="light"] .accent {
    background: #feaaaa;
    color: var(--text);
    padding: 0 0.18em;
    border-radius: 0.15em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

:root[data-theme="light"] .brand-name {
    color: var(--text);
}

:root[data-theme="light"] .nav-list a:hover,
:root[data-theme="light"] .mobile-menu a:hover,
:root[data-theme="light"] .footer-nav a:hover,
:root[data-theme="light"] .link-button:hover {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: #f87e7e;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
}

:root[data-theme="light"] .icon-button:hover {
    color: var(--text);
}

/* ---------- Reduced motion ---------- */

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
