/* ============================================================
   SDPF — Shared Stylesheet
   Software Development Prompting Framework
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500;600&family=Playfair+Display:wght@700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-glow: rgba(37,99,235,0.12);
    --sky: #0ea5e9;
    --sky-light: #7dd3fc;

    --surface-0: #0c1222;
    --surface-1: #111a2e;
    --surface-2: #182342;
    --surface-3: #1e2d52;
    --surface-border: rgba(255,255,255,0.06);

    --text-primary: #e8edf5;
    --text-secondary: #8b98b5;
    --text-muted: #5a6a8a;
    --text-accent: #7dd3fc;

    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px var(--surface-border);
    --shadow-elevated: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px var(--surface-border);
    --shadow-glow: 0 0 40px rgba(37,99,235,0.15);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--surface-0);
    color: var(--text-primary);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection {
    background: var(--primary);
    color: white;
}

img { max-width: 100%; display: block; }
a { color: var(--sky-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--sky); }

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ============================================================
   Navigation
   ============================================================ */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(12,18,34,0.8);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--surface-border);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 68px;
}

.logo {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.02em;
}

.logo-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 6px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--surface-2);
}

.nav-links a.active {
    color: var(--sky-light);
    background: rgba(14,165,233,0.1);
}

/* Mobile hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.nav-toggle:hover { background: var(--surface-2); }

.nav-toggle svg { display: block; }

@media (max-width: 860px) {
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 68px;
        left: 0; right: 0;
        background: var(--surface-1);
        border-bottom: 1px solid var(--surface-border);
        flex-direction: column;
        padding: 12px 16px;
        gap: 2px;
    }

    .nav-links.open { display: flex; }

    .nav-links a {
        display: block;
        padding: 12px 16px;
        font-size: 15px;
        border-radius: var(--radius-sm);
    }
}

/* ============================================================
   Hero (index page)
   ============================================================ */
.hero {
    padding: 160px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(ellipse, rgba(37,99,235,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(14,165,233,0.1);
    color: var(--sky-light);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
    margin-bottom: 28px;
    border: 1px solid rgba(14,165,233,0.15);
    letter-spacing: 0.02em;
}

.hero-badge .dot {
    width: 6px; height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.hero h1 .accent {
    background: linear-gradient(135deg, var(--sky-light), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 44px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-body);
    text-decoration: none;
    transition: all 0.25s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--sky) 100%);
    color: white;
    box-shadow: 0 2px 16px rgba(37,99,235,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(37,99,235,0.4);
    color: white;
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
}

.btn-secondary:hover {
    border-color: var(--primary-light);
    color: var(--sky-light);
    background: var(--surface-3);
}

/* Problem callout */
.problem-callout {
    max-width: 740px;
    margin: 56px auto 0;
    padding: 28px 32px;
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--warning);
    text-align: left;
}

.problem-callout .label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--warning);
    margin-bottom: 10px;
    font-family: var(--font-mono);
}

.problem-callout p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.7;
}

/* ============================================================
   Page Header (about, contact)
   ============================================================ */
