/* ========== 1. Color Palette ========== */
/* Grayscale + blue scale, white text throughout. */

:root {
    /* --- Grayscale --- */
    --gray-950: #0b0d10;
    --gray-900: #12151a;
    --gray-850: #171a20;
    --gray-800: #1b1f26;
    --gray-700: #262b33;
    --gray-600: #383f4a;
    --gray-500: #565f6c;
    --gray-400: #7c8493;
    --gray-300: #a5abb8;
    --gray-200: #ccd0d8;
    --gray-100: #e8eaee;
    --white:    #ffffff;

    /* --- Blue scale --- */
    --blue-900: #0a1930;
    --blue-800: #0f2a4d;
    --blue-700: #163e6e;
    --blue-600: #1f5490;
    --blue-500: #2f6fb3;
    --blue-400: #4d8fd4;
    --blue-300: #7bafe0;
    --blue-200: #a9cdec;
    --blue-100: #d6e6f6;

    /* --- Status accents (kept distinct for meaning) --- */
    --status-success: #4caf6e;
    --status-error:   #e0665f;
    --status-pending: #d9b34a;
}

/* ========== 2. Reset ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--gray-950);
    color: var(--white);
    font-family: system-ui, -apple-system, sans-serif;
}

/* ========== 3. Page Layout ========== */
.page-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--gray-900);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-nav {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-home {
    flex: 0 0 220px;
    padding-left: 1.5rem;
    box-sizing: border-box;
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

.header-home:hover {
    color: var(--blue-300);
}

.header-home::selection {
    background: var(--blue-600);
    color: var(--white);
}

.header-page-link {
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin-left: 1.5rem;
    transition: color 0.2s;
}

.header-home + .header-page-link {
    margin-left: auto;
}

.header-page-link:hover {
    color: var(--blue-300);
}

/* Three-slot nav: logo left, centered link group, one link right */
.header-nav-split {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    justify-content: normal;
}

.header-nav-split .header-home {
    justify-self: start;
    margin: 0;
}

.header-nav-center {
    display: flex;
    gap: 1.5rem;
    justify-self: center;
}

.header-nav-center .header-page-link {
    margin: 0;
}

.header-page-link-end {
    justify-self: end;
    margin: 0;
}

/* Header / sidebar / main content: sidebar + content row */
.page-body {
    flex: 1;
    display: flex;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    width: 220px;
    min-width: 220px;
    height: 100vh;
    padding: 2rem 1.5rem;
    background: var(--gray-900);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-label {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.03em;
    text-decoration: underline;
    color: var(--white);
    margin-top: 1rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.55rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    color: var(--gray-200);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 300;
    letter-spacing: 0.03em;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.sidebar-nav a:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
    color: var(--gray-950);
}

.sidebar-nav a:active {
    background: var(--gray-300);
    border-color: var(--gray-400);
    color: var(--gray-950);
    transform: translateY(1px);
}

.sidebar-nav a.active {
    background: var(--gray-300);
    border-color: var(--gray-400);
    color: var(--gray-950);
    font-weight: 600;
}

.sidebar-nav a.active:hover {
    background: var(--gray-300);
    border-color: var(--gray-400);
    color: var(--gray-950);
}

.main-content {
    flex: 1;
    padding: 3rem 4rem;
    overflow-y: auto;
    background: var(--gray-950);
    color: var(--white);
}

.main-content h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    color: var(--white);
}

.main-content h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.main-content p {
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: var(--gray-200);
}

.main-content a {
    color: var(--blue-300);
}

.main-content a:hover {
    color: var(--blue-200);
}

.main-content section {
    margin-bottom: 2rem;
}

.main-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.main-content li {
    font-weight: 300;
    line-height: 1.7;
    color: var(--gray-200);
}

.main-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 2rem 0;
}

.opener-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

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

.video-embed-wrap {
    position: relative;
    width: min(100%, calc((100vh - 14rem) * 16 / 9));
    max-width: 1100px;
    aspect-ratio: 16 / 9;
    margin: 2rem auto;
}

.video-embed-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 2rem;
    margin: 2rem 0;
    max-width: 900px;
}

.photo-item {
    display: flex;
    flex-direction: column;
}

.photo-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.photo-item figcaption {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.03em;
    line-height: 1.5;
    color: var(--gray-400);
    text-align: center;
}

