@import "fonts.css";

@view-transition {
    navigation: auto;
}

/* ---------- Design tokens ---------- */
:root {
    --color-primary: #472a0c;
    --color-background: #fdf8f4;
    --color-on-surface: #1a1a1a;
    --color-on-surface-variant: #474747;

    --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Vollkorn", Georgia, "Times New Roman", serif;

    --max-width: 1536px;
    --space-page: 2rem;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

html {
    background: #1a1a1a;
}

body {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: transparent;
    color: #ffffff;
    font-family: var(--font-body);
    font-weight: 200;
    line-height: 1.65;
    letter-spacing: 0.015em;
    word-spacing: 0.08em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.is-loaded {
    opacity: 1;
}

/* ---------- Liquid glass block ---------- */
.glass {
    position: relative;
    display: inline-block;
    max-width: 42rem;
    padding: 2.25rem 2.5rem;
    border-radius: 0.5rem;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.015) 0%,
        rgba(255, 255, 255, 0.005) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(15px) saturate(140%);
    -webkit-backdrop-filter: blur(15px) saturate(140%);
}

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

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

::selection {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* ---------- Background ---------- */
.background {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% center;
}

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.01) 100%
    );
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(15px) saturate(140%);
    -webkit-backdrop-filter: blur(15px) saturate(140%);
}

.site-header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem var(--space-page);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.site-header__logo {
    justify-self: start;
}

.site-header__logo img {
    height: 1.5rem;
    width: auto;
    max-width: none;
}

.site-nav {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.site-nav a {
    transition: opacity 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    opacity: 0.6;
}

/* ---------- Hero ---------- */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8rem var(--space-page) 4rem;
}

.hero__content {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.hero__title {
    max-width: 60rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-style: normal;
    font-size: clamp(1.875rem, 4.5vw, 3.25rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.hero__subtitle {
    margin-top: 2rem;
    max-width: 44rem;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    font-weight: 200;
    line-height: 1.5;
    letter-spacing: 0.015em;
    color: rgba(255, 255, 255, 0.85);
    text-wrap: balance;
}

/* ---------- Inner pages ---------- */
.page {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    padding: 10rem var(--space-page) 4rem;
}

.page__content {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.page__eyebrow {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.page__title {
    max-width: 60rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-style: normal;
    font-size: clamp(1.625rem, 3.75vw, 2.75rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.page__body {
    margin-top: 2rem;
    max-width: 44rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: -0.02em;
}

/* ---------- Article list ---------- */
.article-list {
    list-style: none;
    margin-top: 4rem;
    max-width: 56rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.article-list__item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.article-list__item a {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.75rem 0;
    transition: padding 0.25s ease, opacity 0.25s ease;
}

.article-list__item a:hover,
.article-list__item a:focus-visible {
    padding-left: 1rem;
    opacity: 0.75;
}

.article-list__meta {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.7);
}

.article-list__title {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.article-list__excerpt {
    margin-top: 0.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: -0.01em;
    max-width: 48rem;
}

.article-list__loading,
.article-list__error {
    margin-top: 4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.6);
}

.substack-feed {
    margin-top: 1rem;
}

/* ---------- Footer ---------- */
.site-footer {
    position: relative;
    z-index: 10;
    padding: 3rem 0;
}

.site-footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.6);
}

.site-footer__links {
    display: flex;
    gap: 2rem;
}

.site-footer__links a {
    transition: color 0.2s ease;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
    color: #ffffff;
}

@media (min-width: 768px) {
    .site-footer__inner {
        flex-direction: row;
    }
}

/* ---------- Mobile polish ---------- */
@media (max-width: 640px) {
    :root {
        --space-page: 1.25rem;
    }

    .glass {
        padding: 1.5rem 1.5rem;
        border-radius: 1rem;
    }

    .hero {
        padding: 7rem var(--space-page) 3rem;
    }

    .hero__title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

    .hero__subtitle {
        margin-top: 1.25rem;
    }

    .page {
        padding: 8rem var(--space-page) 3rem;
    }

    .page__title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

    .site-nav {
        gap: 1.5rem;
        font-size: 0.75rem;
    }
}

/* ---------- Focus ---------- */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: 2px;
}
