/* basemaloumar.com — shared styles for every page except the CV (/cv/ keeps its own style.css).
   Deliberately plain: one narrow column of text, set like a letter. Spectral for reading,
   Libre Franklin for small UI text. Fonts are self-hosted from /fonts/ (latin subset, SIL OFL). */

@font-face {
    font-family: "Spectral";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/spectral-400-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Spectral";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/spectral-400-italic-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Spectral";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/fonts/spectral-600-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Libre Franklin";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("/fonts/libre-franklin-latin.woff2") format("woff2");
}

:root {
    --bg: #f3efe7;
    --paper: #fbf9f5;
    --ink: #1f2b3a;
    --ink-soft: #46515e;
    --muted: #636a73;
    --rule: #dcd4c6;
    --accent: #9b4a2c;
    --live: #2a6345;
    --green: #18302a;
    --cream: #efe6d3;
    --serif: "Spectral", Georgia, "Times New Roman", serif;
    --sans: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --column: 680px;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-padding-top: 80px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: rgba(155, 74, 44, 0.18); }

a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

img { max-width: 100%; }

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    line-height: 1.15;
}

.wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    background: var(--ink);
    color: #fff;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.site-header.scrolled { border-bottom-color: var(--rule); }

.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 64px;
}

.brand {
    font-family: var(--serif);
    font-size: 19px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.site-nav a {
    font-size: 15px;
    color: var(--ink-soft);
    text-decoration: none;
}

.site-nav a:hover { color: var(--ink); }

.site-nav a[aria-current="page"] {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
}

.lang-switch {
    display: flex;
    gap: 2px;
    padding-left: 20px;
    border-left: 1px solid var(--rule);
}

.lang-switch button {
    border: 0;
    background: none;
    cursor: pointer;
    font: 400 14px/1 var(--sans);
    color: var(--muted);
    padding: 6px 6px;
}

.lang-switch button:hover { color: var(--ink); }

.lang-switch button.active {
    color: var(--ink);
    font-weight: 600;
}

.menu-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid var(--rule);
    background: none;
    border-radius: 4px;
    font: 500 14px/1 var(--sans);
    color: var(--ink);
    padding: 9px 14px;
    cursor: pointer;
}

/* ---------- The letter column ---------- */
.letter {
    max-width: calc(var(--column) + 48px);
    padding-top: 56px;
    padding-bottom: 96px;
}

.letter h1 {
    font-size: clamp(40px, 6vw, 60px);
    letter-spacing: -0.01em;
    margin-bottom: 28px;
}

.letter h2 {
    font-size: 26px;
    margin: 52px 0 12px;
}

.letter p,
.letter li {
    font-family: var(--serif);
    font-size: 20px;
    line-height: 1.62;
    margin: 0 0 18px;
}

.letter .letter-first { font-size: 23px; line-height: 1.55; }

.letter p a,
.letter dd a,
.notes-list a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: rgba(155, 74, 44, 0.55);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.letter p a:hover,
.letter dd a:hover,
.notes-list a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Name and photo: a large photo with the name set at its foot */
.letter-head {
    display: flex;
    align-items: flex-end;
    gap: 36px;
    margin-bottom: 40px;
}

.letter-head h1 {
    margin-bottom: 0;
    padding-bottom: 2px;
    font-size: clamp(38px, 4.6vw, 50px);
    line-height: 1.08;
}

.portrait {
    flex: none;
    display: block;
    width: 260px;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 4px;
    background: #ddd;
}

/* Small two-column lists: label on the left, text on the right */
.index {
    margin: 40px 0;
    border-top: 1px solid var(--rule);
}

.index > div {
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
}

.index dt {
    font-size: 14px;
    color: var(--muted);
    padding-top: 4px;
}

.index dd {
    margin: 0;
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.5;
}

.index-years dt { font-variant-numeric: tabular-nums; }

.letter h2 + .index { margin-top: 18px; }

/* Screenshots */
.shot { margin: 44px 0; }

