:root {
    --blue: #007aff;
    --text: #1d1d1f;
    --secondary: #6e6e73;
    --background: #ffffff;
    --separator: #d2d2d7;
    color-scheme: light;
}

/* Dark when the device is dark, unless the visitor picked light; or when they picked dark. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --blue: #0a84ff;
        --text: #f5f5f7;
        --secondary: #a1a1a6;
        --background: #000000;
        --separator: #38383a;
        color-scheme: dark;
    }
    :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
}
:root[data-theme="dark"] {
    --blue: #0a84ff;
    --text: #f5f5f7;
    --secondary: #a1a1a6;
    --background: #000000;
    --separator: #38383a;
    color-scheme: dark;
}
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }

* { box-sizing: border-box; }

body {
    margin: 0;
    transition: background-color 0.35s ease, color 0.35s ease;
    background: var(--background);
    color: var(--text);
    font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

header, main, footer {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

header {
    padding-top: 20px;
    padding-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--secondary);
    cursor: pointer;
}
.theme-toggle:hover { color: var(--text); background: var(--separator); }
.theme-toggle .sun { display: none; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 19px;
}
.brand:hover { text-decoration: none; }

main { flex: 1; padding-bottom: 64px; }

h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; margin: 32px 0 8px; }
h2 { font-size: 22px; margin: 36px 0 8px; }
h3 { font-size: 17px; margin: 24px 0 4px; }
p, li { color: var(--text); }
ul { padding-left: 1.2em; }
li { margin: 6px 0; }

.lead { font-size: 20px; color: var(--secondary); }
.updated { color: var(--secondary); font-size: 15px; margin-top: 0; }

.button {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 980px;
}
.button:hover { text-decoration: none; opacity: 0.9; }

/* Landing */
.home main { display: flex; align-items: center; justify-content: center; }
.hero { width: 100%; text-align: center; padding: 48px 0; }
.hero-logo { position: relative; width: 120px; height: 120px; margin: 0 auto 24px; }
.hero-logo img { display: block; position: relative; }
.hero h1 { font-size: 52px; margin-top: 0; }
.hero .lead { max-width: 520px; margin: 16px auto 32px; }
.badge {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 980px;
}

/* Screenshots */
.screens {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 28px;
    margin: 8px 0 72px;
}
.screens figure { margin: 0; flex: 0 0 auto; text-align: center; }
.screens img {
    display: block;
    width: 200px;
    height: auto;
    border-radius: 30px;
    border: 7px solid #1c1c1e;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.screens .main img { width: 240px; border-radius: 36px; }
.screens figcaption { margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--secondary); }

@media (max-width: 760px) {
    /* A row to swipe through, the chat first in view. */
    .screens {
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 0 24px 24px;
        margin: 0 -24px 48px;
        width: auto;
        align-self: stretch;
    }
    .screens figure { scroll-snap-align: center; }
    .screens .main { order: -1; }
    .screens img, .screens .main img { width: 220px; border-radius: 32px; }
}

/* Ne konuşuluyor? (filled in by web/worker.js) */
.home main { flex-direction: column; }
.topics { width: 100%; padding-bottom: 32px; }
.topics h2 { font-size: 28px; margin: 0 0 16px; }
.topics ol { list-style: none; padding: 0; margin: 0; counter-reset: topic; }
.topics li {
    counter-increment: topic;
    position: relative;
    padding: 16px 0 16px 44px;
    border-top: 1px solid var(--separator);
}
.topics li::before {
    content: counter(topic);
    position: absolute;
    left: 0;
    top: 16px;
    width: 28px;
    color: var(--blue);
    font-weight: 700;
    font-size: 20px;
    text-align: right;
}
.topics h3 { margin: 0 0 4px; font-size: 18px; }
.topics p { margin: 0 0 6px; color: var(--secondary); font-size: 15px; }
.topics .stats { color: var(--secondary); font-size: 13px; }

footer {
    border-top: 1px solid var(--separator);
    padding-top: 20px;
    padding-bottom: 32px;
    font-size: 14px;
    color: var(--secondary);
}
footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 8px; }
footer nav a { color: var(--secondary); }
footer p { color: var(--secondary); margin: 4px 0; }

@media (max-width: 600px) {
    h1 { font-size: 32px; }
    .hero h1 { font-size: 38px; }
}

/* Motion: short, once, Apple's ease-out. Only with .motion (set by theme.js unless the visitor
   prefers reduced motion), so without scripts everything is just there. */
:root { --ease: cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
@keyframes ripple {
    from { opacity: 0.45; transform: scale(0.7); }
    to { opacity: 0; transform: scale(1.9); }
}

.motion .hero > * { animation: rise 0.9s var(--ease) both; }
.motion .hero > :nth-child(2) { animation-delay: 0.08s; }
.motion .hero > :nth-child(3) { animation-delay: 0.16s; }
.motion .hero > :nth-child(4) { animation-delay: 0.24s; }

/* One soft pulse out of the logo as the page opens. */
.motion .hero-logo::before,
.motion .hero-logo::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--blue);
    opacity: 0;
    animation: ripple 1.6s var(--ease) 0.35s both;
}
.motion .hero-logo::after { animation-delay: 0.7s; }

.motion .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    transition-delay: var(--delay, 0ms);
}
.motion .reveal.shown { opacity: 1; transform: none; }

/* A small lift under the pointer, for screenshots on devices that hover. */
@media (hover: hover) {
    .screens img { transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
    .screens figure:hover img { transform: translateY(-6px); box-shadow: 0 32px 70px rgba(0, 0, 0, 0.3); }
}

@media (prefers-reduced-motion: reduce) {
    body { transition: none; }
}
