:root {
    --bg: #030814;
    --bg-strong: #07101f;
    --surface: rgba(8, 17, 33, 0.94);
    --surface-solid: #0b1629;
    --ink: #f1d98a;
    --muted: #c7b37a;
    --accent: #e7c86a;
    --accent-soft: rgba(231, 200, 106, 0.18);
    --line: rgba(231, 200, 106, 0.2);
    --shadow: 0 18px 48px rgba(0, 4, 12, 0.6);
    --header-bg: rgba(4, 10, 21, 0.92);
    --nav-hover-bg: rgba(231, 200, 106, 0.12);
    --button-text: #04101f;
    --button-bg: #f7f4ee;
    --button-hover-bg: #ffffff;
    --flash-bg: rgba(231, 200, 106, 0.14);
    --flash-line: rgba(231, 200, 106, 0.3);
    --danger: #ff857a;
}

:root[data-theme="light"] {
    --bg: #f3f0ea;
    --bg-strong: #e4ddd2;
    --surface: rgba(255, 252, 247, 0.92);
    --surface-solid: #fffdf9;
    --ink: #1f2522;
    --muted: #5f685f;
    --accent: #1f3f73;
    --accent-soft: #d8e2f1;
    --line: rgba(31, 37, 34, 0.1);
    --shadow: 0 18px 48px rgba(31, 37, 34, 0.08);
    --header-bg: rgba(243, 240, 234, 0.86);
    --nav-hover-bg: rgba(255, 255, 255, 0.72);
    --button-text: #f8f7f3;
    --button-bg: #1f3f73;
    --button-hover-bg: #18325c;
    --flash-bg: rgba(216, 226, 241, 0.65);
    --flash-line: rgba(31, 63, 115, 0.18);
    --danger: #8e2430;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top, rgba(201, 164, 74, 0.08), transparent 32%),
        linear-gradient(180deg, var(--bg-strong), var(--bg) 22%, var(--bg) 100%);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.6;
}

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

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