.shot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--rule);
    background: #111;
}

.shot a { display: block; }

.shot figcaption {
    margin-top: 10px;
    font-size: 14px;
    color: var(--muted);
}

.signoff { margin-top: 44px !important; }

.aside-note {
    font-family: var(--sans) !important;
    font-size: 15px !important;
    color: var(--muted);
}

/* ---------- Home: the green poster ---------- */
.poster {
    background: var(--green);
    color: var(--cream);
    overflow: hidden;
    padding-top: 56px;
}

.poster-inner {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 48px;
    align-items: end;
}

.poster h1 {
    color: var(--cream);
    font-size: clamp(64px, 10vw, 132px);
    line-height: 0.9;
    letter-spacing: -0.03em;
    margin: 0 0 30px;
}

.poster-tagline {
    font-family: var(--serif);
    font-size: 22px;
    line-height: 1.5;
    color: #cfd8cf;
    max-width: 24em;
    margin: 0 0 28px;
}

.poster-photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.home-text { padding-top: 64px; }

/* Two buttons under the tagline */
.poster-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 64px;
}

.btn.btn-ghost-cream {
    border-color: rgba(239, 230, 211, 0.45);
    color: var(--cream) !important;
}

.btn.btn-ghost-cream:hover { background: rgba(239, 230, 211, 0.1); border-color: var(--cream); }


.home-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.letter .home-links li { margin: 0; }

.home-links a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
    padding: 18px 20px 20px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 4px;
    text-decoration: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.home-links a:hover { border-color: var(--accent); background: #fff; }

.home-link-name {
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 600;
    color: var(--ink);
}

.home-link-text {
    font-family: var(--sans);
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-soft);
}

/* Green title band on inner pages, lined up with the text column */
.band {
    background: var(--green);
    color: var(--cream);
    padding: 56px 0 52px;
}

.band-inner { max-width: calc(var(--column) + 48px); }

.band h1 {
    color: var(--cream);
    font-size: clamp(44px, 6vw, 68px);
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0 0 18px;
}

.band p {
    font-family: var(--serif);
    font-size: 21px;
    line-height: 1.5;
    color: #cfd8cf;
    max-width: 32em;
    margin: 0;
}

.band-large { padding: 88px 0 80px; }
.band-large h1 { font-size: clamp(56px, 9vw, 112px); line-height: 0.95; margin: 0; }

.band .band-action { margin-top: 28px; }

/* The About heading typing itself out (renderTyping in site.js). */
h1.is-typing { position: relative; }
.type-char { visibility: hidden; }
.type-char.is-on { visibility: visible; }
.type-caret { position: absolute; width: 0.055em; height: 0.82em; border-radius: 1px; background: currentColor; pointer-events: none; transition: opacity 0.4s ease; }
.type-caret.is-resting { animation: type-blink 1.05s steps(1) infinite; }
.type-caret.is-gone { opacity: 0; animation: none; }
@keyframes type-blink { 50% { opacity: 0; } }

/* ---------- The fish in the green band ---------- */
/* The whole band is its pond. The words sit above it and it swims round them. */
.band { position: relative; isolation: isolate; }
.band > :not(.fish) { position: relative; z-index: 1; }

.fish {
    --fish-line: 1.8px;
    position: absolute;
    overflow: hidden;
    inset: 0;
    z-index: 0;
    color: var(--cream);
    pointer-events: none;
    view-transition-name: fish;
}

