@font-face {
    font-family: "Site Inter";
    src: url("/assets/fonts/inter-variable.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --page: #ffffff;
    --text: #000;
    --text-strong: #000;
    --text-muted: #6b6b6b;
    --border-soft: #e4e4e4;
    --border-faint: #f5f5f5;
    --font-sf: "Site Inter", Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

[data-theme="dark"] {
    --page: #0e0e0e;
    --text: #b0b0b0;
    --text-strong: #fff;
    --text-muted: #8a8a8a;
    --border-soft: #1c1c1c;
    --border-faint: #141414;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--page);
    max-width: 100%;
    min-height: 100%;
}

body {
    color: var(--text);
    font-family: var(--font-sf);
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p, figure { margin: 0; }

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

a:focus-visible {
    outline: 2px solid var(--text-strong);
    outline-offset: 3px;
    border-radius: 2px;
}

::selection { background: rgba(0, 0, 0, 0.06); }
[data-theme="dark"] ::selection { background: rgba(255, 255, 255, 0.14); }

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10;
    padding: 0.5rem 0.75rem;
    font-size: 13px;
    background: var(--page);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

/* ---- shell ---- */

.site { width: 100%; min-width: 320px; overflow-x: clip; }

.intro-section {
    width: 100%;
    padding: 120px 0 111px;
    position: relative;
}

.content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 36px;
    width: 540px;
    max-width: calc(100% - 60px);
    margin: 0 auto;
    position: relative;
}

/* ---- name (paco.me style: Inter medium at body size, no hero title) ---- */

.site-name {
    margin: 0;
    color: var(--text-strong);
    font-family: var(--font-sf);
    font-size: 14px;
    font-weight: 500;
    line-height: 22px;
    letter-spacing: 0;
}

/* ---- intro copy ---- */

.stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: none;
    gap: 32px;
    width: 100%;
}

.body-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: none;
    gap: 14px;
    width: 100%;
}

.information {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: none;
    gap: 12px;
    width: 100%;
}

.information p {
    width: 100%;
    max-width: 100%;
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 22px;
    letter-spacing: 0;
    overflow-wrap: break-word;
    hyphens: none;
}

/* inline links: grey underline resting, strong underline on hover (no animation) */

.information a,
.names a {
    color: var(--text-strong);
    text-underline-offset: 3px;
    line-height: 22px;
    position: relative;
}

.link-label { display: inline-block; position: relative; line-height: 22px; }

.link-label::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--border-soft);
    pointer-events: none;
}

.link-label::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--text-strong);
    opacity: 0;
    pointer-events: none;
}

a:hover .link-label::after,
a:focus-visible .link-label::after { opacity: 1; }

/* ---- link groups ---- */

.link-groups {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: none;
    gap: 4px;
    width: 100%;
    padding: 0;
}

.link-divider { flex: none; width: 100%; height: 0; position: relative; }

.link-divider::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border-top: 1px solid var(--border-faint);
}

.link-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: none;
    gap: 14px;
    width: 100%;
    margin-bottom: 24px;
}

.link-section h2 {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    white-space: nowrap;
}

.link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 6px 16px;
    width: 100%;
    font-size: 14px;
    line-height: 22px;
}

.link-row-stacked { grid-template-columns: minmax(0, 1fr); }

.names {
    min-width: 0;
    color: var(--text-strong);
    font-size: 14px;
    line-height: 22px;
    overflow-wrap: anywhere;
}

.names a { width: fit-content; }

.project-desc { color: var(--text-muted); }

.dates {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 22px;
    text-align: right;
    white-space: nowrap;
}

/* ---- theme toggle ---- */

.theme-toggle-anchor {
    position: fixed;
    top: max(16px, env(safe-area-inset-top, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
    z-index: 51;
}

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    color: var(--text-muted);
    opacity: 0.55;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    color: var(--text-strong);
    opacity: 1;
    outline: none;
}

/* ---- article pages (same type system) ---- */

.article-page { font-size: 14px; }

.article-layout {
    width: 540px;
    max-width: calc(100% - 60px);
    margin: 0 auto;
    padding: 120px 0 111px;
}

.article-header h1 {
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    color: var(--text-strong);
    text-wrap: pretty;
}

.article-meta {
    margin: 6px 0 28px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 22px;
}

.article-prose { display: flex; flex-direction: column; gap: 16px; }

.article-prose p {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 24px;
    overflow-wrap: break-word;
}

.article-prose h2 {
    margin: 24px 0 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
}

.article-prose a { color: var(--text-strong); }

.back-link {
    display: inline-block;
    margin-bottom: 32px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 22px;
}

/* ---- responsive ---- */

@media (max-width: 720px) {
    .intro-section { padding: 96px 0 80px; }
    .article-layout { padding: 96px 0 80px; }
    .link-row {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 2px;
    }
    .dates { text-align: left; font-size: 12.5px; line-height: 18px; margin: -2px 0 4px; }
    .link-row .dates:last-child { margin-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

@media print {
    .theme-toggle-anchor { display: none; }
    .intro-section, .article-layout { padding: 0; }
    .content, .article-layout { width: 100%; max-width: none; }
}