.page-header {
    padding: 150px 0 64px;
    text-align: center;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -100px; left: 50%;
    transform: translateX(-50%);
    width: 700px; height: 700px;
    background: radial-gradient(ellipse, rgba(37,99,235,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 540px;
    margin: 0 auto;
}

/* ============================================================
   Sections
   ============================================================ */
section {
    padding: 88px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--text-primary);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.section-header p {
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    font-size: 1rem;
}

/* ============================================================
   Principles Grid
   ============================================================ */
.principles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.principle-card {
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.principle-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.principle-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.principle-card.p1::before { background: linear-gradient(90deg, var(--primary-light), var(--sky)); }
.principle-card.p2::before { background: linear-gradient(90deg, var(--success), #6ee7b7); }
.principle-card.p3::before { background: linear-gradient(90deg, #a78bfa, #818cf8); }

.principle-number {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-family: var(--font-mono);
}

.principle-card h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 700;
}

.principle-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.65;
}

/* ============================================================
   Key Terms
   ============================================================ */
.terms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.term-card {
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: border-color 0.2s;
}

.term-card:hover { border-color: rgba(37,99,235,0.3); }

.term-card dt {
    font-weight: 600;
    color: var(--sky-light);
    font-family: var(--font-mono);
    font-size: 13px;
    margin-bottom: 8px;
}

.term-card dd {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

/* ============================================================
   Lifecycle
   ============================================================ */
.lifecycle-section {
    background: var(--surface-1);
    border-top: 1px solid var(--surface-border);
    border-bottom: 1px solid var(--surface-border);
}

.lifecycle-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.phase {
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--surface-border);
}

.phase-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-family: var(--font-mono);
}

.phase h3 {
    font-size: 1.35rem;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.phase-steps {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 32px; height: 32px;
    background: var(--surface-3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--sky-light);
    font-family: var(--font-mono);
    border: 1px solid var(--surface-border);
}

.step-content { flex: 1; }
.step-content strong {
    display: block;
    margin-bottom: 3px;
    color: var(--text-primary);
    font-weight: 600;
}

.step-content span {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ============================================================
   Styles Grid (17 styles)
   ============================================================ */
.styles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.style-card {
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 22px;
    transition: all 0.25s;
}

.style-card:hover {
    border-color: rgba(37,99,235,0.35);
    box-shadow: 0 0 20px rgba(37,99,235,0.08);
    transform: translateY(-2px);
}

.style-card .id {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--sky-light);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.style-card h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 600;
}

.style-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ============================================================
   Version Table
   ============================================================ */
.version-table {
    width: 100%;
    background: var(--surface-1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--surface-border);
}

.version-table table {
    width: 100%;
    border-collapse: collapse;
}

.version-table th {
    background: var(--surface-2);
    color: var(--text-secondary);
    padding: 16px 24px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-mono);
}

.version-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--surface-border);
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.version-table tr:last-child td { border-bottom: none; }

.version-table .version {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--sky-light);
}

.version-table .tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.tag-breaking { background: rgba(248,113,113,0.15); color: var(--danger); }
.tag-minor { background: rgba(59,130,246,0.12); color: var(--primary-light); }

/* ============================================================
   Citation
   ============================================================ */
.citation {
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 28px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================================
   Content Cards (about page)
   ============================================================ */
.content-card {
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 28px;
}

.content-card h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--surface-border);
}

.content-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.75;
}

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

.quote {
    background: var(--surface-2);
    border-left: 3px solid var(--primary-light);
    padding: 24px 28px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 24px 0;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.75;
}

.quote cite {
    display: block;
    margin-top: 14px;
    font-style: normal;
    font-weight: 600;
    color: var(--sky-light);
    font-size: 13px;
    font-family: var(--font-mono);
}

.feature-list {
    list-style: none;
    margin: 20px 0;
}

.feature-list li {
    padding: 14px 0 14px 36px;
    position: relative;
    border-bottom: 1px solid var(--surface-border);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.feature-list li:last-child { border-bottom: none; }

.feature-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 22px; height: 22px;
    background: rgba(14,165,233,0.12);
    border-radius: 50%;
}

.feature-list li::after {
    content: '✓';
    position: absolute;
    left: 5px; top: 50%;
    transform: translateY(-50%);
    color: var(--sky);
    font-size: 12px;
    font-weight: 700;
}

.feature-list li strong { color: var(--text-primary); }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 24px 0;
}

.stat {
    text-align: center;
    padding: 28px;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, var(--sky-light), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

/* ============================================================
   Contact Page
   ============================================================ */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
}

.contact-form {
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.contact-form h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 28px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 15px;
    transition: all 0.2s;
    background: var(--surface-2);
    color: var(--text-primary);
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group select option {
    background: var(--surface-1);
    color: var(--text-primary);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.info-card:hover { border-color: rgba(37,99,235,0.25); }

.info-card h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.info-card .icon {
    width: 36px; height: 36px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sky-light);
    flex-shrink: 0;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
}

.info-card a {
    color: var(--sky-light);
}

.social-links {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.social-link {
    width: 40px; height: 40px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.25s;
    text-decoration: none;
    border: 1px solid var(--surface-border);
}

.social-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.response-time {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-top: 20px;
    border: 1px solid rgba(52,211,153,0.15);
}

.response-time .label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--success);
    margin-bottom: 2px;
    font-family: var(--font-mono);
}

.response-time .value {
    color: var(--success);
    font-weight: 600;
    font-size: 0.95rem;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
    background: var(--surface-1);
    border-top: 1px solid var(--surface-border);
    padding: 48px 0;
    margin-top: 80px;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer .copyright {
    color: var(--text-muted);
    font-size: 13px;
}

footer .tagline {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-mono);
    letter-spacing: 0.01em;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
    .hero h1 { font-size: 2.2rem; }
    .principles-grid { grid-template-columns: 1fr; }
    .terms-grid { grid-template-columns: 1fr; }
    .lifecycle-wrapper { grid-template-columns: 1fr; }
    .styles-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    footer .container { flex-direction: column; gap: 14px; text-align: center; }
    .content-card { padding: 28px; }
    .contact-form { padding: 28px; }
    .version-table { overflow-x: auto; }
}

@media (max-width: 480px) {
    .styles-grid { grid-template-columns: 1fr; }
    .hero { padding: 130px 0 70px; }
}
