:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-strong: #f0f4f8;
    --ink: #111827;
    --muted: #5f6c7b;
    --line: #d8e0ea;
    --header-bg: rgba(255, 255, 255, 0.92);
    --header-line: rgba(216, 224, 234, 0.9);
    --input-bg: #fbfdff;
    --image-bg: #eef3f8;
    --nav-active-bg: #111827;
    --nav-active-text: #ffffff;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --teal: #0f766e;
    --amber: #b45309;
    --shadow: 0 18px 50px rgba(17, 24, 39, 0.12);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f172a;
    --surface: #111827;
    --surface-strong: #1f2937;
    --ink: #f8fafc;
    --muted: #cbd5e1;
    --line: #334155;
    --header-bg: rgba(15, 23, 42, 0.92);
    --header-line: rgba(51, 65, 85, 0.9);
    --input-bg: #0b1220;
    --image-bg: #172033;
    --nav-active-bg: #f8fafc;
    --nav-active-text: #0f172a;
    --blue: #3b82f6;
    --blue-dark: #2563eb;
    --teal: #2dd4bf;
    --amber: #f59e0b;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

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

[hidden] {
    display: none !important;
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    min-height: 72px;
    padding: 0.85rem 5vw;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-line);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    color: var(--ink);
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--surface-strong);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--ink);
    background: var(--surface-strong);
}

.site-nav a[aria-current="page"] {
    color: var(--nav-active-text);
    background: var(--nav-active-bg);
}

.theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.22rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
}

.theme-option {
    min-height: 34px;
    padding: 0.45rem 0.6rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.theme-option:hover,
.theme-option:focus-visible {
    color: var(--ink);
}

.theme-option[aria-pressed="true"] {
    color: var(--nav-active-text);
    background: var(--nav-active-bg);
}

main {
    width: 100%;
}

.hero {
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    align-items: end;
    gap: 2rem;
    padding: 7rem 5vw 4rem;
    color: #ffffff;
}

.hero-home {
    background-image:
        linear-gradient(90deg, rgba(5, 9, 17, 0.88), rgba(5, 9, 17, 0.58), rgba(5, 9, 17, 0.8)),
        url("../images/background.jpeg");
    background-position: center;
    background-size: cover;
}

.hero-content,
.page-hero-copy {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 0.7rem;
    color: var(--teal);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #9be7df;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 1rem;
    font-size: 3.5rem;
    line-height: 1.03;
    font-weight: 900;
}

h2 {
    margin-bottom: 0.8rem;
    font-size: 2.2rem;
    line-height: 1.12;
}

h3 {
    margin-bottom: 0.55rem;
    font-size: 1.15rem;
    line-height: 1.25;
}

.hero-copy {
    max-width: 650px;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.18rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
}

.button-primary {
    color: #ffffff;
    background: var(--blue);
}

.button-primary:hover,
.button-primary:focus-visible {
    background: var(--blue-dark);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
}

.button-secondary:hover,
.button-secondary:focus-visible {
    background: rgba(255, 255, 255, 0.2);
}

.hero-panel {
    display: grid;
    gap: 0.75rem;
    align-self: stretch;
    max-height: 340px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
}

.hero-panel div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 92px;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
}

.hero-panel strong {
    font-size: 2rem;
    line-height: 1;
}

.hero-panel span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.95rem;
}

.section {
    width: min(1120px, 90vw);
    margin: 0 auto;
    padding: 4.5rem 0 1.5rem;
}

.intro-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 2rem;
    align-items: end;
    padding-top: 3.5rem;
}

.section-lede {
    color: var(--muted);
    font-size: 1.05rem;
}

.project-tools {
    display: grid;
    gap: 0.75rem;
}

.project-search {
    display: grid;
    gap: 0.45rem;
}

.project-search span {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 900;
}

.project-search input {
    min-height: 48px;
}

.search-count {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
}

.start-here-section {
    padding-bottom: 0.5rem;
}

.start-here-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.start-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 14px 40px rgba(17, 24, 39, 0.08);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.start-card:hover,
.start-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: var(--shadow);
}

.start-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 1.3rem;
    background: var(--image-bg);
    object-fit: contain;
}

.start-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.1rem;
}

.start-card-content h3 {
    margin-bottom: 0.45rem;
    font-size: 1.35rem;
}

.start-card-content p {
    color: var(--muted);
}

.project-sections {
    display: grid;
    gap: 2.5rem;
    width: min(1120px, 90vw);
    margin: 0 auto;
    padding: 1.5rem 0 5rem;
}

.project-category {
    display: grid;
    gap: 1rem;
}

.project-category.is-hidden {
    display: none;
}

.project-category-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: end;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--line);
}

.project-category-header h2 {
    margin-bottom: 0.2rem;
}

