/* ============================================================
   mikeastwood.dev · the homepage, both languages (/ and /es/)
   ------------------------------------------------------------
   The 2026-11-03 redesign the captain approved: black page,
   Verdana, copper links, three columns that stack on a phone with
   the centre column first. It is a deliberate departure from the
   shared design system, so this page loads neither
   shared/base.css nor personal.css. The only other pages that load
   this file are the articles (/<slug>/ and /es/<slug>/) and the
   logbook (/logbook/ and /es/logbook/), which wear its header, bar
   and footer and add article.css on top, so retuning it restyles
   / and /es/, every article page and both logbook pages.
   shared/og/_card.html reads it for the home card too, so re-cut
   shared/og/home.jpg after retuning it.

   Everything renders without JavaScript: no [data-reveal], the
   photo viewer falls back to :target, and the search form stays
   hidden until home.js turns it on.
   ============================================================ */

/* Ultra, cut to the letters of the banner and of the header's name (README → The banner).
   Its licence is shared/fonts/LICENSE-Ultra.txt. */
@font-face {
  font-family: "Ultra"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("shared/fonts/ultra-subset.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #0a0a0a;
  --header: #0b0b0b;
  --text: #e5e5e5;
  --text-2: #c9c9c9;
  --text-3: #a3a3a3;
  --link: #c98a52;
  --link-hover: #f0e4c6;
  --ink: #e8dfcb;
  --green: #3fd38c;
  --amber: #febc2e;
  --card-title: #d9c7a3;
  --line: #222;
  --line-2: #2a2a2a;
  --line-3: #333;
  --card-line: #4a3a28;
  --card-bg: linear-gradient(180deg, #17120c, #0a0a0a);
  --accent: #c98a52;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Verdana, Tahoma, Geneva, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }

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

:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  padding: 10px 14px; background: #fff; color: #000; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- page shell ---- */
.page { min-height: 100vh; padding: 16px 12px 48px; }
.page__inner { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }

/* ---- header: brand, search, language ---- */
.top {
  border: 1px solid var(--line-2); background: var(--header); padding: 12px 14px;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__mark { flex: none; }
/* The width is Ultra's own, measured: the box holds it before the font arrives, so the swap from
   Georgia cannot rewrap the header at narrow widths and shift everything under it. */
.brand__name { width: 9.8em; font-family: Ultra, Georgia, serif; font-size: 21px; font-weight: 400; line-height: 1; letter-spacing: 0.02em; white-space: nowrap; color: var(--ink); }

.search { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.search label { font-size: 11px; color: var(--text-3); }
.search input {
  font: inherit; width: 200px; max-width: 46vw; padding: 6px 8px;
  border: 1px solid #555; border-radius: 0; background: #fff; color: #000;
}
.search input::placeholder { color: #595959; opacity: 1; }
.search button {
  font: inherit; font-weight: 700; padding: 6px 12px; min-height: 32px;
  border: 1px solid #777; border-radius: 12px; background: linear-gradient(#f2f2f2, #b5b5b5);
  color: #111; cursor: pointer;
}
.search__status { flex-basis: 100%; font-size: 11px; color: var(--text-3); }

.top__side { font-size: 11px; text-align: right; color: var(--text-3); display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.top__side > a { display: inline-block; padding: 4px 2px; min-height: 26px; line-height: 18px; }
.lang { display: flex; gap: 6px; align-items: center; }
.lang a { display: inline-block; padding: 4px 2px; min-height: 28px; line-height: 20px; }
.lang a[aria-current] { color: #fff; font-weight: 700; text-decoration: none; }

/* ---- section bar ---- */
.sections {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 0 4px;
}
.sections__group { display: flex; flex-wrap: wrap; gap: 0 14px; }
.sections a { display: inline-block; padding: 5px 0; }
.sections .is-home { color: var(--ink); }

/* ---- banner ----
   The canvas's positions at its 1040 x 260, kept proportional to the image below that. It holds
   the 4:1 cut of assets/banner/ until a phone, where the title would shrink to 17 px; there
   the page's <source> takes the taller cut and the title sits in its sky (README → The banner).
   The title is out of flow, so the font's swap moves nothing. */
.banner {
  container-type: inline-size; position: relative; flex: none; aspect-ratio: 4 / 1; overflow: hidden;
  border: 1px solid #1c1c1c; background: #0a0a0a;
}
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner h1 {
  position: absolute; left: 18.27cqw; top: 3.27cqw;
  font-family: Ultra, Georgia, serif; font-weight: 400; font-size: 5.77cqw;
  line-height: 1.05; letter-spacing: 0.005em; white-space: nowrap; color: var(--ink);
}
@media (min-width: 1000px) {
  .banner { aspect-ratio: auto; height: 260px; }
  /* The image is cropped evenly at the sides from here up, so this holds the title on the same
     spot of it: 190 px from the edge of the canvas's 1040. */
  .banner h1 { left: calc(50% - 330px); top: 34px; font-size: 60px; }
}
@media (max-width: 600px) {
  .banner { aspect-ratio: 5041 / 1894; }
  .banner h1 { left: 12.7cqw; top: 3.6cqw; font-size: 7.7cqw; }
}

.intro { text-align: center; font-size: 12px; color: var(--text-2); }

/* ---- the three columns ---- */
.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.col--side { flex: 1 1 220px; }
.col--center { flex: 2.4 1 460px; gap: 14px; }

.col-title { font-size: 12px; text-align: center; font-weight: 400; }

/* ---- apps ---- */
.apps { list-style: none; padding: 0; border: 1px solid var(--line); background: var(--panel); }
.app { display: flex; gap: 12px; padding: 12px; border-bottom: 1px dotted var(--line-3); align-items: flex-start; }
.apps > li:last-child .app { border-bottom: 0; }
.app__icon { flex: none; display: block; line-height: 0; }
.app__icon img { width: 64px; height: 64px; border-radius: 15px; border: 1px solid var(--line-2); }
.app__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.app h3 { font-size: 14px; }
.app h3 a { font-weight: 700; }
.app p { font-size: 12px; color: var(--text-2); }
/* Apple's badge rules: 40 px tall on screen, clear space a quarter of that (10 px)
   on every side, the artwork itself never touched. The column gap is 6 px, so the
   badge's own 4 px margin makes 10 above and below; the icon column sits 12 px away. */
.app__store { display: inline-block; line-height: 0; align-self: flex-start; margin: 4px 0; }
.app__store img { height: 40px; width: auto; }
.app__try {
  align-self: flex-start; font-size: 12px; font-weight: 700; padding: 10px 14px; min-height: 40px;
  border-radius: 8px; background: #4f46e5; color: #fff; text-decoration: none;
  display: flex; align-items: center;
}
.app__try:hover { color: #fff; background: #4338ca; }
.app__site { font-size: 11px; align-self: flex-start; padding: 2px 0; }

/* ---- photo viewer ----
   No JS: every slide is in the markup, the first one shows, and a thumbnail or a
   « / » link targets #photo-N, which :target brings forward. home.js adds
   .is-enhanced and drives .is-current instead, without the scroll jump. */
.viewer { display: flex; flex-direction: column; gap: 14px; }
.slide { display: none; flex-direction: column; gap: 14px; }
.viewer:not(.is-enhanced) .slide:first-child,
.viewer:not(.is-enhanced) .slide:target { display: flex; }
.viewer:not(.is-enhanced) .viewer__slides:has(.slide:target) .slide:first-child:not(:target) { display: none; }
.viewer.is-enhanced .slide.is-current { display: flex; }

.slide__nav { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.slide__nav a { text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; gap: 4px; }
.slide__nav a span { text-decoration: underline; }
.slide__count { color: var(--text-3); }

.frame { border: 1px solid var(--line-2); background: var(--panel); padding: 10px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.frame img { width: 100%; max-width: 520px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line-3); }
.frame figcaption { font-size: 12px; color: var(--text-2); text-align: center; }

.thumbs { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.thumb { display: block; border: 2px solid var(--line); background: #000; aspect-ratio: 1 / 1; min-height: 44px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { border-color: var(--link); }
/* Without JS the ring follows :target; home.js sets aria-current instead. */
.viewer:not(.is-enhanced):not(:has(.slide:target)) .thumbs li:first-child .thumb,
.viewer:not(.is-enhanced):has(.slide[data-n="1"]:target) .thumb[data-n="1"],
.viewer:not(.is-enhanced):has(.slide[data-n="2"]:target) .thumb[data-n="2"],
.viewer:not(.is-enhanced):has(.slide[data-n="3"]:target) .thumb[data-n="3"],
.viewer:not(.is-enhanced):has(.slide[data-n="4"]:target) .thumb[data-n="4"],
.viewer:not(.is-enhanced):has(.slide[data-n="5"]:target) .thumb[data-n="5"],
.viewer:not(.is-enhanced):has(.slide[data-n="6"]:target) .thumb[data-n="6"],
.viewer:not(.is-enhanced):has(.slide[data-n="7"]:target) .thumb[data-n="7"] { border-color: var(--link); }

/* ---- introduction card ---- */
.card { border: 1px solid var(--card-line); background: var(--card-bg); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card__title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--card-title); }
.card__who { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.card__avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.card__id { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card__name { font-size: 20px; font-weight: 700; color: #fff; }
.card__role { font-size: 12px; color: var(--text-3); }
.card__bio { font-size: 13px; }
.card__values { padding-left: 18px; font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.card__links { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.card__links a {
  min-height: 44px; display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid var(--line-3); background: #111; text-decoration: none; font-size: 12px; padding: 4px;
}
.card__contact {
  align-self: center; font-size: 12px; font-weight: 700; padding: 10px 16px; min-height: 44px;
  border-radius: 14px; background: linear-gradient(#ffffff, #c9c9c9); color: #111; text-decoration: none;
  display: flex; align-items: center; text-align: center;
}
.card__contact:hover { color: #000; }

/* ---- open source: one .project per project, newest contribution first ---- */
.oss { display: flex; flex-direction: column; gap: 10px; }
.project { display: flex; flex-direction: column; gap: 10px; }
.term { border: 1px solid #3a3a3a; background: #050505; }
.term__bar { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: linear-gradient(#2a2a2a, #161616); border-bottom: 1px solid #3a3a3a; }
.term__dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.term__dot--r { background: #ff5f57; }
.term__dot--y { background: #febc2e; }
.term__dot--g { background: #28c840; }
.term__title { flex: 1; text-align: center; font-size: 11px; color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.term__body { padding: 14px 16px; font-family: "Courier New", Menlo, monospace; font-size: 12px; line-height: 1.7; display: flex; flex-direction: column; gap: 6px; }
.term__cmd { color: var(--text-3); overflow-wrap: anywhere; }
.term__log { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.term__row { display: flex; gap: 4px 10px; flex-wrap: wrap; }
.term__state { min-width: 112px; }
.term__state--merged { color: var(--green); }
.term__state--review { color: var(--amber); }
.term__state--proposal { color: var(--link); }
.term__ref { color: var(--amber); }
.term__ref:hover { color: #ffe3a3; }
.term__date { color: var(--text-3); }
.term__text { color: var(--text); flex: 1 1 100%; overflow-wrap: anywhere; }
.term__prompt { margin-top: 4px; color: var(--green); }
.term__cursor { display: inline-block; width: 9px; height: 15px; background: var(--green); vertical-align: text-bottom; }
.project__card { border: 1px solid var(--card-line); background: var(--card-bg); padding: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.project__about { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.project__card h3 { font-size: 15px; }
.project__card h3 a { color: #fff; font-weight: 700; }
.project__meta { font-size: 11px; font-weight: 400; color: var(--text-3); }
.project__card p { font-size: 12px; color: var(--text-2); }
.project__prs { font-size: 12px; padding: 4px 0; }

/* ---- articles: newest first ---- */
.articles { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.article { border: 1px solid var(--line); background: var(--panel); padding: 10px; display: flex; flex-direction: column; gap: 6px; text-align: center; }
.article img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line-3); }
.article__date { font-size: 11px; color: var(--text-3); }
.article h3 { font-size: 13px; }
.article h3 a { font-weight: 700; }
.article p { font-size: 12px; color: var(--text-2); }

/* ---- footer ---- */
.foot { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); text-align: center; font-size: 11px; color: var(--text-3); }

/* ---- phone: the centre column goes first, as the «Móvil» board shows ---- */
@media (max-width: 760px) {
  .col--center { order: -1; }
}
@media (max-width: 380px) {
  .card__links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
