/* ============================================
   AppStore Publisher — Shared Stylesheet
   Extracted from example.html + Section 2 additions
   ============================================ */

/* --- CSS Variables --- */
:root {
    --paper-bg: #F4F4F0;
    --ink-black: #1A1A18;
    --graphite: #A0A09A;
    --graphite-light: rgba(160, 160, 154, 0.4);
    --accent-orange: #FF6B00;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-hard: 2px 4px 10px rgba(0,0,0,0.15);
}

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

/* Modified from example.html: removed overflow:hidden, changed height to auto + min-height */
body, html {
    width: 100%;
    height: auto;
    min-height: 100vh;
    background-color: var(--paper-bg);
    background-image: radial-gradient(circle at 50% 50%, transparent 0%, rgba(0,0,0,0.02) 100%);
    font-family: 'Space Mono', monospace;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
}

/* --- SVG Filters --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
}

/* --- Workspace --- */
.workspace {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 5vh;
}

/* --- Sketch Composition --- */
.sketch-composition {
    position: relative;
    width: 800px;
    max-width: 90vw;
    height: 500px;
    z-index: 10;
}

/* --- Drafting Layer --- */
.drafting-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.draft-line {
    stroke: var(--graphite-light);
    stroke-width: 1px;
    fill: none;
}

.draft-line-dash {
    stroke: var(--graphite-light);
    stroke-width: 1px;
    stroke-dasharray: 4 4;
    fill: none;
}

.draft-accent {
    stroke: var(--accent-orange);
    stroke-width: 1px;
    fill: none;
}

/* --- Text Layer --- */
.text-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.brief-text {
    font-family: 'Reenie Beanie', cursive;
    color: var(--graphite);
    font-size: clamp(16px, 2vw, 24px);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: -10px;
    transform: rotate(-1deg);
}

.brief-text.bottom {
    margin-top: 10px;
    font-size: clamp(14px, 1.8vw, 20px);
    transform: rotate(0.5deg);
}

.marker-text {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 110px);
    line-height: 0.9;
    color: var(--ink-black);
    text-align: center;
    filter: url(#ink-bleed);
    transform: rotate(-2deg);
    position: relative;
}

.marker-word {
    display: inline-block;
}

/* --- Annotations --- */
.annotation {
    position: absolute;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--graphite);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.note-hand {
    font-family: 'Nanum Pen Script', cursive;
    font-size: 18px;
    color: var(--graphite);
    text-transform: none;
    letter-spacing: 1px;
}

/* --- Annotation Positions --- */
.note-1 { top: 20%; left: 5%; transform: rotate(-5deg); }
.note-2 { top: 15%; right: 10%; transform: rotate(3deg); }
.note-3 { bottom: 25%; left: 15%; transform: rotate(-2deg); }
.note-4 { bottom: 18%; right: 15%; transform: rotate(4deg); color: var(--accent-orange); }

