/* Smile Again - shared styles for all topic pages */

/* Font definitions */
@font-face {
    font-display: swap;
    font-family: "flowtext";
    font-style: normal;
    font-weight: normal;
    src:
        url("../fonts/poppins-western.woff2") format("woff2"),
        url("../fonts/poppins-western.woff") format("woff");
}

@font-face {
    font-display: swap;
    font-family: "flowtext";
    font-style: normal;
    font-weight: bold;
    src:
        url("../fonts/poppins-western-bold.woff2") format("woff2"),
        url("../fonts/poppins-western-bold.woff") format("woff");
}

/* Modern Design System - matching main site */
:root {
    --spirit: #8b5cf6;
    --energy: #10b981;
    --wisdom: #06b6d4;
    --earth: #ef4444;
    --cosmos: #1e293b;
    --light: #ffffff;
    --mist: #f8fafc;
    --shadow: #64748b;
    --text: #1e293b;
    --text-soft: #475569;
    --border-light: #e2e8f0;
    
    --gradient-spirit: linear-gradient(135deg, var(--spirit) 0%, var(--energy) 100%);
    --gradient-cosmos: linear-gradient(135deg, var(--cosmos) 0%, var(--wisdom) 100%);
    --gradient-earth: linear-gradient(135deg, var(--earth) 0%, var(--energy) 100%);
    
    --shadow-sm: 0 1px 2px rgba(30, 41, 59, 0.04);
    --shadow-md: 0 4px 12px rgba(30, 41, 59, 0.08);
    --shadow-lg: 0 8px 24px rgba(30, 41, 59, 0.12);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.2);
    
    --space: clamp(1rem, 2vw, 1.5rem);
    --gap: calc(var(--space) * 1.5);
    --section-padding: clamp(3rem, 8vw, 6rem);
    
    --text-base: clamp(1rem, 1rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1.125rem + 0.5vw, 1.375rem);
    --text-xl: clamp(1.5rem, 1.5rem + 1vw, 2rem);
    --text-2xl: clamp(2rem, 2rem + 1.5vw, 3rem);
    --text-3xl: clamp(2.5rem, 2.5rem + 2vw, 4rem);
    
    --max-width: 64rem;
    --content-width: 44rem;
    --reading-width: 38rem;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    
    --logo-light: url('data:image/svg+xml,<%3Fxml version="1.0" encoding="UTF-8"%3F><svg width="48" height="48" viewBox="0 0 570.2 487.14" version="1.1" xmlns="http://www.w3.org/2000/svg"><path style="fill:%237c3aed;" d="m-146 47.439m683.5 121.4c-18.6 0-33.7 15.1-33.7 33.7 0 119.8-97.4 217.2-217.2 217.2s-217.2-97.4-217.2-217.2c0-18.6-15.1-33.7-33.7-33.7s-33.7 15.1-33.7 33.7c0 157 127.6 284.6 284.6 284.6s284.6-127.6 284.6-284.6c0-18.6-15-33.7-33.7-33.7zm-303.1-119.9c0 27.1-21.9 49-48.9 49s-48.9-21.9-48.9-49c0-27 21.9-48.9 48.9-48.9s48.9 21.9 48.9 48.9zm177.4-42.6c23.5 13.2 31.8 43.1 18.6 66.6-13.2 23.5-43.1 31.9-66.6 18.7-23.6-13.3-31.9-43.1-18.7-66.7 13.2-23.6 43.1-31.9 66.7-18.6z"/></svg>');
    --logo-dark: url('data:image/svg+xml,<%3Fxml version="1.0" encoding="UTF-8"%3F><svg width="48" height="48" viewBox="0 0 570.2 487.14" version="1.1" xmlns="http://www.w3.org/2000/svg"><path style="fill:%23c4b5fd;" d="m-146 47.439m683.5 121.4c-18.6 0-33.7 15.1-33.7 33.7 0 119.8-97.4 217.2-217.2 217.2s-217.2-97.4-217.2-217.2c0-18.6-15.1-33.7-33.7-33.7s-33.7 15.1-33.7 33.7c0 157 127.6 284.6 284.6 284.6s284.6-127.6 284.6-284.6c0-18.6-15-33.7-33.7-33.7zm-303.1-119.9c0 27.1-21.9 49-48.9 49s-48.9-21.9-48.9-49c0-27 21.9-48.9 48.9-48.9s48.9 21.9 48.9 48.9zm177.4-42.6c23.5 13.2 31.8 43.1 18.6 66.6-13.2 23.5-43.1 31.9-66.6 18.7-23.6-13.3-31.9-43.1-18.7-66.7 13.2-23.6 43.1-31.9 66.7-18.6z"/></svg>');
    --logo: var(--logo-light);
}

