/* Layout for the GhostChat website. Colours, font and components come from ghostchat.css. */

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

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

body {
    margin: 0;
    background: var(--gc-background);
    color: var(--gc-on-background);
    font-family: var(--gc-font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s, color 0.25s;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }

.pixel {
    font-family: var(--gc-font-pixel);
    -webkit-font-smoothing: none;
    letter-spacing: 0;
}

.eyebrow {
    display: inline-block;
    font-family: var(--gc-font-pixel);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gc-secondary);
    margin-bottom: 20px;
}

h1, h2, h3 { margin: 0; font-weight: 400; }

h2 {
    font-family: var(--gc-font-pixel);
    font-size: clamp(20px, 3.2vw, 32px);
    line-height: 1.4;
    margin-bottom: 20px;
}

.lead { color: var(--gc-on-surface-variant); font-size: 19px; max-width: 54ch; margin: 0; }

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

.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--gc-background) 82%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid color-mix(in srgb, var(--gc-surface-variant) 70%, transparent);
}
.nav .container {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 72px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-family: var(--gc-font-pixel);
    font-size: 14px;
}
.brand img { width: 32px; height: 32px; image-rendering: pixelated; }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a {
    text-decoration: none;
    font-size: 15px;
    color: var(--gc-on-surface-variant);
}
.nav-links a:hover { color: var(--gc-on-background); }
.nav .gc-button { min-height: 40px; padding: 0 18px; font-size: 10px; }

@media (max-width: 760px) {
    .nav-links { display: none; }
    .nav .gc-button { margin-left: auto; }
}

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

.hero {
    padding: clamp(56px, 10vw, 120px) 0 clamp(64px, 10vw, 128px);
    background-image: radial-gradient(color-mix(in srgb, var(--gc-surface-variant) 55%, transparent) 1.5px, transparent 1.6px);
    background-size: 28px 28px;
    background-position: center top;
}
.hero .container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 64px;
    align-items: center;
}
.hero h1 {
    font-family: var(--gc-font-pixel);
    font-size: clamp(28px, 5vw, 56px);
    line-height: 1.3;
    margin-bottom: 28px;
}
.hero h1 em { font-style: normal; color: var(--gc-primary); }
.hero .lead { margin-bottom: 40px; }
.cta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.cta .gc-button { min-height: 56px; padding: 0 28px; }
.cta-note { margin-top: 20px; font-size: 14px; color: var(--gc-on-surface-variant); }

@media (max-width: 900px) {
    .hero .container { grid-template-columns: 1fr; gap: 56px; }
    .phone { margin-inline: auto; }
}

/* ---------- Phone mock-up with a live conversation ---------- */

.phone {
    width: 300px;
    background: var(--gc-background);
    border: 3px solid var(--gc-surface-variant);
    box-shadow: 12px 12px 0 color-mix(in srgb, var(--gc-primary) 22%, transparent);
}
.phone-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
    padding: 0 16px;
    background: var(--gc-surface);
    font-family: var(--gc-font-pixel);
    font-size: 11px;
}
.phone-bar img { width: 20px; height: 20px; image-rendering: pixelated; }
.phone-bar .status { margin-left: auto; font-family: var(--gc-font-body); font-size: 12px; color: var(--gc-secondary); }
.phone .gc-chat { padding: 20px 16px; min-height: 340px; justify-content: flex-end; }
.phone .gc-bubble { font-size: 10px; max-width: 210px; }
.phone-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 16px;
}
.phone-input .gc-input { font-size: 9px; padding: 10px; }
.phone-input .gc-icon { color: var(--gc-on-surface-variant); flex: none; }

/* Messages arrive one by one; the last one dissolves like the app's self-deleting messages */
@media (prefers-reduced-motion: no-preference) {
    .phone .gc-message { animation: arrive 0.4s steps(4) both; }
    .phone .gc-message:nth-child(1) { animation-delay: 0.3s; }
    .phone .gc-message:nth-child(2) { animation-delay: 1.1s; }
    .phone .gc-message:nth-child(3) { animation-delay: 1.9s; }
    .phone .gc-message:nth-child(4) { animation-delay: 2.7s; }
    .phone .vanishing { animation: arrive 0.4s steps(4) 2.7s both, vanish 1.2s steps(6) 6.5s forwards; }
}
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
@keyframes vanish {
    to { opacity: 0; filter: blur(2px); transform: scale(0.96); }
}

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

section { padding: clamp(72px, 10vw, 120px) 0; }
.section-head { margin-bottom: 56px; }
.alt { background: var(--gc-surface); }

/* Tester invitation */
.tester { padding: clamp(48px, 7vw, 80px) 0; }
.tester .container { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.tester h2 { margin-bottom: 16px; }
.cta-note a { color: var(--gc-primary); text-underline-offset: 3px; }

@media (max-width: 760px) { .tester .container { grid-template-columns: 1fr; gap: 32px; } }

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--gc-surface-variant);
    border: 1px solid var(--gc-surface-variant);
}
.feature { background: var(--gc-background); padding: 36px 32px; }
.feature .glyph {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 24px;
    background: color-mix(in srgb, var(--gc-primary) 14%, transparent);
    color: var(--gc-primary);
    font-family: var(--gc-font-pixel);
    font-size: 14px;
}
.feature h3 { font-family: var(--gc-font-pixel); font-size: 12px; line-height: 1.6; margin-bottom: 12px; }
.feature p { margin: 0; color: var(--gc-on-surface-variant); font-size: 16px; }

@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0;
}
.steps li { border-top: 3px solid var(--gc-primary); padding-top: 28px; }
.steps li::before {
    counter-increment: step;
    content: "0" counter(step);
    display: block;
    font-family: var(--gc-font-pixel);
    font-size: 12px;
    color: var(--gc-primary);
    margin-bottom: 16px;
}
.steps h3 { font-family: var(--gc-font-pixel); font-size: 13px; line-height: 1.6; margin-bottom: 10px; }
.steps p { margin: 0; color: var(--gc-on-surface-variant); }

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

