/* ==========================================================================
   Writer Studio — Landing Page
   Editorial / literary aesthetic — warm paper, careful type, no SaaS clichés
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom properties
   -------------------------------------------------------------------------- */

:root {
    --paper: #EFE4CF;
    --paper-deep: #E5D9C3;
    --ink: #1C1917;
    --accent: #9B4D2B;
    --accent-hover: #7F3E22;
    --muted: #7A6E60;
    --rule: #CFC3B0;

    --font-serif: 'Spectral', Georgia, 'Times New Roman', serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    --measure: 36em;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */

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

html {
    font-size: 19px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-serif);
    font-weight: 300;
    line-height: 1.82;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(155, 77, 43, 0.14);
    color: var(--ink);
}

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

/* --------------------------------------------------------------------------
   Paper grain overlay
   -------------------------------------------------------------------------- */

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.028;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */

.skip-to-content {
    position: absolute;
    top: 0;
    left: 16px;
    z-index: 10000;
    padding: 10px 18px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--paper);
    background: var(--ink);
    border-radius: 0 0 4px 4px;
    transform: translateY(-120%);
    transition: transform 0.2s ease;
}

.skip-to-content:focus {
    transform: translateY(0);
    color: var(--paper);
}

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

*:focus:not(:focus-visible) {
    outline: none;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

main {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 2rem;
}

/* --------------------------------------------------------------------------
   Header — social links + language toggle
   -------------------------------------------------------------------------- */

.site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    z-index: 10;
}

.header-social {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.header-social a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.header-social a:hover {
    color: var(--ink);
}

.header-social svg {
    width: 15px;
    height: 15px;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.lang-active {
    color: var(--ink);
}

.lang-link {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.lang-link:hover {
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   Title page — full viewport, centered
   -------------------------------------------------------------------------- */

.title-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 5rem 0 3rem;
}

.title-page h1 {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 3.2rem;
    letter-spacing: 0.015em;
    line-height: 1.12;
    color: var(--ink);
}

.tagline {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 300;
    font-size: 1.15rem;
    color: var(--muted);
    margin-top: 1rem;
    letter-spacing: 0.005em;
}

/* Platform line */
.platforms-line {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    margin-top: 1.2rem;
}

/* Platform download links */
.platforms-line a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.platforms-line a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.platforms-line .dot {
    margin: 0 0.4em;
    color: var(--rule);
}

/* Alpha notice */
.alpha-notice {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    line-height: 1.6;
    color: var(--ink);
    margin-top: 1.5rem;
    padding: 0.8rem 1.4rem;
    border: 1px solid var(--accent);
    border-radius: 2px;
    max-width: 28rem;
    text-align: center;
}

/* Blinking text cursor */
.cursor {
    display: block;
    width: 1.5px;
    height: 1.4rem;
    background: var(--accent);
    margin-top: 1.5rem;
    animation: blink 1.1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    45% { opacity: 1; }
    50% { opacity: 0; }
    95% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   Dividers — typographic section breaks
   -------------------------------------------------------------------------- */

.divider {
    border: none;
    text-align: center;
    margin: 2.5rem auto;
    max-width: var(--measure);
    color: var(--rule);
    font-size: 0.85rem;
    letter-spacing: 0.6em;
    line-height: 1;
}

.divider::before {
    content: '· · ·';
}

/* --------------------------------------------------------------------------
   Prose sections
   -------------------------------------------------------------------------- */

.prose {
    margin-bottom: 1rem;
}

.prose p {
    font-size: 1.05rem;
    margin-bottom: 1.6rem;
    text-indent: 0;
}

.prose p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Concept blocks
   -------------------------------------------------------------------------- */

.concepts {
    padding-bottom: 1rem;
}

.concept {
    margin-bottom: 2.5rem;
}

.concept:last-child {
    margin-bottom: 0;
}

.concept h2 {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: 0.8rem;
    line-height: 1;
}

.concept p {
    font-size: 1.05rem;
    line-height: 1.82;
}

/* --------------------------------------------------------------------------
   Social links
   -------------------------------------------------------------------------- */

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.4rem;
    margin-bottom: 1.2rem;
}

.social-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.social-links a:hover {
    color: var(--ink);
}

.social-links svg {
    width: 17px;
    height: 17px;
}

/* --------------------------------------------------------------------------
   Colophon (footer)
   -------------------------------------------------------------------------- */

.colophon {
    text-align: center;
    padding: 2.5rem 2rem 3.5rem;
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.colophon-meta {
    margin-bottom: 0.4rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   Scroll reveal animation
   -------------------------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger concepts slightly */
.concept.reveal:nth-child(2) { transition-delay: 0.08s; }
.concept.reveal:nth-child(3) { transition-delay: 0.16s; }
.concept.reveal:nth-child(4) { transition-delay: 0.24s; }
.concept.reveal:nth-child(5) { transition-delay: 0.32s; }

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

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .cursor {
        animation: none;
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
    html {
        font-size: 17px;
    }

    main {
        padding: 0 1.5rem;
    }

    .title-page h1 {
        font-size: 2.4rem;
    }

    .tagline {
        font-size: 1.05rem;
    }

    .divider {
        margin: 2rem auto;
    }

    .concept {
        margin-bottom: 2.8rem;
    }

    .site-header {
        padding: 1rem 1.5rem;
    }

    .header-social svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 380px) {
    .title-page h1 {
        font-size: 2rem;
    }
}

/* --------------------------------------------------------------------------
   Privacy page (preserved from existing design, adapted to new theme)
   -------------------------------------------------------------------------- */

.privacy-page {
    padding: 5rem 2rem 6rem;
}

.privacy-page h1 {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--ink);
}

.privacy-page .last-updated {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 2.5rem;
}

.privacy-page h2 {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-top: 2.5rem;
    margin-bottom: 0.8rem;
}

.privacy-page p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--ink);
    margin-bottom: 0.8rem;
    max-width: var(--measure);
}

.privacy-page ul {
    list-style: none;
    padding: 0;
    margin-bottom: 0.8rem;
    max-width: var(--measure);
}

.privacy-page ul li {
    position: relative;
    padding-left: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--ink);
    margin-bottom: 0.25rem;
}

.privacy-page ul li::before {
    content: '\2014';
    position: absolute;
    left: 0;
    color: var(--rule);
}

.privacy-page a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1px;
    transition: border-color 0.3s ease;
}

