/* ═══════════════════════════════════════════════════
   Mark Beider Tutoring — Design System
   Editorial / Academic / Warm
   Fraunces + Outfit · Ivory / Forest / Amber
   ═══════════════════════════════════════════════════ */

:root {
    --bg: #FAF8F4;
    --surface: #FFFFFF;
    --surface-alt: #F2EDE6;
    --ink: #1C1B19;
    --ink-muted: #4A4743;
    --ink-soft: #8A8580;
    --line: #E2DCD4;
    --line-soft: #EDE8E1;
    --accent: #2B5F4E;
    --accent-hover: #1F4A3B;
    --accent-soft: rgba(43, 95, 78, 0.07);
    --warm: #B8863E;
    --warm-soft: rgba(184, 134, 62, 0.08);

    --font-display: 'Fraunces', 'Georgia', serif;
    --font-body: 'Outfit', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;

    --max-width: 1140px;
    --radius-lg: 6px;
    --radius-md: 4px;
    --radius-sm: 3px;
    --space-section: clamp(5.5rem, 12vw, 8rem);
    --space-stack: 1.5rem;
    --space-card: 1.25rem;
    --grid-line: 1px solid var(--line);

    --shadow-sm: 0 1px 3px rgba(28, 27, 25, 0.04);
    --shadow-md: 0 4px 20px rgba(28, 27, 25, 0.06);
    --shadow-lg: 0 8px 40px rgba(28, 27, 25, 0.08);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    color-scheme: light;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    line-height: 1.65;
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.25;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
}

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

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

[hidden] {
    display: none !important;
}

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

/* ═══════════════════════════════════════════════════
   Navigation
   ═══════════════════════════════════════════════════ */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 248, 244, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.nav-shell {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.01em;
    font-weight: 600;
    color: var(--ink);
    font-optical-sizing: auto;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    padding: 0.4rem 0.75rem;
    min-height: 2.2rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
    color: var(--ink);
    background: var(--accent-soft);
}

.nav-links a.active {
    color: var(--accent);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════════ */
main {
    overflow: hidden;
}

.content-section {
    padding: var(--space-section) 2rem;
}

.section-tone {
    background: var(--surface);
    border-top: var(--grid-line);
}

.section-shell {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    gap: var(--space-stack);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.section-heading {
    display: grid;
    gap: 0.6rem;
}

.section-subtitle {
    color: var(--ink-soft);
    max-width: 58ch;
    font-size: 0.95rem;
    line-height: 1.6;
}

.section-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--warm);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   Typography
   ═══════════════════════════════════════════════════ */
h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    line-height: 1.15;
    color: var(--ink);
    font-weight: 600;
    letter-spacing: -0.01em;
    font-optical-sizing: auto;
}

h1 {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.08;
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.4rem);
    letter-spacing: -0.015em;
}

h3 {
    font-size: 1.2rem;
    letter-spacing: -0.005em;
}

p {
    color: var(--ink-muted);
}

/* ═══════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════ */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.8rem 1.8rem;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

.button-primary {
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--accent);
}

.button-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.button-secondary {
    border-color: var(--ink);
    background: transparent;
    color: var(--ink);
}

.button-secondary:hover {
    background: var(--ink);
    color: var(--bg);
}

.text-link {
    display: inline-block;
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.text-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* ═══════════════════════════════════════════════════
   Hero
   ═══════════════════════════════════════════════════ */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--accent);
    z-index: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(44, 44, 42, 0.3) 0%,
        rgba(44, 44, 42, 0.55) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 780px;
    padding: 2rem;
}

.hero h1 {
    color: #FFFFFF;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.2);
}

.hero-tagline {
    margin-top: 1.25rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.01em;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2.5rem;
    justify-content: center;
}

.hero .button-primary {
    background: var(--warm);
    border-color: var(--warm);
    color: #FFFFFF;
}

.hero .button-primary:hover {
    background: #A07332;
    border-color: #A07332;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(184, 134, 62, 0.3);
}

.hero .button-secondary {
    border-color: rgba(255, 255, 255, 0.7);
    color: #FFFFFF;
}