.shell {
    width: min(1080px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 76px;
}

.brand-lockup {
    display: grid;
    gap: 0.1rem;
    padding: 1rem 0;
}

.brand-link {
    display: inline-flex;
    align-items: center;
}

.brand-logo,
.footer-logo,
.auth-logo,
.hero-mark {
    display: none;
}

:root .brand-logo-dark,
:root .footer-logo-dark,
:root .auth-logo-dark,
:root .hero-mark-dark {
    display: block;
}

:root[data-theme="light"] .brand-logo-dark,
:root[data-theme="light"] .footer-logo-dark,
:root[data-theme="light"] .auth-logo-dark,
:root[data-theme="light"] .hero-mark-dark {
    display: none;
}

:root[data-theme="light"] .brand-logo-light,
:root[data-theme="light"] .footer-logo-light,
:root[data-theme="light"] .auth-logo-light,
:root[data-theme="light"] .hero-mark-light {
    display: block;
}

.hero-mark-photo {
    display: block;
}

.brand-logo {
    width: clamp(112px, 16vw, 168px);
    height: auto;
}

.brand {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 0.82rem;
}

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

.site-nav a {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    color: var(--muted);
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-form {
    margin: 0;
}

.nav-form .button {
    cursor: pointer;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    background: var(--nav-hover-bg);
    color: var(--ink);
    transform: translateY(-1px);
}

.site-nav .button {
    color: var(--button-text);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.8rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--button-bg);
    color: var(--button-text);
    font-weight: 600;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
    background: var(--button-hover-bg);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

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

.theme-toggle {
    margin-left: auto;
}

.theme-switch {
    margin-left: auto;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-switch-track {
    position: relative;
    display: inline-flex;
    width: 2.8rem;
    height: 1.6rem;
    border-radius: 999px;
    background: var(--surface-solid);
    border: 1px solid var(--line);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
    transition: background-color 180ms ease, border-color 180ms ease;
}

.theme-switch-track::after {
    content: "";
    position: absolute;
    top: 0.12rem;
    left: 0.14rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    transition: transform 180ms ease, background-color 180ms ease;
}

.theme-switch input:checked + .theme-switch-track::after {
    transform: translateX(1.16rem);
}

.theme-switch input:focus-visible + .theme-switch-track {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.theme-switch-label {
    color: var(--ink);
    font-weight: 600;
}

.button-small {
    min-height: 38px;
    padding: 0.6rem 0.95rem;
}

main {
    padding-bottom: 3rem;
}

.hero {
    padding: 4rem 0 2rem;
}

.hero-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 1.5rem;
    align-items: stretch;
}

.hero-copy,
.hero-aside,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 2.75rem;
}

.hero-copy-with-mark {
    position: relative;
    overflow: hidden;
    min-height: 360px;
}

.hero-copy-main {
    position: relative;
    z-index: 1;
}

.hero-mark-wrap {
    position: absolute;
    top: 1.6rem;
    right: 1.6rem;
    width: clamp(140px, 20vw, 220px);
    padding: 0.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    overflow: hidden;
}

.hero-mark {
    width: 100%;
    height: auto;
}

.hero-mark-photo {
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 16px;
}

.hero-copy-with-mark .eyebrow,
.hero-copy-with-mark h1,
.hero-copy-with-mark .lede,
.hero-copy-with-mark .hero-actions {
    max-width: calc(100% - clamp(160px, 24vw, 260px));
}

:root[data-theme="light"] .hero-mark-wrap {
    background: rgba(31, 63, 115, 0.06);
}

.hero-aside {
    padding: 1.5rem;
    display: grid;
    gap: 1rem;
    align-content: start;
}

.eyebrow {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero h1,
.page-banner h1 {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 4.9rem);
    line-height: 0.96;
    letter-spacing: -0.04em;
    max-width: 11ch;
}

.lede {
    margin: 1.25rem 0 0;
    max-width: 42rem;
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.75rem;
}

.section {
    padding: 1rem 0 2.5rem;
}

.section-heading {
    max-width: 42rem;
    margin-bottom: 1.25rem;
}

.section-label {
    display: inline-block;
    margin-bottom: 0.55rem;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-heading h2 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.grid-3,
.grid-2,
.two-col {
    display: grid;
    gap: 1rem;
}

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

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

.panel {
    padding: 1.4rem;
}

.panel h2,
.panel h3 {
    margin: 0 0 0.65rem;
    font-size: 1.15rem;
}

.panel p,
.panel li {
    color: var(--muted);
}

.stack-list,
.bullet-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.stack-list {
    display: grid;
    gap: 1rem;
}

.stack-list li + li,
.bullet-list li + li {
    border-top: 1px solid var(--line);
    padding-top: 0.9rem;
}

.bullet-list li {
    padding-left: 1.1rem;
    position: relative;
}

.bullet-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72rem;
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: var(--accent);
}

.metric {
    padding: 0.9rem 0 0;
    border-top: 1px solid var(--line);
}

.metric strong {
    display: block;
    font-size: 1.8rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.metric span {
    color: var(--muted);
    font-size: 0.92rem;
}

.page-banner {
    padding: 2.5rem 0 0.5rem;
}

.page-banner .shell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.page-banner p {
    margin: 0.75rem 0 0;
    max-width: 42rem;
    color: var(--muted);
}

.auth-shell {
    display: flex;
    justify-content: center;
}

.auth-form {
    width: min(460px, 100%);
}

.auth-logo-wrap {
    margin-bottom: 1rem;
}

.auth-logo {
    width: min(240px, 100%);
    height: auto;
}

.auth-form p {
    display: grid;
    gap: 0.35rem;
    margin: 0 0 1rem;
}

.form-intro {
    color: var(--muted);
}

.form-help {
    margin: 1rem 0 0;
    color: var(--muted);
}

.form-help a {
    color: var(--accent);
    font-weight: 600;
}

.auth-form input,
.auth-form textarea,
.auth-form select {
    width: 100%;
    padding: 0.82rem 0.9rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-solid);
    font: inherit;
}

.auth-form ul.errorlist,
.form-stack ul.errorlist {
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
    color: var(--danger);
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.form-stack p {
    display: grid;
    gap: 0.35rem;
    margin: 0;
}

.form-stack input,
.form-stack textarea,
.form-stack select {
    width: 100%;
    padding: 0.82rem 0.9rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-solid);
    font: inherit;
}

.flash-shell {
    padding-top: 1rem;
}

.flash-message {
    margin: 0 0 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--flash-line);
    border-radius: 18px;
    background: var(--flash-bg);
}

.detail-list {
    margin: 1rem 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.detail-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
}

.detail-list strong {
    color: var(--ink);
}

.invoice-address p {
    margin: 0 0 0.35rem;
}

.invoice-table-wrap {
    overflow-x: auto;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.invoice-table th,
.invoice-table td {
    padding: 0.9rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.invoice-table th {
    color: var(--ink);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-total-panel {
    margin-top: 1rem;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.data-table th,
.data-table td {
    padding: 0.9rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.data-table th {
    color: var(--ink);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.data-table td:last-child {
    width: 1%;
    white-space: nowrap;
}

.comment-stream {
    display: grid;
    gap: 1rem;
}

.comment-card p {
    margin: 0;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
    color: var(--muted);
}

.empty-state {
    text-align: center;
}

.site-footer {
    padding: 1rem 0 3rem;
}

.footer-shell {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.footer-mark {
    font-weight: 700;
    color: var(--ink);
}

.footer-brand {
    display: grid;
    gap: 0.55rem;
}

.footer-logo {
    width: min(180px, 42vw);
    height: auto;
}

@media (max-width: 900px) {
    .hero-shell,
    .grid-3,
    .grid-2,
    .two-col {
        grid-template-columns: 1fr;
    }

    .nav-shell,
    .footer-shell {
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .nav-shell {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 0 1rem;
    }

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

    .site-nav a,
    .site-nav .nav-form,
    .site-nav .theme-switch {
        width: 100%;
    }

    .site-nav .button {
        width: 100%;
        justify-content: center;
    }

    .theme-switch {
        align-items: flex-start;
    }

    .hero-copy,
    .hero-aside,
    .page-banner .shell,
    .panel {
        border-radius: 22px;
    }

    .hero-copy {
        padding: 1.8rem;
    }

    .hero-mark-wrap {
        top: 1.2rem;
        right: 1.2rem;
        width: 150px;
    }

    .page-banner {
        padding-top: 1.5rem;
    }

    .page-banner .shell {
        padding: 1.5rem;
    }

    .page-banner h1 {
        max-width: none;
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .detail-list li,
    .comment-meta,
    .footer-shell {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-list li span,
    .comment-meta span {
        word-break: break-word;
    }
}

@media (max-width: 520px) {
    .shell {
        width: min(100% - 1.25rem, 1080px);
    }

    .hero {
        padding-top: 2rem;
    }

    .hero-copy,
    .hero-aside,
    .page-banner .shell,
    .panel {
        padding: 1.15rem;
        border-radius: 18px;
    }

    .hero-copy-with-mark {
        min-height: auto;
    }

    .hero-mark-wrap {
        position: static;
        width: min(180px, 100%);
        margin: 0 0 1rem auto;
    }

    .hero-copy-with-mark .eyebrow,
    .hero-copy-with-mark h1,
    .hero-copy-with-mark .lede,
    .hero-copy-with-mark .hero-actions {
        max-width: none;
    }

    .brand {
        font-size: 0.96rem;
    }

    .brand-subtitle {
        font-size: 0.76rem;
    }

    .button,
    .button-small {
        width: 100%;
    }

    .hero-actions {
        gap: 0.65rem;
    }

    .section {
        padding-bottom: 1.75rem;
    }
}
