/* =========================================
   1. Theme Variables
   ========================================= */
   :root {
    --color-bg: #f4efe7;
    --color-bg-deep: #ebe4d8;
    --color-paper: #ffffff;
    --color-paper-soft: #fcfaf7;
    --color-text: #22303c;
    --color-muted: #5f6b76;
    --color-header: #10263f;
    --color-accent: #73000a;
    --color-accent-dark: #5a0008;
    --color-accent-soft: #f6e9eb;
    --color-gold: #b08d3c;
    --color-border: #e3ddd4;
    --color-border-strong: #d1c8bb;
    --color-shadow: rgba(16, 38, 63, 0.12);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --site-width: 1180px;
    --content-width: 980px;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

/* =========================================
   2. Reset and Base Styles
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100svh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.75;
    color: var(--color-text);
    background:
        linear-gradient(
            180deg,
            var(--color-bg) 0%,
            #f1ece3 220px,
            var(--color-bg-deep) 100%
        );
}

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

iframe {
    border: 0;
}

a {
    color: var(--color-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
    transition:
        color var(--transition-fast),
        text-decoration-color var(--transition-fast);
}

a:hover,
a:focus-visible {
    color: var(--color-accent-dark);
}

:focus-visible {
    outline: 3px solid rgba(115, 0, 10, 0.2);
    outline-offset: 3px;
}

::selection {
    background-color: rgba(115, 0, 10, 0.12);
}

/* =========================================
   3. Header and Navigation
   ========================================= */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(16, 38, 63, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 28px rgba(16, 38, 63, 0.16);
    backdrop-filter: blur(10px);
}

nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: var(--site-width);
    min-height: 84px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.logo {
    display: inline-flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    text-decoration: none;
    color: #ffffff;
    line-height: 1.2;
}

.logo:hover,
.logo:focus-visible {
    color: #ffffff;
}

.logo-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.logo-subtitle {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

#nav-links {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

#nav-links > li {
    position: relative;
    margin: 0;
    list-style: none;
}

#nav-links > li > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.72rem 1rem;
    color: #f5f7fa;
    font-size: 0.97rem;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    transition:
        background-color var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast);
}

#nav-links > li > a:hover,
#nav-links > li > a:focus-visible,
.dropdown:hover > .dropbtn,
.dropdown:focus-within > .dropbtn,
.dropdown.open > .dropbtn {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

#nav-links > li > a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
}

.dropbtn::after {
    content: "▾";
    margin-left: 0.45rem;
    font-size: 0.72rem;
}

/* Desktop dropdown */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.7rem);
    right: 0;
    z-index: 50;
    display: none;
    width: min(340px, 90vw);
    margin: 0;
    padding: 0.6rem;
    list-style: none;
    background: linear-gradient(180deg, #fffaf4 0%, #f7efe3 100%);
    border: 1px solid #d8c8b1;
    border-radius: 18px;
    box-shadow: 0 18px 36px rgba(16, 38, 63, 0.22);
}

#nav-links .dropdown-menu li {
    width: 100%;
    margin: 0;
    list-style: none;
}

#nav-links .dropdown-menu li + li {
    margin-top: 0.25rem;
}

#nav-links .dropdown-menu a {
    display: block;
    width: 100%;
    padding: 0.85rem 0.95rem;
    color: var(--color-header);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    border-radius: 12px;
    background: transparent;
}

#nav-links .dropdown-menu a:hover,
#nav-links .dropdown-menu a:focus-visible {
    color: var(--color-header);
    background: #ead8bc;
}

#nav-links .dropdown-menu a.active {
    color: #ffffff;
    background: var(--color-accent);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.25rem;
}

.hamburger span {
    width: 26px;
    height: 3px;
    border-radius: 999px;
    background-color: #ffffff;
    transition:
        transform var(--transition-medium),
        opacity var(--transition-medium);
}

@media (min-width: 769px) {
    .hamburger {
        display: none !important;
    }

    #nav-links {
        position: static !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.35rem !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    #nav-links.active {
        max-height: none !important;
        padding: 0 !important;
    }

    .dropdown {
        position: relative;
    }

    .dropdown::after {
        content: "";
        position: absolute;
        top: 100%;
        left: -0.5rem;
        right: -0.5rem;
        height: 16px;
    }

    .dropdown-menu {
        top: calc(100% + 0.35rem);
    }

    .dropdown:hover .dropdown-menu,
    .dropdown:focus-within .dropdown-menu,
    .dropdown.open .dropdown-menu {
        display: block;
    }
}

/* =========================================
   4. Main Layout
   ========================================= */
main.container {
    max-width: var(--content-width);
    min-height: 70vh;
    margin: 3rem auto 0;
    padding: clamp(2rem, 3.5vw, 3.5rem);
    background: var(--color-paper);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 22px 48px var(--color-shadow);
}

.page-meta {
    margin: -0.35rem 0 1.5rem;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-muted);
}

h1,
h2,
h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.2;
    color: var(--color-header);
}