/* ========== 4. Footer ========== */
.site-footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 3rem 2rem;
    font-size: 0.9rem;
    font-weight: 300;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.footer-socials {
    display: flex;
    gap: 2rem;
}

.footer-socials a {
    color: var(--white);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

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

.footer-contact a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contact a:hover {
    color: var(--blue-300);
}

.footer-copyright {
    color: var(--gray-400);
    font-size: 0.8rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--blue-300);
}

/* ========== 5. Page Color Themes ========== */
/* Add class="theme-professional" / "theme-software" / "theme-personal" to
   <body class="page-layout"> to switch a page's header/sidebar/footer color.
   All three stay within the gray/blue scale with white text.
   No class = the default charcoal look used above. */

/* Professional — deep navy */
.theme-professional .site-header {
    background: var(--blue-900);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.theme-professional .header-home,
.theme-professional .header-page-link {
    color: var(--white);
}

.theme-professional .header-home:hover,
.theme-professional .header-page-link:hover {
    color: var(--blue-200);
}

.theme-professional .sidebar {
    background: var(--blue-900);
    border-right-color: rgba(255, 255, 255, 0.1);
}

.theme-professional .sidebar-label {
    color: var(--white);
}

.theme-professional .sidebar-nav a {
    color: var(--blue-100);
}

.theme-professional .sidebar-nav a:hover {
    color: var(--blue-200);
}

.theme-professional .site-footer {
    background: var(--blue-900);
    color: var(--white);
    border-top-color: rgba(255, 255, 255, 0.1);
}

.theme-professional .footer-socials a,
.theme-professional .footer-contact a,
.theme-professional .footer-links a {
    color: var(--white);
}

.theme-professional .footer-copyright {
    color: var(--blue-200);
}

.theme-professional .footer-socials a:hover,
.theme-professional .footer-contact a:hover,
.theme-professional .footer-links a:hover {
    color: var(--blue-200);
}

/* Software — charcoal gray */
.theme-software .site-header {
    background: var(--gray-800);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.theme-software .header-home,
.theme-software .header-page-link {
    color: var(--white);
}

.theme-software .header-home:hover,
.theme-software .header-page-link:hover {
    color: var(--blue-300);
}

.theme-software .sidebar {
    background: var(--gray-800);
    border-right-color: rgba(255, 255, 255, 0.1);
}

.theme-software .sidebar-label {
    color: var(--white);
}

.theme-software .sidebar-nav a {
    color: var(--gray-200);
}

.theme-software .sidebar-nav a:hover {
    color: var(--blue-300);
}

.theme-software .site-footer {
    background: var(--gray-800);
    color: var(--white);
    border-top-color: rgba(255, 255, 255, 0.1);
}

.theme-software .footer-socials a,
.theme-software .footer-contact a,
.theme-software .footer-links a {
    color: var(--white);
}

.theme-software .footer-copyright {
    color: var(--gray-400);
}

.theme-software .footer-socials a:hover,
.theme-software .footer-contact a:hover,
.theme-software .footer-links a:hover {
    color: var(--blue-300);
}

/* Personal — mid blue */
.theme-personal .site-header {
    background: var(--blue-600);
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.theme-personal .header-home,
.theme-personal .header-page-link {
    color: var(--white);
}

.theme-personal .header-home:hover,
.theme-personal .header-page-link:hover {
    color: var(--blue-900);
}

.theme-personal .sidebar {
    background: var(--blue-600);
    border-right-color: rgba(255, 255, 255, 0.12);
}

.theme-personal .sidebar-label {
    color: var(--white);
}

.theme-personal .sidebar-nav a {
    color: var(--white);
}

.theme-personal .sidebar-nav a:hover {
    color: var(--blue-900);
}

.theme-personal .site-footer {
    background: var(--blue-600);
    color: var(--white);
    border-top-color: rgba(255, 255, 255, 0.12);
}

.theme-personal .footer-socials a,
.theme-personal .footer-contact a,
.theme-personal .footer-links a {
    color: var(--white);
}

.theme-personal .footer-copyright {
    color: var(--blue-100);
}

.theme-personal .footer-socials a:hover,
.theme-personal .footer-contact a:hover,
.theme-personal .footer-links a:hover {
    color: var(--blue-900);
}

/* ========== 6. Cookie Banner + Turnstile Overlay ========== */
.captcha-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.captcha-overlay.visible {
    display: flex;
}

.captcha-box {
    background: var(--gray-850);
    border-bottom: 3px solid var(--blue-600);
    padding: 2.5rem 3rem;
    text-align: center;
    max-width: 420px;
    width: 90%;
}

.captcha-box h2 {
    font-size: 2rem;
    font-weight: 300;
    color: var(--white);
    letter-spacing: -0.01em;
    margin-bottom: 0.4rem;
}

.captcha-box p {
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--gray-300);
    letter-spacing: 0.03em;
    margin-bottom: 1.5rem;
}

.captcha-widget {
    display: flex;
    justify-content: center;
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gray-850);
    border-top: 2px solid var(--blue-600);
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    z-index: 999;
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.02em;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner p {
    flex: 1;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.4rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 300;
    font-family: inherit;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.cookie-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--blue-400);
}

/* ========== 7. User Agreement Page ========== */
.section-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 2rem 0;
}