/* --- Physical Tools --- */
.physical-tools {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

/* --- Mechanical Pencil --- */
.mech-pencil {
    position: absolute;
    top: -50px;
    left: 10vw;
    width: 12px;
    height: 400px;
    background: linear-gradient(to right, #e0e0e0 0%, #ffffff 30%, #a0a0a0 100%);
    border-radius: 6px;
    transform: rotate(25deg);
    box-shadow: 15px 15px 20px rgba(0,0,0,0.15), inset -2px 0 5px rgba(0,0,0,0.1);
    z-index: 21;
}
.mech-pencil::before {
    content: '';
    position: absolute;
    bottom: 60px;
    left: 0;
    width: 100%;
    height: 80px;
    background: repeating-linear-gradient(to bottom, #333, #333 2px, #222 2px, #222 4px);
    border-radius: 2px;
}
.mech-pencil::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 60px;
    background: linear-gradient(to right, #999, #ccc, #666);
    clip-path: polygon(0 0, 100% 0, 80% 80%, 55% 100%, 45% 100%, 20% 80%);
}
.mech-lead {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background: #444;
}

/* --- Black Pencil --- */
.black-pencil {
    position: absolute;
    bottom: -100px;
    left: -50px;
    width: 450px;
    height: 14px;
    background: linear-gradient(to bottom, #2a2a2a 0%, #111 50%, #2a2a2a 100%);
    transform: rotate(-35deg);
    box-shadow: 10px -10px 20px rgba(0,0,0,0.2);
    z-index: 22;
}
.black-pencil::after {
    content: '';
    position: absolute;
    right: -40px;
    top: 0;
    width: 40px;
    height: 100%;
    background: #d4b58e;
    clip-path: polygon(0 0, 0 100%, 100% 50%);
}
.black-pencil-lead {
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 4px;
    background: #222;
    clip-path: polygon(0 0, 0 100%, 100% 50%);
    z-index: 2;
}
.pencil-stripe {
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #FFB000;
}

/* --- Fineliner --- */
.fineliner {
    position: absolute;
    bottom: 32vh;
    left: 6vw;
    width: 380px;
    height: 12px;
    background: linear-gradient(to bottom, #d0d0d0 0%, #f0f0f0 40%, #a0a0a0 100%);
    border-radius: 6px;
    transform: rotate(-125deg);
    box-shadow: 10px 15px 25px rgba(0,0,0,0.15), inset 0 2px 5px rgba(255,255,255,0.3);
    z-index: 23;
}
.fineliner-cap {
    position: absolute;
    left: -30px;
    top: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(to bottom, #b0b0b0, #888);
    border-radius: 4px 0 0 4px;
}
.fineliner-tip {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 4px;
    background: #999;
}

/* --- Eraser --- */
.eraser {
    position: absolute;
    top: 15vh;
    right: 15vw;
    width: 45px;
    height: 35px;
    background: #C4C4C0;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    transform: rotate(15deg);
    box-shadow:
        inset 2px 2px 5px rgba(255,255,255,0.8),
        inset -3px -3px 8px rgba(0,0,0,0.1),
        15px 20px 20px rgba(0,0,0,0.15);
    z-index: 24;
    filter: contrast(0.9) sepia(0.1);
}

/* --- Debris --- */
.debris {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.shaving {
    position: absolute;
    background: #D8D8D4;
    border-radius: 50%;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}


/* ============================================
   Section 2: Pipeline
   ============================================ */

/* --- Section Wrappers --- */
.section-hero {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.section-pipeline {
    width: 100%;
    min-height: auto;
    position: relative;
    padding: 80px 0;
    background-color: transparent;
}

.section-pipeline > .drafting-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.section-pipeline .section-title,
.section-pipeline .pipeline-grid,
.section-pipeline .pipeline-flow,
.section-pipeline .annotation {
    position: relative;
    z-index: 2;
}

/* --- Section Title --- */
.section-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 48px;
    color: var(--ink-black);
    text-align: center;
    filter: url(#ink-bleed);
    margin-bottom: 60px;
}

/* --- Pipeline Grid --- */
.pipeline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .pipeline-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 20px;
    }

    /* Hide physical tools on small screens */
    .physical-tools {
        display: none;
    }

    /* Scale sketch composition */
    .sketch-composition {
        height: auto;
        min-height: 300px;
    }

    /* Scale annotations */
    .annotation {
        font-size: 8px;
    }
    .note-hand {
        font-size: 14px;
    }

    /* Adjust sticky note */
    .sticky-note {
        max-width: 90vw;
    }
    .sticky-note .command {
        font-size: 11px;
    }
}

@media (max-width: 1200px) {
    /* Scale down physical tools on medium screens */
    .physical-tools {
        transform: scale(0.8);
        transform-origin: center center;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    /* Prevent tools from overlapping content */
    .eraser {
        right: 5vw !important;
        top: 8vh !important;
    }
    .fineliner {
        left: 3vw !important;
        bottom: 20vh !important;
        width: 300px !important;
    }
}

/* --- Pipeline Card --- */
.pipeline-card {
    background: transparent;
    padding: 24px;
    position: relative;
}

.pipeline-card .card-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.pipeline-card .card-border path {
    vector-effect: non-scaling-stroke;
}

.pipeline-card .card-content {
    position: relative;
    z-index: 2;
}

.pipeline-card p {
    font-family: 'Nanum Pen Script', cursive;
    font-size: 18px;
    color: var(--graphite);
    line-height: 1.4;
}

.pipeline-card .stage-number {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.pipeline-card .stage-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 28px;
    color: var(--ink-black);
    margin-bottom: 8px;
}

.pipeline-card .stage-desc {
    font-family: 'Nanum Pen Script', cursive;
    font-size: 18px;
    color: var(--graphite);
    line-height: 1.4;
}


/* ============================================
   Sticky Note
   ============================================ */

.sticky-note {
    background: #fff;
    padding: 16px 20px;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.1);
    transform: rotate(1.5deg);
    position: relative;
    max-width: 380px;
    margin: 10px auto 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 15;
}
.sticky-note:hover {
    transform: rotate(0.5deg) scale(1.02);
}
.sticky-note .tape {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 60px;
    height: 16px;
    background: rgba(200,200,180,0.5);
    border-radius: 2px;
}
.sticky-note .label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--graphite);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.sticky-note .command {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: var(--ink-black);
}
.sticky-note .hint {
    font-family: 'Nanum Pen Script', cursive;
    font-size: 16px;
    color: var(--graphite);
    margin-top: 8px;
}
.sticky-note .copied {
    font-family: 'Nanum Pen Script', cursive;
    font-size: 16px;
    color: var(--accent-orange);
    opacity: 0;
    transition: opacity 0.3s;
}
.sticky-note .copied.show {
    opacity: 1;
}


/* ============================================
   Scroll Animations
   ============================================ */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ============================================
   Site Navigation
   ============================================ */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(244, 244, 240, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.nav-brand {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink-black);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--graphite);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.2s;
}

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

.nav-github {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.4rem;
    color: var(--ink-black);
    font-family: 'Space Mono', monospace;
    line-height: 1;
}

/* ============================================
   Footer
   ============================================ */

footer {
    margin: 0;
    padding: 2rem 4rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--graphite);
    border-top: 1px solid var(--graphite-light);
}

footer a {
    color: var(--graphite);
    text-decoration: none;
    transition: color 0.2s;
}

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

.footer-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}


/* ============================================
   Screen Reader Only (GEO crawlable text)
   ============================================ */

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

/* ============================================
   Comparison Section
   ============================================ */

.section-comparison {
    width: 100%;
    position: relative;
    padding: 60px 0;
}

.comparison-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
}

.comparison-table th {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 20px;
    color: var(--ink-black);
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--graphite-light);
}