.hero .button-secondary:hover {
    background: #FFFFFF;
    color: var(--ink);
    border-color: #FFFFFF;
}

/* Hero — no background image variant */
.hero-no-image {
    background: linear-gradient(
        170deg,
        #1F4A3B 0%,
        #2B5F4E 35%,
        #347260 100%
    );
    min-height: 60vh;
}

.hero-no-image::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-no-image .hero-content {
    max-width: 820px;
}

/* Decorative ornament under hero heading */
.hero-ornament {
    display: block;
    width: 60px;
    height: 2px;
    background: var(--warm);
    margin: 1.5rem auto 0;
    border-radius: 1px;
}

[data-theme="dark"] .hero-no-image {
    background: linear-gradient(
        170deg,
        #0F2920 0%,
        #163B2E 35%,
        #1E4D3D 100%
    );
}

/* ═══════════════════════════════════════════════════
   Service Preview Cards
   ═══════════════════════════════════════════════════ */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-card);
}

.portfolio-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    aspect-ratio: 3 / 4;
    background: var(--accent-soft);
}

.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.portfolio-card:hover img {
    transform: scale(1.03);
}

.portfolio-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(44, 44, 42, 0.6) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    transition: background 0.3s ease;
}

.portfolio-card:hover .portfolio-card-overlay {
    background: linear-gradient(0deg, rgba(44, 44, 42, 0.75) 0%, transparent 60%);
}

.portfolio-card-label {
    color: #FFFFFF;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
}

.portfolio-card-count {
    display: block;
    margin-top: 0.3rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
}

/* Card without image — icon + text */
.card-no-image {
    aspect-ratio: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.card-no-image:hover {
    border-left-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.card-no-image:hover img {
    transform: none;
}

.card-no-image .portfolio-card-overlay {
    display: none;
}

.card-content {
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
}

.card-icon {
    color: var(--accent);
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.card-no-image:hover .card-icon {
    transform: scale(1.1);
}

.card-icon svg {
    width: 28px;
    height: 28px;
}

.card-no-image .portfolio-card-label {
    color: var(--ink);
    font-size: 1.15rem;
    font-family: var(--font-display);
}

.card-description {
    color: var(--ink-muted);
    font-size: 0.92rem;
    line-height: 1.65;
    flex: 1;
}

.card-no-image .portfolio-card-count {
    color: var(--accent);
    font-weight: 600;
    margin-top: 0.75rem;
    transition: letter-spacing 0.2s ease;
}

.card-no-image:hover .portfolio-card-count {
    letter-spacing: 0.1em;
}

/* Placeholder for images not yet added */
.img-placeholder {
    width: 100%;
    height: 100%;
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    object-fit: cover;
}

/* 2x2 grid variant for test prep subjects */
.services-grid-2x2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
    .services-grid-2x2 {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════
   About Teaser (homepage)
   ═══════════════════════════════════════════════════ */
.about-teaser {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 4rem;
    align-items: center;
}

.about-teaser-img {
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--accent-soft);
    box-shadow: var(--shadow-lg);
}

.about-teaser-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-teaser-copy h2 {
    margin-bottom: 1.25rem;
}

.about-teaser-copy p {
    font-size: 1.02rem;
    line-height: 1.75;
    margin-bottom: 1.75rem;
}

/* ═══════════════════════════════════════════════════
   Contact Form
   ═══════════════════════════════════════════════════ */
.contact-form-wrap {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    display: grid;
    gap: 1.1rem;
}

.form-group {
    display: grid;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.9rem;
    font-family: var(--font-body);
    font-size: 1rem;
    min-height: 48px;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-status {
    font-family: var(--font-body);
    font-size: 0.85rem;
    min-height: 1.25rem;
    font-weight: 500;
}

.form-status.success {
    color: var(--accent);
}

.form-status.error {
    color: #C44;
}

/* ═══════════════════════════════════════════════════
   About Page
   ═══════════════════════════════════════════════════ */
.about-page {
    padding: clamp(3.5rem, 7vw, 5rem) 2rem var(--space-section);
}

.about-shell {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    gap: var(--space-section);
}

.about-intro {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3.5rem;
    align-items: start;
}

.about-photo {
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--accent-soft);
    box-shadow: var(--shadow-lg);
}

.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-bio h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1.5rem;
}

.about-bio p {
    font-size: 1.02rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-card);
}

.service-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.service-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card h3 {
    font-size: 1.12rem;
}

.service-card p {
    font-size: 0.92rem;
    line-height: 1.65;
}

.about-cta {
    text-align: center;
    padding: 3.5rem 2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.about-cta h2 {
    margin-bottom: 0.75rem;
}

.about-cta p {
    margin-bottom: 1.75rem;
    font-size: 1.02rem;
}

/* ═══════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════ */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--bg);
}

