:root {
    color-scheme: light;
    --gs-page: #f9f7f4;
    --gs-surface: #ffffff;
    --gs-surface-inset: #fcfbf9;
    --gs-text-primary: #0f2740;
    --gs-text-secondary: #455268;
    --gs-text-muted: #626a76;
    --gs-border-subtle: #dadddc;
    --gs-border-control: #788592;
    --gs-accent: #79612d;
    --gs-accent-hover: #665022;
    --gs-primary-bg: #79612d;
    --gs-primary-fg: #ffffff;
    --gs-primary-hover: #665022;
    --gs-header-bg: #0f2740;
    --gs-header-fg: #ffffff;
    --gs-header-muted: #bdcad5;
    --gs-header-accent: #c8b07a;
    --gs-focus: #79612d;
    --gs-success-bg: #e7f1ec;
    --gs-success-fg: #1f604a;
    --gs-danger-bg: #f7e8e5;
    --gs-danger-fg: #8a2e25;
    --gs-shadow: 0 18px 54px rgba(15, 39, 64, 0.11);
    --gs-font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --gs-font-editorial: "EB Garamond", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-gs-theme="light"]) {
        color-scheme: dark;
        --gs-page: #0f2740;
        --gs-surface: #102b42;
        --gs-surface-inset: #0b1b2a;
        --gs-text-primary: #ffffff;
        --gs-text-secondary: #bdcad5;
        --gs-text-muted: #9eafbd;
        --gs-border-subtle: #3e566d;
        --gs-border-control: #667c90;
        --gs-accent: #c8b07a;
        --gs-accent-hover: #d8c18e;
        --gs-primary-bg: #c8b07a;
        --gs-primary-fg: #0f2740;
        --gs-primary-hover: #d8c18e;
        --gs-header-bg: #06111c;
        --gs-focus: #c8b07a;
        --gs-success-bg: #123a30;
        --gs-success-fg: #9bd8c1;
        --gs-danger-bg: #421f1c;
        --gs-danger-fg: #f2aaa2;
        --gs-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
    }
}

:root[data-gs-theme="dark"] {
    color-scheme: dark;
    --gs-page: #0f2740;
    --gs-surface: #102b42;
    --gs-surface-inset: #0b1b2a;
    --gs-text-primary: #ffffff;
    --gs-text-secondary: #bdcad5;
    --gs-text-muted: #9eafbd;
    --gs-border-subtle: #3e566d;
    --gs-border-control: #667c90;
    --gs-accent: #c8b07a;
    --gs-accent-hover: #d8c18e;
    --gs-primary-bg: #c8b07a;
    --gs-primary-fg: #0f2740;
    --gs-primary-hover: #d8c18e;
    --gs-header-bg: #06111c;
    --gs-focus: #c8b07a;
    --gs-success-bg: #123a30;
    --gs-success-fg: #9bd8c1;
    --gs-danger-bg: #421f1c;
    --gs-danger-fg: #f2aaa2;
    --gs-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--gs-text-primary);
    background: var(--gs-page);
    font-family: var(--gs-font-body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 0.18em; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--gs-focus);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 20;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    color: var(--gs-primary-fg);
    background: var(--gs-primary-bg);
    border-radius: 8px;
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header,
.site-main,
.site-footer,
.landing-main,
.contact-main {
    width: min(calc(100% - 64px), 1440px);
    margin-right: auto;
    margin-left: auto;
}