.comparison-table td {
    padding: 10px 16px;
    color: var(--graphite);
    border-bottom: 1px solid var(--graphite-light);
}

.comparison-table td:first-child {
    font-family: 'Nanum Pen Script', cursive;
    font-size: 18px;
    color: var(--ink-black);
}

.comparison-table td:last-child {
    color: var(--accent-orange);
    font-weight: 700;
}

@media (max-width: 768px) {
    .comparison-content {
        padding: 0 20px;
    }
    .comparison-table {
        font-size: 11px;
    }
    .comparison-table th {
        font-size: 16px;
    }
}

/* ============================================
   Semantic Heading Resets
   ============================================ */

h1.brief-text,
h2.marker-text,
h3 {
    font-weight: inherit;
    margin: 0;
}

h1.brief-text {
    font-family: 'Reenie Beanie', cursive;
    font-size: 24px;
}

h2.marker-text {
    font-family: 'Caveat', cursive;
    font-weight: 700;
}

.pipeline-card h3 {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 28px;
    color: var(--ink-black);
    margin-bottom: 8px;
}


/* ============================================
   FAQ Section
   ============================================ */

.section-faq {
    width: 100%;
    position: relative;
    padding: 80px 0;
    background-color: transparent;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
}

.faq-item {
    background: transparent;
    margin-bottom: 16px;
    padding: 0;
    border-bottom: 1px solid var(--graphite-light);
}

.faq-item summary {
    padding: 20px 24px;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: '+';
    font-family: 'Space Mono', monospace;
    font-size: 18px;
    color: var(--accent-orange);
    margin-right: 12px;
}

.faq-item[open] summary::before {
    content: '\2212';
}

.faq-item summary h3 {
    display: inline;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 24px;
    color: var(--ink-black);
}

.faq-item p {
    padding: 0 24px 20px;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--graphite);
}

.faq-item code {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    background: var(--paper-bg);
    padding: 2px 6px;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .faq-list {
        padding: 0 20px;
    }

    /* Mobile nav — must come after global .nav-links */
    .nav-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(244, 244, 240, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 1rem 2rem;
        gap: 1rem;
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }
    .nav-links.open {
        display: flex;
    }

    /* Mobile footer */
    footer {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}
