/* Citrus Tech: citrustech.dev
   All assets are self-hosted. No inline styles (CSP: style-src 'self'). */

/* ---------- Fonts (SIL OFL 1.1, see fonts/) ---------- */

/* Variable fonts, Latin subset (@fontsource-variable/atkinson-hyperlegible-next 5.3.0). */
@font-face {
    font-family: "Atkinson Hyperlegible Next";
    src: url("../fonts/AtkinsonHyperlegibleNext-latin-wght.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Atkinson Hyperlegible Next";
    src: url("../fonts/AtkinsonHyperlegibleNext-latin-wght-italic.woff2") format("woff2");
    font-weight: 200 800;
    font-style: italic;
    font-display: swap;
}

/* Variable font, Latin subset (@fontsource-variable/bitter 5.3.0). */
@font-face {
    font-family: "Bitter";
    src: url("../fonts/Bitter-latin-wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- Palette ---------- */
/* All text/background pairs meet WCAG AA (4.5:1) in both themes. */

:root {
    color-scheme: light dark;

    --bg: #fbf7f0;
    --surface: #ffffff;
    --text: #231c17;
    --text-muted: #5c4f45;
    --border: #e8dccd;

    --accent: #b0461c;          /* links, button background, focus ring */
    --on-accent: #ffffff;       /* text on accent buttons */
    --accent-hover: #8f3713;
    --badge-bg: #fde6d3;
    --badge-text: #8a3612;
    --citrus: #f2b33d;          /* decorative only, never behind text */

    --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-heading: "Bitter", Rockwell, "Roboto Slab", Georgia, serif;

    --radius: 1rem;
    --radius-small: 0.5rem;
    --measure: 42rem;
    --wide: 64rem;
    --gutter: 1rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1e1915;
        --surface: #2a231e;
        --text: #f4ede4;
        --text-muted: #c4b5a6;
        --border: #3d332c;

        --accent: #f6a463;
        --on-accent: #1e1915;
        --accent-hover: #ffbe8a;
        --badge-bg: #4a2e1c;
        --badge-text: #ffc89a;
        --citrus: #f2b33d;
    }
}

/* ---------- Base ---------- */

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

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.6;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.75rem;
}

h1 {
    font-size: clamp(2.25rem, 7vw, 3.25rem);
}

h2 {
    font-size: 1.625rem;
    margin-top: 3rem;
}

h3,
.h3 {
    font-size: 1.25rem;
    margin-top: 0;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--accent);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--accent-hover);
}

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

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

/* ---------- Skip link ---------- */

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -4rem;
    z-index: 10;
    padding: 0.5rem 1rem;
    background-color: var(--accent);
    color: var(--on-accent);
    border-radius: var(--radius-small);
    font-weight: 700;
}

.skip-link:focus {
    top: 0.75rem;
}

/* ---------- Header ---------- */

.site-header {
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 0.75rem var(--gutter);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.375rem;
}

.brand:hover {
    color: var(--text);
}

.brand img {
    width: 2.25rem;
    height: 2.25rem;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.site-nav a {
    display: block;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.site-nav a:hover {
    background-color: var(--badge-bg);
    color: var(--badge-text);
}

.site-nav a[aria-current="page"] {
    background-color: var(--badge-bg);
    color: var(--badge-text);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.25em;
}

/* ---------- Main ---------- */

main {
    flex: 1;
    width: 100%;
    max-width: var(--wide);
    margin: 0 auto;
    padding: 3rem var(--gutter) 4rem;
}

/* Focusable only so the skip link moves focus here; it isn't a control. */
main:focus {
    outline: none;
}

.prose {
    max-width: var(--measure);
    margin: 0 auto;
}

.lede {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* A small citrus bar above page headings. */
.page-title::before {
    content: "";
    display: block;
    width: 3rem;
    height: 0.375rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    background-color: var(--citrus);
}

/* Matches the bar above page headings, centered. Works on <hr> or <div>. */
.spacer {
    display: block;
    width: 3rem;
    height: 0.375rem;
    margin: 3rem auto;
    border: 0;
    border-radius: 999px;
    background-color: var(--citrus);
}

/* ---------- Home ---------- */

.hero {
    text-align: center;
    padding-top: 1rem;
}

.hero .page-title::before {
    margin-left: auto;
    margin-right: auto;
}

.hero .lede {
    max-width: 32rem;
    margin: 0 auto 1.5rem;
}

.principles {
    list-style: none;
    margin: 3rem 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

@media (min-width: 48rem) {
    .principles {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.card p:last-child {
    margin-bottom: 0;
}

.principles .card {
    border-top: 0.375rem solid var(--citrus);
}

.cta {
    text-align: center;
}

.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    background-color: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
    text-decoration: none;
}

.button:hover {
    background-color: var(--accent-hover);
    color: var(--on-accent);
}

/* ---------- About ---------- */

.feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.feature-list li {
    padding-left: 1.25rem;
    border-left: 0.25rem solid var(--citrus);
}

.contact {
    margin-top: 3rem;
}

.contact h2 {
    margin-top: 0;
}

.contact dl {
    margin: 0 0 1rem;
}

.contact dt {
    font-weight: 700;
}

.contact dd {
    margin: 0 0 0.75rem;
    overflow-wrap: anywhere;
}

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

/* ---------- Projects ---------- */

/* Works with one card or two, so app cards can be swapped
   for a single "Two apps in development" card. */
.projects {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.project-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.project-heading h2 {
    margin: 0;
}

.badge {
    display: inline-block;
    padding: 0.125rem 0.75rem;
    border-radius: 999px;
    background-color: var(--badge-bg);
    color: var(--badge-text);
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}

.check-list {
    margin: 0 0 1.5rem;
    padding-left: 1.25rem;
}

.check-list li {
    margin-bottom: 0.5rem;
}

.check-list li::marker {
    color: var(--accent);
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.site-footer-inner {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 1.5rem var(--gutter);
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    justify-content: space-between;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
    a,
    .button {
        transition: background-color 150ms ease, color 150ms ease;
    }
}