.project-category-header p:last-child {
    margin-bottom: 0.45rem;
    color: var(--muted);
    font-weight: 700;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}

.project-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.project-card.is-hidden {
    display: none;
}

.project-card-featured {
    position: relative;
    display: grid;
    grid-template-columns: 29% minmax(0, 1fr);
    align-items: start;
    min-height: 170px;
    border-color: rgba(45, 212, 191, 0.42);
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, rgba(45, 212, 191, 0.9), rgba(37, 99, 235, 0.8), rgba(245, 158, 11, 0.82)) border-box;
    box-shadow: 0 18px 48px rgba(15, 118, 110, 0.16);
}

.project-card-featured .project-image {
    width: 100%;
    aspect-ratio: 1;
    align-self: start;
    margin: 1rem 0 0 1rem;
    padding: 0.2rem;
    border-radius: 8px;
    background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.2), transparent 42%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.2), transparent 42%),
        var(--image-bg);
}

.project-card-featured .project-content {
    padding-left: 1.5rem;
}

.project-card-featured .project-type {
    color: var(--teal);
}

.project-card:hover,
.project-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: var(--shadow);
}

.project-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    padding: 0.9rem;
    background: var(--image-bg);
    object-fit: contain;
}

.project-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1rem;
}

.project-label-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 0.45rem;
}

.project-label-row .project-type {
    margin-bottom: 0;
}

.project-type {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--amber);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.project-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0.22rem 0.45rem;
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--blue);
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 0.85rem;
}

.project-tags span {
    padding: 0.25rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-strong);
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
}

.project-card p,
.about-copy p,
.contact-details p {
    color: var(--muted);
}

.project-search-empty {
    width: min(1120px, 90vw);
    margin: -3.5rem auto 5rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    text-align: center;
    font-weight: 900;
}

.page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: center;
    gap: 3rem;
    width: min(1120px, 90vw);
    margin: 0 auto;
    padding: 5rem 0 3rem;
}

.page-hero h1,
.page-hero p {
    max-width: 760px;
}

.page-hero p {
    color: var(--muted);
    font-size: 1.15rem;
}

.portrait-image {
    width: 320px;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.about-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 2rem;
    width: min(1120px, 90vw);
    margin: 0 auto;
    padding: 1rem 0 5rem;
}

.about-copy {
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-size: 1.08rem;
}

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

.about-highlights {
    display: grid;
    gap: 0.8rem;
}

.about-highlights div,
.contact-details {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.highlight-label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--teal);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.contact-hero {
    display: block;
    padding-top: 5rem;
    padding-bottom: 2rem;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 2rem;
    width: min(1120px, 90vw);
    margin: 0 auto;
    padding: 0 0 5rem;
}

.contact-form {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
}

.form-row {
    display: grid;
    gap: 0.45rem;
}

label {
    color: var(--ink);
    font-weight: 800;
}

label span {
    color: var(--muted);
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--ink);
    font: inherit;
}

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

input:focus,
textarea:focus {
    outline: 3px solid rgba(37, 99, 235, 0.18);
    border-color: var(--blue);
}

button:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
}

.form-message {
    display: none;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-weight: 800;
}

.success-message {
    color: #14532d;
    background: #dcfce7;
}

.error-message {
    color: #7f1d1d;
    background: #fee2e2;
}

.contact-details {
    align-self: start;
}

.contact-details h2 {
    font-size: 1.55rem;
}

.detail-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.detail-list span {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 800;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.5rem 5vw;
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.95rem;
}

.site-footer span:first-child {
    color: var(--ink);
    font-weight: 900;
}

@media (max-width: 900px) {
    .hero,
    .intro-section,
    .page-hero,
    .about-layout,
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 5rem;
    }

    .hero-panel {
        max-height: none;
    }

    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .start-here-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-category-header {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .portrait-image {
        width: min(320px, 100%);
    }
}

@media (max-width: 640px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        min-height: auto;
    }

    .site-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .theme-switcher {
        width: 100%;
        justify-content: space-between;
    }

    .theme-option {
        flex: 1;
    }

    .site-nav a {
        min-height: 38px;
        padding: 0.5rem 0.65rem;
        font-size: 0.9rem;
    }

    h1 {
        font-size: 2.35rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .hero-copy,
    .page-hero p {
        font-size: 1rem;
    }

    .hero {
        padding: 4rem 5vw 3rem;
    }

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

    .start-here-grid {
        grid-template-columns: 1fr;
    }

    .project-card-featured {
        grid-template-columns: 88px minmax(0, 1fr);
        min-height: 146px;
    }

    .project-card-featured .project-image {
        margin: 1rem 0 0 1rem;
    }

    .project-card-featured .project-content {
        padding-left: 1.25rem;
    }

    .about-copy,
    .contact-form,
    .contact-details {
        padding: 1rem;
    }
}
