:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --fg: #1f2937;
    --muted: #4b5563;
    --footer: #6b7280;
    --border: rgba(31, 41, 55, 0.15);
    --hover: rgba(31, 41, 55, 0.06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111827;
        --fg: #f3f4f6;
        --muted: #d1d5db;
        --footer: #9ca3af;
        --border: rgba(243, 244, 246, 0.15);
        --hover: rgba(243, 244, 246, 0.08);
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--fg);
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

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

a:hover {
    text-decoration: underline;
}

/* Burger menu */
.site-header {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.menu-toggle {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    padding: 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: inherit;
}

.menu-toggle:hover {
    background: var(--hover);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.375rem;
    min-width: 10rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.site-nav[hidden] {
    display: none;
}

.site-nav a {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

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

.site-nav .lang-switch {
    margin-top: 0.25rem;
    padding-top: 0.625rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--muted);
    border-radius: 0;
}

.site-nav .lang-switch:hover {
    color: var(--fg);
    background: transparent;
}

/* Landing page */
.landing {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.landing .content {
    text-align: center;
    max-width: 40rem;
}

.landing h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.landing .byline {
    color: var(--muted);
    margin: 0;
}

.landing .address {
    color: var(--muted);
    margin: 1.5rem 0 0;
}

/* Portfolio page */
.portfolio {
    flex: 1;
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
    padding: 6rem 1.5rem 4rem;
}

.portfolio h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    text-align: center;
    letter-spacing: -0.01em;
}

.portfolio .subtitle {
    text-align: center;
    color: var(--muted);
    margin: 0 0 3rem;
}

.portfolio h2 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    margin: 3rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-align: center;
}

.portfolio .section-note {
    text-align: center;
    color: var(--muted);
    font-size: 0.8125rem;
    margin: 0 0 1.5rem;
}

.portfolio-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.portfolio-grid li {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition:
        border-color 0.15s ease,
        transform 0.15s ease,
        background 0.15s ease;
}

.portfolio-grid a,
.portfolio-grid .card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.75rem 1rem;
    gap: 1rem;
    color: inherit;
    text-decoration: none;
    height: 100%;
    width: 100%;
}

.portfolio-grid a:hover {
    text-decoration: none;
}

.portfolio-grid li:has(a):hover {
    border-color: var(--fg);
    background: var(--hover);
    transform: translateY(-1px);
}

.portfolio-grid .logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
}

.portfolio-grid .logo-icon {
    color: var(--muted);
}

.portfolio-grid .name {
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.portfolio-grid .description {
    font-size: 0.8125rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.4;
    margin: -0.5rem 0 0;
}

.portfolio-grid .exit-meta {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    margin: -0.25rem 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    width: 100%;
}

.portfolio-grid--sold li {
    opacity: 0.55;
    transition:
        opacity 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        transform 0.15s ease;
}

.portfolio-grid--sold li:hover {
    opacity: 1;
}

/* Footer */
.site-footer {
    padding: 1rem;
    text-align: center;
    color: var(--footer);
    font-size: 0.875rem;
}