.footer-shell {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-copy {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
}

.footer-socials {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.footer-socials a {
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.2s;
}

.footer-socials a:hover {
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════
   Motion — reveals
   ═══════════════════════════════════════════════════ */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ═══════════════════════════════════════════════════
   Focus styles
   ═══════════════════════════════════════════════════ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════
   Theme toggle
   ═══════════════════════════════════════════════════ */
.theme-toggle {
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--ink);
    border-color: var(--ink);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
    display: block;
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }

[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-teaser {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .about-intro {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .services-grid-2x2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .nav-shell {
        flex-wrap: wrap;
        padding: 0.75rem 1.25rem;
        gap: 0.75rem;
    }

    .nav-toggle {
        display: flex;
        order: 2;
        min-width: 2.75rem;
        min-height: 2.75rem;
        align-items: center;
        justify-content: center;
    }

    .brand {
        order: 1;
        flex: 1;
        min-width: 0;
    }

    .theme-toggle {
        order: 3;
    }

    .nav-shell nav {
        display: block;
        width: 100%;
        padding-top: 0;
        order: 4;
        border-top: 1px solid var(--line);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.2s ease, padding-top 0.3s ease;
    }

    .nav-open nav {
        max-height: 300px;
        opacity: 1;
        padding-top: 0.75rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 0.75rem 0.5rem;
        min-height: 2.9rem;
        font-size: 0.85rem;
        border-bottom: 1px solid var(--line-soft);
        border-radius: 0;
    }

    .nav-links a.active {
        border-bottom-color: var(--accent);
        font-weight: 600;
        color: var(--accent);
    }

    .hero {
        min-height: 60vh;
    }

    .hero-no-image {
        min-height: 50vh;
    }

    .content-section {
        padding: 3.5rem 1.25rem;
    }

    .about-page {
        padding: 2.5rem 1.25rem 3.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-card {
        aspect-ratio: 3 / 2;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-shell {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
        padding: 1.2rem 1.25rem;
    }

    .button {
        padding: 0.7rem 1.2rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    .nav-shell {
        padding: 0.7rem 0.9rem;
    }

    .hero {
        min-height: 50vh;
    }

    .content-section {
        padding: 2.5rem 0.9rem;
    }

    .about-page {
        padding: 2rem 0.9rem 3rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .brand {
        font-size: 0.88rem;
    }

    .hero-tagline {
        font-size: 1rem;
    }
}

@media (hover: none) {
    .button-primary:hover {
        background: var(--accent);
        border-color: var(--accent);
        transform: none;
        box-shadow: none;
    }

    .button-primary:active {
        opacity: 0.85;
    }

    .portfolio-card:hover img {
        transform: none;
    }

    .service-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    .card-no-image:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
}

@media print {
    .site-nav,
    .site-footer {
        display: none;
    }

    body {
        background: #ffffff;
    }

    body::before {
        display: none;
    }

    .content-section,
    .hero,
    .about-page {
        padding: 1.5rem 0;
    }
}

/* Sticky mobile CTA */
.mobile-cta {
    display: none;
}

@media (max-width: 760px) {
    .mobile-cta {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 90;
        height: 48px;
        align-items: center;
        justify-content: center;
        background: rgba(250, 248, 244, 0.92);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.06);
        border-top: 1px solid var(--line);
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .mobile-cta.is-visible {
        transform: translateY(0);
    }

    .mobile-cta a {
        font-family: var(--font-body);
        font-size: 0.82rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--accent);
        text-decoration: none;
    }

    .mobile-cta a:active {
        opacity: 0.7;
    }

    body {
        padding-bottom: 48px;
    }
}

/* ═══════════════════════════════════════════════════
   Dark mode
   ═══════════════════════════════════════════════════ */
[data-theme="dark"] {
    --bg: #141310;
    --surface: #1E1D1A;
    --surface-alt: #262420;
    --ink: #F0ECE6;
    --ink-muted: #C4BFB6;
    --ink-soft: #7A7570;
    --line: #333028;
    --line-soft: #282520;
    --accent: #4FAF8E;
    --accent-hover: #6BC4A4;
    --accent-soft: rgba(79, 175, 142, 0.08);
    --warm: #D4A04E;
    --warm-soft: rgba(212, 160, 78, 0.08);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.25);

    color-scheme: dark;
}

[data-theme="dark"] body {
    background: var(--bg);
}

[data-theme="dark"] body::before {
    opacity: 0.15;
}

[data-theme="dark"] .site-nav {
    background: rgba(20, 19, 16, 0.92);
    border-bottom-color: var(--line);
}

[data-theme="dark"] .site-footer {
    background: var(--bg);
    border-top-color: var(--line);
}

[data-theme="dark"] .hero-overlay {
    background: linear-gradient(
        180deg,
        rgba(20, 19, 16, 0.4) 0%,
        rgba(20, 19, 16, 0.65) 100%
    );
}

[data-theme="dark"] .nav-links a {
    color: var(--ink-soft);
}

[data-theme="dark"] .nav-links a:hover {
    color: var(--ink);
    background: var(--accent-soft);
}

[data-theme="dark"] .nav-links a.active {
    color: var(--accent);
}

[data-theme="dark"] .nav-toggle-bar {
    background: var(--ink);
}

[data-theme="dark"] .theme-toggle {
    border-color: var(--line);
    color: var(--ink-soft);
}

[data-theme="dark"] .theme-toggle:hover {
    color: var(--ink);
    border-color: var(--ink);
}

[data-theme="dark"] .button-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #0F1A15;
}

[data-theme="dark"] .button-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

[data-theme="dark"] .button-secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--ink);
}

[data-theme="dark"] .button-secondary:hover {
    background: var(--ink);
    color: var(--bg);
}

[data-theme="dark"] .section-tone {
    background: var(--surface);
    border-top-color: var(--line);
}

[data-theme="dark"] .service-card {
    background: var(--surface);
    border-color: var(--line);
}

[data-theme="dark"] .service-card:hover {
    border-color: var(--accent);
}

[data-theme="dark"] .service-card::before {
    background: var(--accent);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    background: var(--bg);
    color: var(--ink);
    border-color: var(--line);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

[data-theme="dark"] .about-cta {
    background: var(--surface);
    border-color: var(--line);
}

[data-theme="dark"] .portfolio-card {
    background: var(--surface-alt);
}

[data-theme="dark"] .card-no-image {
    background: var(--surface);
    border-color: var(--line);
}

[data-theme="dark"] .card-no-image:hover {
    border-left-color: var(--accent);
    border-color: var(--accent);
    border-left-color: var(--accent);
}

[data-theme="dark"] .card-no-image .portfolio-card-label {
    color: var(--ink);
}

[data-theme="dark"] .card-no-image .portfolio-card-count {
    color: var(--accent);
}

[data-theme="dark"] .img-placeholder {
    background: var(--surface-alt);
    color: var(--ink-soft);
}

[data-theme="dark"] .mobile-cta {
    background: rgba(20, 19, 16, 0.92);
}

[data-theme="dark"] .hero .button-primary {
    background: var(--warm);
    border-color: var(--warm);
    color: #1A1200;
}

[data-theme="dark"] .hero .button-primary:hover {
    background: #E0AD58;
    border-color: #E0AD58;
}