.cookie-status {
    font-size: 0.9rem;
    font-weight: 400;
    margin-top: 0.75rem;
    padding: 0.4rem 0.8rem;
    display: inline-block;
    border-left: 3px solid transparent;
}

.cookie-status-accepted {
    color: var(--status-success);
    border-left-color: var(--status-success);
    background: rgba(76, 175, 110, 0.1);
}

.cookie-status-declined {
    color: var(--status-error);
    border-left-color: var(--status-error);
    background: rgba(224, 102, 95, 0.1);
}

.cookie-status-pending {
    color: var(--status-pending);
    border-left-color: var(--status-pending);
    background: rgba(217, 179, 74, 0.1);
}

.quote-record {
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray-200);
}

.theme-personal .quote-record {
    border-bottom-color: rgba(255, 255, 255, 0.25);
}

/* ========== 8. Error Page ========== */
.error-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--gray-900);
    color: var(--white);
    padding: 3rem 2rem;
}

.error-box {
    text-align: center;
}

.error-box h1 {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 300;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.error-box .go-home {
    color: var(--white);
    font-weight: 300;
    letter-spacing: 0.05em;
    text-decoration: none;
    font-size: 1rem;
}

.error-box .go-home:hover {
    color: var(--blue-300);
}

.debug-table {
    margin-top: 2.5rem;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-weight: 300;
    text-align: left;
    width: 100%;
    max-width: 560px;
}

.debug-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.debug-table td:first-child {
    padding: 0.5rem 1.5rem 0.5rem 0;
    color: var(--gray-400);
    white-space: nowrap;
}

.debug-table td:last-child {
    padding: 0.5rem 0;
    word-break: break-all;
    color: var(--gray-200);
}

/* ========== 9. Work Request Form ========== */
.work-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 640px;
    margin-top: 1.5rem;
}

.work-form label {
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin-top: 1rem;
    color: var(--white);
}

.work-form label:first-child {
    margin-top: 0;
}

.work-form textarea,
.work-form input[type="text"] {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--white);
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--gray-800);
    resize: vertical;
    line-height: 1.5;
}

.work-form textarea::placeholder,
.work-form input[type="text"]::placeholder {
    color: var(--gray-400);
}

.work-form textarea:focus,
.work-form input[type="text"]:focus {
    outline: none;
    border-color: var(--blue-400);
}

.work-form-submit {
    align-self: flex-start;
    margin-top: 1.5rem;
    padding: 0.6rem 1.75rem;
    border: 1px solid var(--blue-500);
    background: var(--blue-700);
    color: var(--white);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.work-form-submit:hover {
    background: var(--blue-600);
    border-color: var(--blue-400);
}

.work-form-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.work-form-status {
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.2em;
}

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

.work-form-status.error {
    color: var(--status-error);
}

/* ========== Error Page ========== */
.error-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
}

.error-box {
    text-align: center;
}

.error-box h1 {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.debug-table {
    margin-top: 2.5rem;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-weight: 300;
    text-align: left;
    width: 100%;
    max-width: 560px;
}

.debug-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.debug-table td:first-child {
    padding: 0.5rem 1.5rem 0.5rem 0;
    color: var(--gray-400);
    white-space: nowrap;
}

.debug-table td:last-child {
    padding: 0.5rem 0;
    word-break: break-all;
}