.fish.no-room { visibility: hidden; }
.fish-art { display: block; width: 100%; height: 100%; overflow: visible; }
.fish-line { fill: none; stroke: currentColor; stroke-width: var(--fish-line); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fish-detail { opacity: 0.6; }
.fish-one.is-small .fish-detail { display: none; }
/* Each kind of fish: body, fins, the far (shadowed) fin, marks, and the inside of an open mouth. */
.fish-goldfish { --skin: #c9683f; --fin: #dc8350; --fin-far: #a24a26; --mark: #8f3a1c; --gape: #5b2414; }
.fish-perch { --skin: #b5a046; --fin: #d0663a; --top: #9a8a3c; --fin-far: #8a4a26; --mark: #3d4a24; --gape: #3a2810; }
.fish-trout { --skin: #aab6b8; --fin: #8e9ea2; --top: #8e9ea2; --fin-far: #6b7a7e; --mark: #2c3a3c; --back: #5f7579; --gape: #2c3436; }
.fish-fill { fill: var(--skin); }
.fish-fill.fish-fin-fill,
.fish-fill.fish-tail-fill { fill: var(--fin); }
.fish-fill.fish-top-fill { fill: var(--top, var(--fin)); }
.fish-back { fill: var(--back, none); }
.fish-marks { fill: var(--mark); stroke: none; }
.fish-fin-spot { fill: var(--mark); }
.fish-brow { stroke-width: calc(var(--fish-line) * 1.3); }
.fish-shine { stroke-width: calc(var(--fish-line) * 1.15); }
.fish-sketch { stroke-width: calc(var(--fish-line) * 0.6); opacity: 0.7; }
.fish-fin-far { fill: var(--fin-far); }
.fish-fin-near { fill: var(--fin); }
.fish-eye-white { fill: var(--cream); }
.fish-pupil { fill: var(--green); }
.fish-glint { fill: #fff; }
.fish-mouth.is-open { fill: var(--gape); }
.fish-tackle:not(.is-on) { display: none; }
.fish-cast-line { fill: none; stroke: currentColor; stroke-width: 1px; opacity: 0.55; vector-effect: non-scaling-stroke; }
.fish-lure-body { fill: #c9452f; stroke: currentColor; stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.fish-lure-stripe { fill: none; stroke: currentColor; stroke-width: 2.2px; vector-effect: non-scaling-stroke; }
.fish-lure-hook { fill: none; stroke: currentColor; stroke-width: 1.3px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.fish-bubbles circle,
.fish-bubbles path { fill: none; stroke: currentColor; stroke-width: 1.5px; vector-effect: non-scaling-stroke; opacity: 0.75; }

@media (max-width: 820px) {
    .fish { --fish-line: 1.4px; }
}

@media (min-width: 1200px) {
    .fish { --fish-line: 2.3px; }
}

.btn.btn-cream {
    background: var(--cream);
    border-color: var(--cream);
    color: var(--green) !important;
}

.btn.btn-cream:hover { background: #fff; border-color: #fff; }

.letter { padding-top: 56px; }

/* The header is green on every page and joins the poster or band below it */
body.green-top .site-header,
body.green-top .site-header.scrolled { background: var(--green); border-bottom-color: transparent; }
body.green-top .brand,
body.green-top .site-nav a { color: var(--cream); }
body.green-top .site-nav a:hover { color: #fff; }
body.green-top .lang-switch { border-left-color: rgba(239, 230, 211, 0.22); }
body.green-top .lang-switch button { color: rgba(239, 230, 211, 0.6); }
body.green-top .lang-switch button.active,
body.green-top .lang-switch button:hover { color: var(--cream); }
body.green-top .menu-toggle { color: var(--cream); border-color: rgba(239, 230, 211, 0.3); }
body.green-top a:focus-visible,
body.green-top button:focus-visible { outline-color: var(--cream); }
body.green-top .letter a:focus-visible,
body.green-top .letter button:focus-visible,
body.green-top .letter input:focus-visible,
body.green-top .letter select:focus-visible,
body.green-top .letter textarea:focus-visible { outline-color: var(--ink); }
body.green-top .band a:focus-visible { outline-color: var(--cream); }

/* ---------- "In development" status mark ---------- */
.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 6px;
    border-radius: 999px;
    background: rgba(155, 74, 44, 0.07);
    color: var(--accent);
    font: 600 11.5px/1 var(--sans);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}

.status-icon { flex: none; width: 15px; height: 15px; }

.status-orbit { transform-box: fill-box; transform-origin: center; }

/* One slow turn when the page opens, then rest */
@media (prefers-reduced-motion: no-preference) {
    .status-orbit { animation: status-turn 2.4s cubic-bezier(0.3, 0.7, 0.2, 1) 0.4s 1; }
}

@keyframes status-turn { to { transform: rotate(1turn); } }

.status.status-live { color: var(--live); background: rgba(42, 99, 69, 0.09); }

.band .status,
.band .status.status-live { color: var(--cream); background: rgba(239, 230, 211, 0.1); }

.band .crumb-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 10px; }
.band .crumb-row .crumb { margin: 0; }

/* ---------- AI section tabs, at the foot of the green band ---------- */
.band.has-subnav { padding-bottom: 0; }

.subnav { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 36px; }

.subnav a {
    padding: 0 0 14px;
    border-bottom: 3px solid transparent;
    font: 500 16px/1.2 var(--sans);
    color: rgba(239, 230, 211, 0.8);
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}

.subnav a:hover { color: var(--cream); border-bottom-color: rgba(239, 230, 211, 0.35); }
.subnav a[aria-current="page"] { color: var(--cream); font-weight: 600; border-bottom-color: var(--cream); }

@media (max-width: 400px) {
    .subnav { column-gap: 20px; }
    .subnav a { font-size: 14px; }
}

/* ---------- Page transitions: a project's cover grows into its page ---------- */
@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
}

.site-header { view-transition-name: site-header; }
.plate-anatomy { view-transition-name: cover-anatomy; }
.plate-dostext { view-transition-name: cover-dostext; }
.plate-takstamera { view-transition-name: cover-takstamera; }

::view-transition-group(*) {
    animation-duration: 0.5s;
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Project covers ---------- */
.plate {
    position: relative;
    display: block;
    aspect-ratio: 1600 / 920;
    overflow: hidden;
    border-radius: 4px;
    background: #111;
    color: var(--cream);
    container-type: inline-size;
}

.plate img { display: block; width: 100%; height: 100%; object-fit: cover; }
.plate-dostext { background: #1f2b3a; }
.plate-takstamera { background: #5a2f1e; }

.plate-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.plate-motif { opacity: 0.24; }

/* Fine hatching over covers of projects still in development: under wraps */
.plate.is-dev::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(135deg, rgba(239, 230, 211, 0.045) 0 1px, transparent 1px 11px);
    pointer-events: none;
}

.plate-name {
    position: absolute;
    left: 6%;
    bottom: 12%;
    font: 600 clamp(22px, 9cqi, 96px)/1 var(--serif);
    color: var(--cream);
}

.plate-dostext .plate-name { letter-spacing: 0.05em; }

/* The big arc sweeps round once when a cover first appears */
@media (prefers-reduced-motion: no-preference) {
    .plate-arc {
        transform-box: fill-box;
        transform-origin: center;
        animation: status-turn 2.8s cubic-bezier(0.3, 0.7, 0.2, 1) 0.3s 1;
    }
}

/* ---------- AI: the project grid ---------- */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 32px; }
.pcard { position: relative; }
.pcard.is-wide { grid-column: 1 / -1; }
.pcard .plate { margin-bottom: 18px; }
.pcard-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.pcard-head .status { margin-left: auto; }
.letter .pcard h2 { font: 600 24px/1.25 var(--serif); margin: 0; color: var(--ink); }
.letter .pcard.is-wide h2 { font-size: 30px; }
.pcard h2 a { text-decoration: none; }
/* The whole card is the link */
.pcard h2 a::before { content: ""; position: absolute; inset: 0; }
.pcard h2 a:hover { color: var(--accent); }
.letter .pcard p { font-size: 17px; line-height: 1.55; color: var(--ink-soft); margin: 6px 0 0; }

/* ---------- Project pages ---------- */
.cover { margin: 0 0 44px; }
.letter .facts { margin-top: 0; }
.band h1.caps { letter-spacing: 0.02em; }

.next-project { margin-top: var(--section-gap); padding-top: 24px; border-top: 1px solid var(--rule); }

.next-link {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 240px);
    align-items: center;
    gap: 24px;
    text-decoration: none;
}

.next-label { display: block; font: 600 14px/1.3 var(--sans); color: var(--muted); }
.next-name { display: block; margin-top: 6px; font: 600 34px/1.15 var(--serif); color: var(--ink); }
.next-name::after { content: " →"; color: var(--accent); font-weight: 400; }
.next-link:hover .next-name { color: var(--accent); }

.next-all {
    display: inline-block;
    margin-top: 18px;
    font: 15px/1.4 var(--sans);
    color: var(--ink-soft);
    text-decoration-color: rgba(155, 74, 44, 0.55);
    text-underline-offset: 3px;
}

.next-all:hover { color: var(--accent); }

@media (min-width: 900px) {
    .pgrid, .cover { margin-left: -64px; margin-right: -64px; }
}

/* ---------- Letter sections: one gap between every section ---------- */
.letter { --section-gap: 64px; }
.letter > .skills,
.letter > .dev,
.letter > #builtSection { margin-block: var(--section-gap); }
.letter > :last-child { margin-bottom: 0; }

/* ---------- Lists of named things: skills, in the works, also built ---------- */
.letter .skills-list dt,
.dev-head h3,
.built-list h3 { font: 600 21px/1.3 var(--serif); color: var(--ink); margin: 0; }

.letter .skills-list dd,
.letter .dev-item p,
.letter .built-list p {
    font-family: var(--serif);
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink-soft);
    margin: 4px 0 0;
}

.dev-list,
.built-list { list-style: none; margin: 0; padding: 0; }

.letter .dev-item,
.letter .built-list li { position: relative; margin: 0; padding: 16px 0; border-top: 1px solid var(--rule); }

.letter .dev-item:first-child,
.letter .built-list li:first-child { border-top: 0; padding-top: 0; }

.letter .dev-item:last-child,
.letter .built-list li:last-child { padding-bottom: 0; }

.dev-head { display: flex; align-items: center; gap: 6px 16px; }
.dev-head .status { margin-left: auto; }
.dev-head h3.caps { letter-spacing: 0.04em; }

.dev-head h3 a,
.built-list h3 a { text-decoration: none; }
.dev-head h3 a::after { content: " →"; color: var(--accent); font-weight: 400; }
/* The whole row is the link */
.dev-head h3 a::before { content: ""; position: absolute; inset: 0; }
.dev-head h3 a:hover,
.built-list h3 a:hover { color: var(--accent); }

/* ---------- Home: skills, clinical and business ---------- */
/* Two columns whose rows line up: each column shares the outer grid's five rows */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(5, auto);
    column-gap: 48px;
}

.skills-col { display: grid; grid-row: span 5; grid-template-rows: subgrid; }
.skills-list { display: grid; grid-row: span 4; grid-template-rows: subgrid; margin: 0; }

.skills-kind {
    font: italic 400 19px/1.3 var(--serif);
    color: var(--ink-soft);
    margin: 0 0 12px;
}

.skills-list > div { padding: 0 0 20px; }
.skills-list > div:last-child { padding-bottom: 0; }

/* Fewer lonely last words */
.letter p,
.letter dd { text-wrap: pretty; }

/* Section headings on the AI page */
.letter h2.group-title {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rule);
}



/* "AI /" above a project title */
.band .crumb { font-family: var(--sans); font-size: 15px; margin: 0 0 10px; color: rgba(239, 230, 211, 0.7); }
.band .crumb a { color: var(--cream); text-decoration: none; }
.band .crumb a:hover { text-decoration: underline; }

.letter .project-links {
    font-family: var(--sans);
    font-size: 15px;
    color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    font: 600 15px/1 var(--sans);
    padding: 13px 20px;
    border-radius: 4px;
    text-decoration: none !important;
    border: 1px solid var(--ink);
    color: var(--ink) !important;
    background: transparent;
    cursor: pointer;
}

.btn:hover { background: rgba(31, 43, 58, 0.06); }

.btn-solid { background: var(--ink); color: #fff !important; }
.btn-solid:hover { background: #2d3d52; }

.btn:disabled { opacity: 0.6; cursor: default; }

/* ---------- Contact form ---------- */
.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
    margin: 36px 0 16px;
}

.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--ink-soft);
}

.contact-form .full { grid-column: 1 / -1; }

.contact-form input,
.contact-form select,
.contact-form textarea {
    font: 400 17px/1.4 var(--sans);
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 12px 14px;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus { border-color: var(--ink-soft); }

.contact-form textarea { min-height: 180px; resize: vertical; }

.contact-form .hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.form-status { font-size: 15px; color: var(--ink-soft); }
.form-status.error { color: #a3352b; }
.form-status.ok { color: #2f6b45; }

/* ---------- Notes ---------- */
.notes-list { list-style: none; margin: 32px 0; padding: 0; }

.letter .notes-list li { padding: 14px 0; border-top: 1px solid var(--rule); margin: 0; }

.notes-list time { display: block; font-family: var(--sans); font-size: 14px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--rule);
    padding: 32px 0 44px;
    font-size: 14px;
    color: var(--muted);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-inner nav { display: flex; gap: 20px; flex-wrap: wrap; }

.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--ink); }

/* ---------- Small screens ---------- */
@media (min-width: 900px) {
    /* Screenshots may run a little wider than the text */
    .shot-wide { margin-left: -64px; margin-right: -64px; }
}

@media (max-width: 820px) {
    .menu-toggle { display: block; }

    .site-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--rule);
        padding: 4px 24px 20px;
    }

    .site-header.open .site-nav { display: flex; }

    .site-nav a {
        padding: 14px 0;
        border-bottom: 1px solid var(--rule);
        font-size: 17px;
    }

    .site-nav a[aria-current="page"] { text-decoration: none; color: var(--accent); }

    .lang-switch { border-left: 0; padding-left: 0; margin-top: 14px; margin-left: -6px; }

    body.green-top .site-nav { background: var(--green); border-bottom-color: rgba(239, 230, 211, 0.15); }
    body.green-top .site-nav a { border-bottom-color: rgba(239, 230, 211, 0.15); }
    body.green-top .site-nav a[aria-current="page"] { color: var(--cream); }

    .poster { padding-top: 40px; }
    .band { padding: 40px 0 36px; }
    .band-large { padding: 56px 0 52px; }
    .band p { font-size: 19px; }
    .poster-inner { grid-template-columns: 1fr; gap: 0; }
    .poster-tagline { margin-bottom: 24px; }
    .poster-actions { margin: 0 0 36px; }
    .poster-photo { max-width: 240px; margin: 0 auto; }
    .home-text { padding-top: 48px; }
}

@media (max-width: 640px) {
    .wrap { padding: 0 20px; }
    .letter { padding-top: 40px; padding-bottom: 64px; }
    .letter p, .letter li { font-size: 19px; }
    .letter .letter-first { font-size: 20px; }
    .letter-head { flex-direction: column; align-items: flex-start; gap: 20px; margin-bottom: 28px; }
    .portrait { width: min(240px, 68%); }
    .index > div { grid-template-columns: 1fr; gap: 0; }
    .index dt { padding-top: 0; }
    .contact-form { grid-template-columns: 1fr; }
    .home-links { grid-template-columns: 1fr; }
    .letter { --section-gap: 48px; }
    .skills-grid, .skills-col, .skills-list { display: block; }
    .skills-col + .skills-col { margin-top: 32px; }
    .pgrid { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 480px) {
    .dev-head, .pcard-head { flex-direction: column; align-items: flex-start; }
    .dev-head .status, .pcard-head .status { margin-left: 0; }
    .next-link { grid-template-columns: minmax(0, 1fr) 120px; gap: 16px; }
    .next-name { font-size: 26px; }
}

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