h1 {
    margin-bottom: 1.4rem;
    font-size: clamp(2.3rem, 5vw, 3.35rem);
    letter-spacing: -0.02em;
}

h1::after {
    content: "";
    display: block;
    width: 90px;
    height: 4px;
    margin-top: 0.9rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-gold));
}

h2 {
    margin-top: 2.4rem;
    margin-bottom: 0.9rem;
    font-size: clamp(1.55rem, 2vw, 1.9rem);
}

h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

p {
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
    color: var(--color-text);
}

main.container > p:not(.page-meta) {
    max-width: 72ch;
    text-wrap: pretty;
}

main.container > p:not(.page-meta) + p:not(.page-meta) {
    text-indent: 0;
}

strong {
    color: var(--color-header);
}

ul {
    padding-left: 1.35rem;
}

li {
    margin-bottom: 0.7rem;
}

/* =========================================
   5. Personal Photos
   ========================================= */
.profile-hero {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    align-items: stretch;
    margin: 1.75rem 0 2.25rem;
}

.profile-hero-image {
    width: 100%;
    min-height: 360px;
    object-fit: cover;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: 0 16px 32px rgba(16, 38, 63, 0.12);
}

.profile-hero-note {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: var(--color-paper-soft);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(16, 38, 63, 0.08);
}

.profile-hero-note p {
    margin: 0;
    font-size: 1rem;
    color: var(--color-muted);
    text-indent: 0;
}

.feature-photo {
    margin: 1.75rem 0 2rem;
}

.feature-photo-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: 0 16px 32px rgba(16, 38, 63, 0.12);
}

.feature-photo-caption {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: var(--color-muted);
    text-indent: 0;
}

.site-gallery {
    margin-top: 2.75rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.site-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.site-photo-card {
    margin: 0;
    padding: 0.8rem;
    background: var(--color-paper-soft);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(16, 38, 63, 0.08);
}

.site-photo {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 14px;
}

.site-photo-caption {
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
    color: var(--color-muted);
    text-indent: 0;
}

/* =========================================
   6. Key Insight Image Section
   ========================================= */
.insight-gallery {
    margin-top: 2.5rem;
}

.insight-gallery h2 {
    margin-top: 0;
}

.insight-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* =========================================
   7. Content Cards
   ========================================= */
.card {
    margin-top: 1.8rem;
    padding: clamp(1.4rem, 3vw, 2rem);
    background: var(--color-paper-soft);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(16, 38, 63, 0.08);
}

.card h2:first-of-type {
    margin-top: 0;
}

.card p,
.card li {
    max-width: 72ch;
}

.card ul {
    margin-top: 0.8rem;
}

/* =========================================
   8. Contact Form
   ========================================= */
#contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 760px;
    margin-top: 1.8rem;
    padding: clamp(1.4rem, 3vw, 2rem);
    background: var(--color-paper-soft);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(16, 38, 63, 0.08);
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 0.95rem 1rem;
    font: inherit;
    color: var(--color-text);
    background: #ffffff;
    border: 1px solid var(--color-border-strong);
    border-radius: 12px;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

#contact-form input::placeholder,
#contact-form textarea::placeholder {
    color: #7b8792;
}

#contact-form input:focus,
#contact-form textarea:focus {
    border-color: rgba(115, 0, 10, 0.4);
    box-shadow: 0 0 0 4px rgba(115, 0, 10, 0.08);
    outline: none;
}

#contact-form textarea {
    min-height: 180px;
    resize: vertical;
}

#contact-form button,
form button {
    align-self: flex-start;
    padding: 0.9rem 1.3rem;
    font: inherit;
    font-weight: 700;
    color: #ffffff;
    background: var(--color-accent);
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    transition:
        background-color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
    box-shadow: 0 10px 20px rgba(115, 0, 10, 0.18);
}

#contact-form button:hover,
#contact-form button:focus-visible,
form button:hover,
form button:focus-visible {
    background: var(--color-accent-dark);
    transform: translateY(-1px);
}

/* =========================================
   9. Artifact Section
   ========================================= */
.artifact-section {
    margin-top: 3.5rem;
    padding-top: 2.25rem;
    border-top: 1px solid var(--color-border);
}

.artifact-section h2 {
    margin-top: 0;
}

.artifact-intro {
    max-width: 70ch;
    margin-bottom: 0;
    font-size: 1rem;
    color: var(--color-muted);
    text-indent: 0;
}

.artifact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1.8rem;
}

.artifact-card {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    padding: 1.25rem;
    background: var(--color-paper-soft);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(16, 38, 63, 0.08);
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.artifact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(16, 38, 63, 0.1);
}

.artifact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.artifact-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.72rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-radius: 999px;
}

.artifact-tag.wtc {
    color: #184c73;
    background: #e8f2fa;
}

.artifact-tag.btc {
    color: #7a5200;
    background: #fbf1db;
}

.artifact-tag.support {
    color: #59646e;
    background: #edf1f4;
}

.artifact-title {
    margin: 0;
    font-size: 1.22rem;
    color: var(--color-header);
}