@media (prefers-color-scheme: dark) {
    :root {
        --light: #0f172a;
        --mist: #1e293b;
        --text: #f1f5f9;
        --text-soft: #cbd5e1;
        --border-light: #334155;
        --spirit: #c4b5fd;
        --wisdom: #22d3ee;
        --energy: #34d399;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
        --shadow-glow: 0 0 40px rgba(196, 181, 253, 0.3);
        --logo: var(--logo-dark);
    }
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: flowtext, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text);
    background: var(--light);
    background-image: 
        radial-gradient(ellipse at top, rgba(139, 92, 246, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(16, 185, 129, 0.02) 0%, transparent 50%);
    overflow-x: hidden;
    position: relative;
    opacity: 0;
    animation: body-fade-in 0.6s ease-out 0.1s forwards;
}

@keyframes body-fade-in {
    to { opacity: 1; }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.02) 0%, transparent 60%);
    animation: energy-flow 30s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes energy-flow {
    0%, 100% { transform: scale(1) rotate(0deg); }
    33% { transform: scale(1.1) rotate(120deg); }
    66% { transform: scale(0.9) rotate(-120deg); }
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
    z-index: 1000;
    transition: var(--transition);
}

@media (prefers-color-scheme: dark) {
    header {
        background: rgba(15, 23, 42, 0.95);
        border-bottom-color: rgba(167, 139, 250, 0.2);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

header > div {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem var(--gap);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header > div > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

header h1 {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
    margin: 0;
    text-decoration: none;
}

header h1::before {
    content: '';
    width: 2.5rem;
    height: 2.5rem;
    background: var(--logo) no-repeat center;
    background-size: contain;
    display: block;
    animation: pulse 4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

header p {
    font-size: 0.875rem;
    color: var(--text-soft);
    margin: 0;
    padding-left: 3.25rem;
    white-space: nowrap;
}

header a {
    color: inherit;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 0.5rem;
}

nav a {
    padding: 0.5rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
}

nav a::before {
    content: '';
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 0.25rem;
    height: 2px;
    border-radius: 2px;
    background: var(--spirit);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

nav a:hover,
nav a:focus-visible {
    color: var(--spirit);
    text-decoration: none;
}

nav a:hover::before,
nav a:focus-visible::before {
    transform: scaleX(1);
}

/* Main content */
main {
    margin-top: 4rem;
}

/* Hero section */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: var(--section-padding) var(--gap);
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: rotate-slow 30s linear infinite;
}

@keyframes rotate-slow {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero > div {
    max-width: var(--content-width);
    position: relative;
    z-index: 1;
}

.hero h1, .hero h2 {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: var(--gradient-spirit);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    animation: fade-in-up 1s ease-out;
}

.hero p {
    font-size: var(--text-lg);
    color: var(--text-soft);
    margin-bottom: 2rem;
    animation: fade-in-up 1s ease-out 0.2s both;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.actions {
    list-style: none;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fade-in-up 1s ease-out 0.4s both;
}

.actions a {
    display: inline-block;
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.actions a:first-child {
    background: var(--gradient-spirit);
    color: var(--light);
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
}

.actions a:last-child {
    border: 2px solid var(--spirit);
    color: var(--spirit);
    background: rgba(139, 92, 246, 0.05);
}

.actions a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Sections */
section {
    padding: var(--section-padding) var(--gap);
    position: relative;
}

section > * {
    max-width: var(--max-width);
    margin: 0 auto;
}

section h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-spirit);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

section h3 {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--spirit);
    text-align: center;
}

.intro {
    font-size: var(--text-lg);
    font-weight: 600;
    text-align: center;
    color: var(--spirit);
    max-width: var(--reading-width);
    margin: 0 auto 3rem;
    padding: 2rem;
    background: var(--mist);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

section p {
    color: var(--text-soft);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    max-width: var(--reading-width);
    margin-left: auto;
    margin-right: auto;
}

section ol {
    max-width: var(--reading-width);
    margin: 0 auto 2rem;
    color: var(--text-soft);
    line-height: 1.8;
}

section ol li {
    margin-bottom: 1rem;
}

section ol li strong {
    color: var(--spirit);
}

section p a {
    color: var(--spirit);
    text-underline-offset: 0.2em;
}


/* Pattern list and FAQ (genetic page) */
ul.patterns {
    max-width: var(--reading-width);
    margin: 0 auto 2rem;
    padding-left: 1.25rem;
    color: var(--text-soft);
    line-height: 1.8;
    columns: 2 18rem;
    column-gap: 2rem;
}

ul.patterns li {
    break-inside: avoid;
    margin-bottom: 0.4rem;
}

section blockquote {
    max-width: var(--reading-width);
    margin: 2rem auto;
    padding: 1.5rem;
    border-left: 4px solid var(--wisdom);
    background: var(--mist);
    border-radius: 0.5rem;
    font-style: italic;
    color: var(--text);
}

section blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-style: normal;
    font-size: 0.9rem;
    color: var(--text-soft);
}

section details {
    max-width: var(--reading-width);
    margin: 0 auto 0.75rem;
    background: var(--mist);
    border-radius: 0.5rem;
    border: 1px solid rgba(124, 58, 237, 0.15);
}

section summary {
    cursor: pointer;
    padding: 1rem 1.25rem;
    font-weight: 700;
    color: var(--spirit);
}

section details p {
    padding: 0 1.25rem;
}

/* Success stories */
.success {
    list-style: none;
    max-width: var(--reading-width);
    margin: 2rem auto;
}

.success li {
    background: var(--mist);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--spirit);
    box-shadow: var(--shadow-sm);
}

.success li strong {
    color: var(--spirit);
}

/* Background alternating sections */
section:nth-child(even) {
    background: var(--mist);
}

/* Contact form */
form {
    max-width: var(--content-width);
    margin: 0 auto;
    display: grid;
    gap: 1.5rem;
}

fieldset {
    border: none;
    display: grid;
    gap: 1rem;
}

legend {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

label {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* Hide honeypot field */
label:has(input[name="gender"]) {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

input, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    background: var(--mist);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background-clip: padding-box;
}

input:focus, textarea:focus {
    outline: none;
    background: var(--light);
    background-image: 
        linear-gradient(var(--light), var(--light)),
        var(--gradient-spirit);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border: 2px solid transparent;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

button {
    padding: 1rem 2rem;
    background: var(--gradient-spirit);
    color: var(--light);
    border: none;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Footer */
footer {
    background: var(--cosmos);
    color: var(--light);
    padding: 3rem var(--gap);
    text-align: center;
    margin-top: 6rem;
}

@media (prefers-color-scheme: dark) {
    footer {
        background: var(--mist);
        color: var(--text);
    }
}

footer a {
    color: var(--energy);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    :root {
        --section-padding: clamp(2rem, 6vw, 4rem);
    }

    .hero h1, .hero h2 {
        font-size: clamp(2rem, 6vw, 2.5rem);
    }

    nav {
        display: none;
    }

    header p {
        padding-left: 0;
        text-align: center;
    }

    header > div > div {
        align-items: center;
        text-align: center;
    }
}


/* Logo - matches homepage */
.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: visible;
    min-width: 200px;
    flex-shrink: 0;
    color: inherit;
    text-decoration: none;
}

.logo-svg {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    overflow: visible;
}

@media (prefers-color-scheme: dark) {
    .logo-svg {
        --spirit: #ffffff;
        filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.2));
    }
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-text strong {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

header .logo-text p {
    padding-left: 0;
    font-size: 0.875rem;
    line-height: 1.2;
    text-align: left;
}

@media (max-width: 768px) {
    .logo-section { min-width: 180px; }
    .logo-svg { width: 2rem; height: 2rem; }
    .logo-text strong { font-size: clamp(1.1rem, 4vw, 1.5rem); }
}

/* Accessibility */
.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;
}

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

::selection {
    background: var(--spirit);
    color: var(--light);
}

/* Thank-you message after the contact form is sent */
.paddme {
    max-width: var(--reading-width, 42rem);
    margin: 3rem auto;
    padding: 2.5rem 2rem;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text);
    background: var(--mist);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.08);
    animation: thanks-fade-in 1.2s ease-out both;
}

.paddme:focus {
    outline: none;
}

@keyframes thanks-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .paddme { animation: none; }
}