.site-header {
    position: relative;
    z-index: 3;
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.brand {
    display: inline-flex;
    width: clamp(190px, 18vw, 244px);
    flex: 0 0 auto;
}

.brand img { width: 100%; height: auto; }
.brand .brand-logo-light { display: block; }
.brand .brand-logo-dark { display: none; }

:root[data-gs-theme="dark"] .brand .brand-logo-light { display: none; }
:root[data-gs-theme="dark"] .brand .brand-logo-dark { display: block; }

@media (prefers-color-scheme: dark) {
    :root:not([data-gs-theme="light"]) .brand .brand-logo-light { display: none; }
    :root:not([data-gs-theme="light"]) .brand .brand-logo-dark { display: block; }
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    color: var(--gs-text-secondary);
    font-size: 0.88rem;
    font-weight: 750;
}

.site-nav a { text-decoration: none; }
.site-nav a:hover { color: var(--gs-accent); }

.site-nav .theme-toggle {
    display: inline-flex;
    min-height: 44px;
    padding: 0 12px;
    align-items: center;
    gap: 8px;
    color: var(--gs-text-secondary);
    background: transparent;
    border: 1px solid var(--gs-border-control);
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 760;
}

.site-nav .theme-toggle:hover {
    color: var(--gs-accent);
    background: transparent;
    border-color: var(--gs-accent);
}

.theme-toggle-icons { display: inline-flex; }

.theme-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

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

.site-nav .nav-contact {
    display: inline-flex;
    min-height: 44px;
    padding: 0 18px;
    align-items: center;
    color: var(--gs-primary-fg);
    background: var(--gs-primary-bg);
    border: 1px solid var(--gs-primary-bg);
    border-radius: 9px;
}

.site-nav .nav-contact:hover,
.site-nav .nav-contact[aria-current="page"] {
    color: var(--gs-primary-fg);
    background: var(--gs-primary-hover);
    border-color: var(--gs-primary-hover);
}

.button {
    display: inline-flex;
    min-height: 50px;
    padding: 0 22px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.button-primary {
    color: var(--gs-primary-fg);
    background: var(--gs-primary-bg);
    border-color: var(--gs-primary-bg);
}

.button-primary:hover {
    color: var(--gs-primary-fg);
    background: var(--gs-primary-hover);
    border-color: var(--gs-primary-hover);
}

/* Temporary landing page */

.landing-page {
    display: grid;
    min-height: 100svh;
    overflow-x: hidden;
    grid-template-rows: auto 1fr auto;
}

.landing-main {
    position: relative;
    display: grid;
    min-height: calc(100svh - 166px);
    padding: clamp(16px, 2vh, 24px) clamp(24px, 3vw, 48px);
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

.landing-art {
    position: absolute;
    z-index: -1;
    top: 50%;
    right: max(-15vw, -220px);
    width: min(68vw, 980px);
    height: auto;
    opacity: 0.14;
    transform: translateY(-50%);
    -webkit-mask-image: linear-gradient(to right, transparent 2%, #000 42%);
    mask-image: linear-gradient(to right, transparent 2%, #000 42%);
}

.landing-content {
    width: min(100%, 760px);
    padding: clamp(20px, 3vh, 32px) 0;
}

.landing-label {
    display: inline-flex;
    margin: 0 0 22px;
    padding: 8px 12px;
    color: var(--gs-accent);
    border: 1px solid var(--gs-accent);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 820;
    letter-spacing: 0.06em;
}

.landing-content h1 {
    max-width: 760px;
    margin: 0;
    font-family: var(--gs-font-editorial);
    font-size: clamp(4.1rem, 7vw, 7.4rem);
    font-weight: 500;
    letter-spacing: -0.052em;
    line-height: 0.87;
}

.landing-intro {
    max-width: 650px;
    margin: 28px 0 26px;
    color: var(--gs-text-secondary);
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    line-height: 1.75;
}

.landing-footer { min-height: 62px; }

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: var(--gs-text-muted);
    border-top: 1px solid var(--gs-border-subtle);
    font-size: 0.8rem;
}

.site-footer p { margin: 0; }
.site-footer a { color: var(--gs-accent); font-weight: 780; }
.site-footer div { display: flex; flex-wrap: wrap; gap: 10px 24px; }

@media (prefers-color-scheme: dark) {
    :root:not([data-gs-theme="light"]) .landing-art,
    :root:not([data-gs-theme="light"]) .contact-art { opacity: 0.26; }
}

:root[data-gs-theme="dark"] .landing-art,
:root[data-gs-theme="dark"] .contact-art { opacity: 0.26; }

/* Contact page */

.contact-page {
    display: grid;
    min-height: 100svh;
    overflow-x: hidden;
    grid-template-rows: auto 1fr auto;
}

.contact-main {
    position: relative;
    display: grid;
    min-height: calc(100svh - 154px);
    padding: clamp(16px, 2vh, 24px) clamp(24px, 3vw, 48px);
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

.contact-art {
    position: absolute;
    z-index: -1;
    top: 50%;
    left: max(-20vw, -300px);
    width: min(66vw, 920px);
    height: auto;
    opacity: 0.1;
    transform: translateY(-50%);
    -webkit-mask-image: linear-gradient(to left, transparent 0%, #000 44%);
    mask-image: linear-gradient(to left, transparent 0%, #000 44%);
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.8fr) minmax(440px, 1.2fr);
    align-items: center;
    gap: 0;
}

.contact-story {
    display: flex;
    min-height: 600px;
    padding: clamp(42px, 6vw, 82px) clamp(42px, 6vw, 88px) clamp(42px, 6vw, 82px) 0;
    flex-direction: column;
    justify-content: center;
    color: var(--gs-text-primary);
    border-right: 1px solid var(--gs-border-subtle);
}

.contact-story .landing-label { align-self: flex-start; }

.contact-story h1,
.contact-form-panel h2 {
    max-width: 650px;
    margin: 0;
    font-family: var(--gs-font-editorial);
    font-size: clamp(2.5rem, 4vw, 4.5rem);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1;
}

.contact-story > p:not(.landing-label):not(.contact-status) {
    max-width: 520px;
    margin: 26px 0 0;
    color: var(--gs-text-secondary);
    font-size: 1.04rem;
    line-height: 1.7;
}

.contact-status {
    margin: 36px 0 0;
    padding-top: 22px;
    color: var(--gs-accent);
    border-top: 1px solid var(--gs-border-subtle);
    font-size: 0.82rem;
    font-weight: 780;
}

.contact-form-panel {
    width: min(100%, 660px);
    margin: 0 auto;
    padding: clamp(38px, 5vw, 68px) 0 clamp(38px, 5vw, 68px) clamp(42px, 6vw, 88px);
}

.contact-form-panel h2 { font-size: clamp(2.1rem, 3.6vw, 3.25rem); }
.form-intro { margin: 12px 0 28px; color: var(--gs-text-secondary); }

.notice {
    margin: 0 0 24px;
    padding: 14px 16px;
    border-left: 4px solid currentColor;
    border-radius: 6px;
    font-size: 0.9rem;
}

.notice.success { color: var(--gs-success-fg); background: var(--gs-success-bg); }
.notice.error { color: var(--gs-danger-fg); background: var(--gs-danger-bg); }
.field { display: block; margin-bottom: 20px; }

.field-label {
    display: block;
    margin-bottom: 7px;
    color: var(--gs-text-primary);
    font-size: 0.86rem;
    font-weight: 760;
}

input,
textarea {
    display: block;
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    color: var(--gs-text-primary);
    background: var(--gs-surface-inset);
    border: 1px solid var(--gs-border-control);
    border-radius: 8px;
    font: inherit;
    line-height: 1.4;
}

textarea { min-height: 150px; resize: vertical; }
input:focus-visible, textarea:focus-visible { border-color: var(--gs-accent); }
[aria-invalid="true"] { border-color: var(--gs-danger-fg); }

.field-error {
    display: block;
    margin-top: 6px;
    color: var(--gs-danger-fg);
    font-size: 0.82rem;
}

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

button {
    display: inline-flex;
    min-height: 48px;
    padding: 0 24px;
    align-items: center;
    justify-content: center;
    color: var(--gs-primary-fg);
    background: var(--gs-primary-bg);
    border: 1px solid var(--gs-primary-bg);
    border-radius: 9px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

button:hover { background: var(--gs-primary-hover); border-color: var(--gs-primary-hover); }
.privacy { margin: 18px 0 0; color: var(--gs-text-muted); font-size: 0.78rem; }
.contact-footer { min-height: 62px; }

@media (max-width: 980px) {
    .landing-art { right: -26vw; width: 90vw; }
    .contact-layout { grid-template-columns: 1fr; }
    .contact-story {
        min-height: 0;
        padding: 68px 0 48px;
        border-right: 0;
        border-bottom: 1px solid var(--gs-border-subtle);
    }
    .contact-form-panel { margin: 0; padding: 48px 0 72px; }
    .contact-art { left: auto; right: -34vw; width: 100vw; }
}

@media (max-width: 680px) {
    .site-header,
    .site-main,
    .site-footer,
    .landing-main,
    .contact-main { width: min(calc(100% - 36px), 1440px); }
    .site-header { min-height: 78px; gap: 14px; }
    .brand { width: 178px; }
    .site-nav { gap: 10px; }
    .site-nav > a:not(.nav-contact) { display: none; }
    .site-nav .nav-contact { min-height: 40px; padding: 0 14px; }
    .site-nav .theme-toggle { width: 40px; min-height: 40px; padding: 0; justify-content: center; }
    .theme-toggle [data-theme-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .landing-main { min-height: calc(100svh - 142px); align-items: start; }
    .landing-main,
    .contact-main { padding: 12px 18px 20px; }
    .landing-content { padding: clamp(48px, 8vh, 72px) 0 42px; }
    .landing-content h1 { font-size: clamp(3.45rem, 16vw, 4.4rem); line-height: 0.9; }
    .landing-intro { margin-top: 28px; line-height: 1.7; }
    .landing-art {
        top: auto;
        right: -44vw;
        bottom: -10vw;
        width: 145vw;
        opacity: 0.08;
        transform: none;
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 72%);
        mask-image: linear-gradient(to bottom, transparent 0%, #000 72%);
    }
    .landing-footer { min-height: 64px; }
    .contact-main { min-height: calc(100svh - 142px); }
    .contact-story { padding: 48px 0 40px; }
    .contact-story h1 { font-size: clamp(2.8rem, 14vw, 4rem); }
    .contact-form-panel { padding: 40px 0 56px; }
    .contact-art {
        top: 80px;
        right: -58vw;
        width: 150vw;
        opacity: 0.07;
        transform: none;
        -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 74%);
        mask-image: linear-gradient(to bottom, #000 0%, transparent 74%);
    }
    .site-footer { padding: 20px 0; align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