.artifact-frame,
.artifact-preview {
    width: 100%;
    min-height: 320px;
    background: #ffffff;
    border: 1px solid var(--color-border-strong);
    border-radius: 16px;
    overflow: hidden;
}

.artifact-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 320px;
    padding: 0.8rem;
    background: #f3f5f8;
    border: 1px solid var(--color-border-strong);
    border-radius: 16px;
    overflow: hidden;
}

.artifact-image {
    width: 100%;
    height: 320px;
    object-fit: contain;
    border-radius: 12px;
    background: #f3f5f8;
}

.artifact-card > .artifact-image {
    width: 100%;
    min-height: 320px;
    max-height: 320px;
    padding: 0.8rem;
    object-fit: contain;
    background: #f3f5f8;
    border: 1px solid var(--color-border-strong);
    border-radius: 16px;
}

.artifact-link-preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    min-height: 320px;
    padding: 1.4rem;
    background: #f3f5f8;
    border: 1px solid var(--color-border-strong);
    border-radius: 16px;
}

.artifact-link-label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.artifact-link-title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.3rem;
    color: var(--color-header);
}

.artifact-link-text {
    margin: 0;
    color: var(--color-text);
}

.artifact-caption,
.artifact-link {
    margin: 0;
    font-size: 0.98rem;
    text-indent: 0;
}

.artifact-link a {
    font-weight: 700;
    text-decoration: none;
}

.artifact-link a:hover,
.artifact-link a:focus-visible {
    text-decoration: underline;
}

.artifact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.1rem;
}

.artifact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    background: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: 12px;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-fast);
}

.artifact-button:hover,
.artifact-button:focus-visible {
    color: #ffffff;
    background: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
    transform: translateY(-1px);
}

.artifact-button.secondary {
    color: var(--color-header);
    background: #ffffff;
    border-color: var(--color-border-strong);
}

.artifact-button.secondary:hover,
.artifact-button.secondary:focus-visible {
    color: var(--color-header);
    background: #f5f6f8;
    border-color: #bfc6ce;
}

/* =========================================
   10. Footer
   ========================================= */
footer {
    margin-top: 4rem;
    padding: 2rem 1.5rem 2.4rem;
    color: #d8e0ea;
    background: var(--color-header);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-container {
    max-width: var(--site-width);
    margin: 0 auto;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-content p {
    margin: 0;
    font-size: 0.95rem;
    color: #c4ced8;
    text-indent: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links a {
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    opacity: 0.88;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    opacity: 1;
    text-decoration: underline;
}

/* =========================================
   11. Responsive Styles
   ========================================= */
@media (max-width: 960px) {
    main.container {
        margin-top: 2rem;
        padding: 1.6rem;
    }

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

    .profile-hero {
        grid-template-columns: 1fr;
    }

    .profile-hero-image {
        min-height: 280px;
    }

    .site-gallery-grid,
    .insight-gallery-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    nav {
        min-height: 76px;
        padding: 0.95rem 1rem;
    }

    .logo {
        max-width: calc(100% - 56px);
    }

    .logo-subtitle {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    #nav-links {
        position: absolute;
        top: calc(100% + 0.75rem);
        right: 1rem;
        left: 1rem;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: 0;
        padding: 0;
        overflow: hidden;
        background: rgba(16, 38, 63, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 20px;
        box-shadow: 0 18px 36px rgba(16, 38, 63, 0.24);
        transition:
            max-height 0.35s ease,
            padding 0.35s ease;
    }

    #nav-links.active {
        max-height: 800px;
        padding: 0.65rem;
    }

    #nav-links > li {
        width: 100%;
    }

    #nav-links > li > a {
        justify-content: space-between;
        width: 100%;
        border-radius: 14px;
    }

    .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        margin-top: 0.45rem;
        padding: 0.45rem;
        background: #fff8ef;
        border: 1px solid #d8c8b1;
        border-radius: 16px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }

    #nav-links .dropdown-menu a {
        color: var(--color-header);
        background: transparent;
    }

    #nav-links .dropdown-menu a:hover,
    #nav-links .dropdown-menu a:focus-visible {
        color: var(--color-header);
        background: #ead8bc;
    }

    #nav-links .dropdown-menu a.active {
        color: #ffffff;
        background: var(--color-accent);
    }

    .hamburger.toggle span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.toggle span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.toggle span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    h1 {
        font-size: 2.2rem;
    }

    p {
        font-size: 1rem;
    }

    .artifact-frame,
    .artifact-preview,
    .artifact-image-wrap,
    .artifact-card > .artifact-image,
    .artifact-link-preview {
        min-height: 260px;
    }

    .artifact-image {
        height: 260px;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    main.container {
        padding: 1.25rem;
        border-radius: 20px;
    }

    .card,
    #contact-form,
    .artifact-card,
    .profile-hero-note,
    .site-photo-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .artifact-actions {
        flex-direction: column;
    }

    .artifact-button {
        width: 100%;
    }
}