.privacy-page a:hover {
    border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Download CTA section
   -------------------------------------------------------------------------- */

.download-cta {
    text-align: center;
    padding: 2rem 0 5rem;
}

.download-intro {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
    margin-bottom: 2rem;
}

.download-btn {
    display: inline-block;
    padding: 0.85rem 2.4rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--paper);
    background: var(--ink);
    border: 1px solid var(--ink);
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease;
}

.download-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--paper);
}

.download-cta .release-link {
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.download-cta .release-link a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.download-cta .release-link a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Download page
   -------------------------------------------------------------------------- */

.download-page {
    padding: 5rem 2rem 3rem;
}

.download-page h1 {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--ink);
}

.download-subtitle {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 2rem;
}

.download-page .alpha-notice {
    max-width: var(--measure);
    margin-bottom: 3rem;
}

.platform-card {
    max-width: var(--measure);
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--rule);
}

.platform-card:last-of-type {
    border-bottom: none;
    padding-bottom: 1rem;
}

.platform-card h2 {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: 0.6rem;
    line-height: 1;
}

.platform-meta {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 1.2rem;
}

.platform-downloads {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    max-width: 20rem;
}

.platform-download {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--paper);
    background: var(--ink);
    border: 1px solid var(--ink);
    text-decoration: none;
    text-align: center;
    transition: background 0.3s ease;
}

.platform-download:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--paper);
}

.platform-download-alt {
    background: transparent;
    color: var(--ink);
}

.platform-download-alt:hover {
    background: var(--accent);
    color: var(--paper);
}

.install-steps {
    margin: 1.5rem 0;
}

.install-steps h3 {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink);
    margin-bottom: 0.6rem;
    margin-top: 1.2rem;
}

.install-steps h3:first-child {
    margin-top: 0;
}

.install-steps ol {
    list-style: none;
    padding: 0;
    counter-reset: step;
}

.install-steps ol li {
    position: relative;
    padding-left: 1.8rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--ink);
    margin-bottom: 0.3rem;
    counter-increment: step;
}

.install-steps ol li::before {
    content: counter(step) '.';
    position: absolute;
    left: 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
}

.install-steps code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent);
    background: rgba(155, 77, 43, 0.06);
    padding: 0.1rem 0.35rem;
    border-radius: 2px;
}

.platform-notice {
    font-family: var(--font-serif);
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--ink);
    padding: 0.8rem 1.2rem;
    border-left: 2px solid var(--accent);
    margin-top: 1.2rem;
}

.platform-notice strong {
    font-weight: 500;
}

.platform-notice code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    background: rgba(155, 77, 43, 0.06);
    padding: 0.1rem 0.35rem;
    border-radius: 2px;
}

.install-steps-list {
    list-style: none;
    padding: 0;
    counter-reset: step;
}

.install-steps-list li {
    position: relative;
    padding-left: 1.8rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--ink);
    margin-bottom: 0.3rem;
    counter-increment: step;
}

.install-steps-list li::before {
    content: counter(step) '.';
    position: absolute;
    left: 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
}

.requirements-list {
    list-style: none;
    padding: 0;
}

.requirements-list li {
    position: relative;
    padding-left: 1.2rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--ink);
    margin-bottom: 0.2rem;
}

.requirements-list li::before {
    content: '\2014';
    position: absolute;
    left: 0;
    color: var(--rule);
}

.platform-more {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
}

.platform-more a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.platform-more a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.checksums-section {
    text-align: center;
    padding: 1rem 0 4rem;
}

.checksums-section p {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.checksums-section a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.checksums-section a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 640px) {
    .download-page {
        padding: 3.5rem 1.5rem 2rem;
    }

    .platform-downloads {
        max-width: none;
    }
}

/* --------------------------------------------------------------------------
   Utility: visually-hidden (for screen readers)
   -------------------------------------------------------------------------- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
