/* ammonlarson.com — warm dark "evening terminal" theme.
   All colors come from the design handoff; the accent is a single custom
   property so it can be swapped in one place. */

:root {
    --accent: #e8896b;
    --bg: #171310;
    --bg-card: #1e1813;
    --text: #efe6d9;
    --text-body: #c9bda9;
    --text-facet: #e5dac8;
    --text-muted: #a89a86;
    --text-extra-muted: #8a7c68;
    --border: #33291f;
    --border-soft: #2a211a;
    --border-button: #3d3226;
    --dot: #3a2f24;
    --font-display: "Space Grotesk", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
    --pad-x: 72px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-display);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.accent {
    color: var(--accent);
}

/* Visible only to assistive tech — carries the role list, which the animated
   span cannot because its text changes on every tick. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* The UA default focus ring is nearly invisible on this background, so every
   focusable affordance gets an authored one. */
a:focus-visible,
.link-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Sections are focusable only so an anchor jump moves keyboard focus into
   them; they are not interactive, so they draw no ring. */
section:focus {
    outline: none;
}

/* Ambient radial glows behind the whole page. These are a fixed warm amber,
   independent of --accent by design, so they stay put when the accent changes. */
.atmosphere {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1100px 600px at 78% -8%, rgba(240, 179, 92, 0.13), transparent 70%),
        radial-gradient(800px 500px at -10% 110%, rgba(240, 179, 92, 0.07), transparent 70%);
    pointer-events: none;
}

/* --- Nav --- */

.nav {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 26px var(--pad-x);
    border-bottom: 1px solid var(--border-soft);
}

.nav-brand {
    font: 500 15px var(--font-mono);
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 32px;
    font: 400 15px var(--font-mono);
}

.nav-links a {
    color: var(--text-body);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* --- Sections --- */

.section {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 var(--pad-x) 96px;
}

/* Used on both a div (hero) and an h2 (life/elsewhere), so the heading's
   default margins are reset explicitly rather than inherited. */
.cmd {
    font: 400 16px var(--font-mono);
    color: var(--text-muted);
    margin: 0 0 24px;
}

/* --- Hero --- */

.hero {
    padding: 100px var(--pad-x) 90px;
}

.hero .cmd {
    margin-bottom: 0;
}

h1 {
    font-size: clamp(64px, 8vw, 110px);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 28px 0 0;
}

.typed-line {
    font: 400 20px var(--font-mono);
    color: var(--accent);
    margin-top: 26px;
    min-height: 28px;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background: var(--accent);
    margin-left: 6px;
    vertical-align: -3px;
    animation: blink 1.1s step-end infinite;
}

.intro {
    font-size: 21px;
    line-height: 1.65;
    color: var(--text-body);
    max-width: 56ch;
    margin: 34px 0 0;
    text-wrap: pretty;
}

.buttons {
    display: flex;
    gap: 18px;
    margin-top: 42px;
}

.btn {
    font: 500 15px var(--font-mono);
    text-decoration: none;
    border-radius: 6px;
}

.btn-primary {
    color: var(--bg);
    background: var(--accent);
    padding: 13px 26px;
    transition:
        filter 0.2s,
        transform 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
}

.btn-ghost {
    color: var(--text);
    border: 1px solid var(--border-button);
    padding: 12px 26px;
    transition:
        border-color 0.2s,
        transform 0.2s;
}

.btn-ghost:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* --- Life --- */

.life-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 64px;
    align-items: start;
}

.facets {
    display: grid;
    font: 400 17px/1.5 var(--font-mono);
    border-top: 1px solid var(--border);
}

.facet-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    padding: 19px 6px;
    border-bottom: 1px solid var(--border);
    transition:
        background 0.2s,
        padding-left 0.2s;
}

/* The first declaration is the fallback for browsers without color-mix(); the
   second derives the tint from --accent so the accent stays a single knob. */
.facet-row:hover {
    background: rgba(232, 137, 107, 0.06);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    padding-left: 14px;
}

.facet-key {
    color: var(--accent);
}

.facet-val {
    color: var(--text-facet);
}

.facet-comment {
    font: 400 14px var(--font-mono);
    color: var(--text-extra-muted);
    padding-top: 18px;
}

.photo-float {
    animation: drift 5s ease-in-out infinite alternate;
}

.photo-card {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.photo-titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--dot);
    display: inline-block;
}

.dot-accent {
    background: var(--accent);
}

.photo-app {
    font: 400 12px var(--font-mono);
    color: var(--text-extra-muted);
    margin-left: auto;
}

/* The intrinsic width/height attributes on the img reserve space against
   layout shift; height:auto keeps them from stretching it once CSS sizes the
   width to the card. */
.photo-card img {
    display: block;
    width: 100%;
    height: auto;
    filter: saturate(0.9);
    opacity: 0.94;
}

.photo-card figcaption {
    font: 400 13px var(--font-mono);
    color: var(--text-muted);
    padding: 12px 14px;
}

/* --- Elsewhere --- */

.elsewhere-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.link-card {
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition:
        border-color 0.2s,
        background 0.2s,
        transform 0.2s;
}

.link-card:hover {
    border-color: var(--accent);
    background: rgba(232, 137, 107, 0.05);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    transform: translateY(-3px);
}

.link-title {
    font: 500 19px var(--font-display);
}

.link-sub {
    font: 400 14px var(--font-mono);
    color: var(--text-muted);
    margin-top: 6px;
}

.link-arrow {
    font: 400 22px var(--font-mono);
    color: var(--accent);
}

/* --- Footer --- */

.footer {
    position: relative;
    border-top: 1px solid var(--border-soft);
    padding: 26px var(--pad-x);
    display: flex;
    justify-content: space-between;
    font: 400 14px var(--font-mono);
    color: var(--text-extra-muted);
}

/* --- Animations --- */

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes blink {
    0%,
    55% {
        opacity: 1;
    }
    56%,
    100% {
        opacity: 0;
    }
}

@keyframes drift {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-18px);
    }
}

.rise {
    animation: rise 0.7s ease both;
}

.rise-2 {
    animation-delay: 0.08s;
}

.rise-3 {
    animation-delay: 0.14s;
}

.rise-4 {
    animation-delay: 0.2s;
}

.rise-5 {
    animation-delay: 0.26s;
}

/* --- Reduced motion: static role list, no float, no entrance rise --- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .rise,
    .photo-float,
    .cursor {
        animation: none;
    }

    /* Hover states move too — the buttons, link cards, and facet rows all
       translate or shift padding — so neutralize those as well. */
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }

    .btn-primary:hover,
    .btn-ghost:hover,
    .link-card:hover {
        transform: none;
    }

    .facet-row:hover {
        padding-left: 6px;
    }
}

/* --- Responsive --- */

@media (max-width: 900px) {
    :root {
        --pad-x: 28px;
    }

    .hero {
        padding-top: 64px;
        padding-bottom: 64px;
    }

    .life-grid,
    .elsewhere-grid {
        grid-template-columns: 1fr;
    }

    .life-grid {
        gap: 48px;
    }

    .facet-row {
        grid-template-columns: 130px 1fr;
        gap: 16px;
    }

    .nav {
        flex-wrap: wrap;
        gap: 10px 16px;
    }

    .nav-links {
        gap: 20px;
    }

    .footer {
        flex-direction: column;
        gap: 8px;
    }
}