/* Privacy: two honest columns */
.privacy { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.checklist li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.checklist li::before {
    content: "";
    width: 12px;
    height: 12px;
    margin-top: 8px;
    background: var(--gc-secondary);
}
.checklist.muted li::before { background: var(--gc-on-surface-variant); }
.checklist strong { display: block; font-weight: 600; }
.checklist span { color: var(--gc-on-surface-variant); font-size: 16px; }
.privacy h3 { font-family: var(--gc-font-pixel); font-size: 12px; margin-bottom: 24px; color: var(--gc-on-surface-variant); }

@media (max-width: 760px) { .privacy { grid-template-columns: 1fr; gap: 48px; } }

/* Palette picker */
.palette-section .container { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.palettes { display: flex; flex-wrap: wrap; gap: 12px; }
.palette {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 0;
    border: 0;
    background: none;
    color: var(--gc-on-surface-variant);
    font-family: var(--gc-font-body);
    font-size: 13px;
    cursor: pointer;
}
.palette .chip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 56px;
    height: 56px;
    border: 2px solid var(--gc-surface-variant);
    outline-offset: 3px;
}
.palette .chip i:first-child { grid-row: span 2; }
.palette[aria-pressed="true"] { color: var(--gc-on-background); }
.palette[aria-pressed="true"] .chip { outline: 3px solid var(--gc-primary); }
.palette:focus-visible { outline: none; }
.palette:focus-visible .chip { outline: 3px solid var(--gc-secondary); }

@media (max-width: 900px) { .palette-section .container { grid-template-columns: 1fr; } }

/* FAQ */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--gc-surface-variant); }
.faq summary {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 0;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 18px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--gc-font-pixel); font-size: 14px; color: var(--gc-primary); }
.faq details[open] summary::after { content: "-"; }
.faq details p { margin: 0 0 24px; color: var(--gc-on-surface-variant); max-width: 62ch; }

/* Final call to action */
.final { text-align: center; }
.final img { width: 96px; height: 96px; margin: 0 auto 32px; image-rendering: pixelated; }
.final .lead { margin: 0 auto 40px; }
.final .cta { justify-content: center; }

/* Footer */
footer { border-top: 1px solid var(--gc-surface-variant); padding: 40px 0; font-size: 14px; color: var(--gc-on-surface-variant); }
footer .container { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
footer .brand { color: var(--gc-on-background); font-size: 11px; }
footer .brand img { width: 24px; height: 24px; }

/* Footer links */
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--gc-on-background); }

/* Long text pages (privacy policy) */
.doc { max-width: 760px; padding: clamp(48px, 8vw, 96px) 0; }
.doc h1 { font-family: var(--gc-font-pixel); font-size: clamp(24px, 4vw, 40px); line-height: 1.3; margin-bottom: 16px; }
.doc .updated { color: var(--gc-on-surface-variant); font-size: 15px; margin: 0 0 40px; }
.doc .intro { font-size: 19px; }
.doc h2 { font-size: clamp(16px, 2.2vw, 20px); margin: 64px 0 20px; scroll-margin-top: 96px; }
.doc h3 { font-weight: 600; font-size: 18px; margin: 32px 0 8px; }
.doc p, .doc li { color: color-mix(in srgb, var(--gc-on-background) 88%, var(--gc-background)); }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 10px; }
.doc li::marker { color: var(--gc-primary); }
.doc a { color: var(--gc-primary); text-underline-offset: 3px; }
.doc strong { color: var(--gc-on-background); font-weight: 600; }
.toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 40px 0 0;
    padding: 24px;
    background: var(--gc-surface);
    border: 1px solid var(--gc-surface-variant);
}
.toc a { color: var(--gc-on-surface-variant); text-decoration: none; font-size: 15px; }
.toc a:hover { color: var(--gc-primary); }
.faq details p a { color: var(--gc-primary); text-underline-offset: 3px; }

/* Tester page: numbered steps */
.tester-steps { list-style: none; counter-reset: step; padding: 0; margin: 48px 0 0; display: grid; gap: 20px; }
.tester-steps li {
    counter-increment: step;
    margin: 0;
    padding: 28px;
    background: var(--gc-surface);
    border: 1px solid var(--gc-surface-variant);
    border-top: 3px solid var(--gc-primary);
}
.tester-steps li::before {
    content: "0" counter(step);
    display: block;
    font-family: var(--gc-font-pixel);
    font-size: 12px;
    color: var(--gc-primary);
    margin-bottom: 12px;
}
.doc .tester-steps h2 { margin: 0 0 12px; }
.tester-steps p { margin: 0 0 20px; }
/* .doc a would otherwise paint the label in the button's own colour */
.doc a.gc-button { color: var(--gc-on-primary); text-decoration: none; }
.tester-steps .gc-button {
    min-height: 56px;
    padding: 0 28px;
    font-size: 12px;
    box-shadow: 4px 4px 0 color-mix(in srgb, var(--gc-on-background) 35%, transparent);
}
.tester-steps .gc-button::after { content: "\2192"; font-family: var(--gc-font-body); font-size: 20px; }
.tester-steps .gc-button:hover { filter: brightness(1.15); }
.tester-steps .gc-button:active { box-shadow: 2px 2px 0 color-mix(in srgb, var(--gc-on-background) 35%, transparent); }

@media (max-width: 600px) { .tester-steps .gc-button { display: flex; width: 100%; } }

/* Buttons under the privacy section */
.privacy-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 56px; }
.privacy-actions .gc-button { min-height: 52px; }
