/* The homepage. One typeface (Mona Sans, the face of James's Wayfinder
   visuals), a white page, ink and one tile grey. The hero speaks the bento's
   own language: the same column, corners and gap. The look is recorded in
   DESIGN.md in the James_Kerr_Personal_Site project; the bento under the hero
   is built from that project into bento.js and bento.css beside this file. */

@font-face { font-family: "Mona Sans"; font-style: normal; font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; src: url("/assets/fonts/mona-sans-latin.woff2") format("woff2"); }

:root {
  --ink: #0f1115;
  --tile: #f4f4f5;
  --grey: #5e6168;
  --line: #e4e4e7;
  --gutter: clamp(20px, 5vw, 72px);
  --column: 1120px;
  --gap: 12px;
  --radius: 6px;
  --sans: "Mona Sans", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: #c9c9ce #fff; }
body { margin: 0; background: #fff; color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
::selection { background: var(--ink); color: #fff; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1, h2 { margin: 0; text-wrap: balance; }

.skip-link { position: absolute; left: 12px; top: -80px; z-index: 20; padding: 10px 14px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; }
.skip-link:focus { top: 12px; }

.arrow { width: 11px; height: 11px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: min(var(--column), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- the menu ----------
   One row. On the narrowest phones (under 360px) the links drop to a second
   row under the name, so neither is squeezed. */

.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; padding-block: 20px; }
.mark { display: inline-flex; align-items: center; gap: 10px; padding: 6px 0; white-space: nowrap; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; }
.star { width: 22px; height: 22px; flex: none; }
.bar nav { display: flex; gap: clamp(18px, 2.6vw, 34px); font-size: 15px; font-weight: 500; }
.bar nav a { padding: 11px 0; text-decoration: none; }
.bar nav a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.3em; }

/* ---------- hero: two tiles on the grid's three columns ----------
   The claim is an ink tile across two columns; a real photograph of James is a
   tile in the third. Column, corners and gap are the bento's, so the page reads
   as one grid from the top. */

.hero-stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.hero-copy { grid-column: span 2; display: flex; flex-direction: column; justify-content: flex-end; min-height: min(clamp(430px, 58vh, 580px), 52vw); padding: clamp(28px, 4vw, 52px); border-radius: var(--radius); background: var(--ink); color: #fff; }
.hero-copy ::selection { background: #fff; color: var(--ink); }
.hero-copy :focus-visible { outline-color: #fff; }
.hero h1 { font-size: clamp(1.85rem, 3.45vw, 3.1rem); font-weight: 650; font-stretch: 108%; line-height: 1.05; letter-spacing: -0.032em; }
/* The second sentence of the claim takes its own tight turn */
.hero-turn { display: block; margin-top: 0.16em; }
.hero-line { display: block; }
.hero p { max-width: 37rem; margin: clamp(18px, 2vw, 24px) 0 0; font-size: clamp(1.02rem, 1.2vw, 1.13rem); line-height: 1.48; color: rgb(255 255 255 / 0.86); text-wrap: pretty; }
.hero p.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; margin-top: clamp(22px, 2.6vw, 30px); color: #fff; }

/* The one button: white on the ink tile, with the tile's corner; it inverts whole on hover */
.btn { display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 22px; border-radius: var(--radius); background: #fff; color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; box-shadow: inset 0 0 0 1.5px #fff; transition: background-color 0.18s ease, color 0.18s ease; }
.btn:hover { background: transparent; color: #fff; }
.text-link { display: inline-flex; align-items: center; gap: 7px; padding: 12px 0; font-size: 15px; font-weight: 500; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.3em; }

/* A real photograph of James in its own colour, cropped by its tile */
.hero-photo { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--ink); }
.hero-photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }

/* ---------- sections ----------
   Three plain titles in his own words: what he is building, what he is
   writing, and who he is. Each keeps the grid's column, corners and gap. */

main > section, main > .wrap { margin-top: clamp(56px, 7vw, 96px); }
main > .hero { margin-top: 0; }
main h2 { margin: 0 0 1.1rem; font-size: clamp(1.35rem, 1.9vw, 1.6rem); font-weight: 600; font-stretch: 108%; line-height: 1.15; letter-spacing: -0.02em; }
.section-head { margin-bottom: 1.25rem; }
.section-head h2 { margin-bottom: 0.35rem; }
.section-lead { max-width: 41rem; margin: 0; color: var(--grey); font-size: 15px; line-height: 1.48; text-wrap: pretty; }
.work, .writing { --jk-font: var(--sans); }

/* Guides and diagnostics: three working tools on the same three-column grid, cropped at the bottom */
.diag-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.diag-tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 282px; overflow: hidden; border-radius: var(--radius); background: var(--tile); text-decoration: none; }
.diag-go { position: absolute; top: 19px; right: 24px; z-index: 2; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgb(15 17 21 / 0.07); color: var(--ink); opacity: 0; transform: translate(-3px, 0); transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.diag-go svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.diag-tile:hover .diag-go, .diag-tile:focus-visible .diag-go { opacity: 1; transform: none; }
.diag-copy { position: relative; z-index: 1; margin: 0; padding: 20px 24px 0; font-size: 15px; line-height: 22px; letter-spacing: -0.008em; color: var(--grey); text-wrap: pretty; }
.diag-copy b { display: block; padding-right: 32px; color: var(--ink); font-weight: 600; }
.diag-line { display: block; margin-top: 3px; }
.diag-more { display: block; margin-top: 2px; font-size: 14px; color: var(--ink); opacity: 0; transform: translateY(3px); transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.diag-tile:hover .diag-more, .diag-tile:focus-visible .diag-more { opacity: 1; transform: none; }
@media (hover: none) {
  .diag-go { opacity: 0.75; transform: none; }
  .diag-more { opacity: 1; transform: none; }
}
.diag-shot { padding: 16px 24px 0; margin-top: auto; }
.diag-card { min-height: 132px; padding: 12px 14px 14px; border-radius: 8px 8px 0 0; background: #fff; box-shadow: 0 0 0 1px rgb(15 17 21 / 0.08), 0 10px 24px -14px rgb(15 17 21 / 0.16); font-size: 12.5px; line-height: 1.3; color: var(--grey); }
.diag-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--grey); }
.diag-card-head span:first-child { color: var(--ink); font-weight: 600; }
.diag-card--rungs { display: grid; align-content: start; gap: 5px; }
.diag-rung { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: center; padding: 4px 8px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.diag-rung span:first-child { font-size: 11px; color: var(--grey); }
.diag-rung--active { background: var(--tile); color: var(--ink); font-weight: 600; }
.diag-rung--active span:first-child { color: var(--ink); }
.diag-card--matrix { display: flex; flex-direction: column; }
.diag-matrix-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; flex: 1; }
.diag-cell { display: flex; align-items: center; min-height: 36px; padding: 6px 9px; border-radius: 5px; background: var(--tile); font-size: 12px; line-height: 1.2; }
.diag-cell--active { background: var(--ink); color: #fff; font-weight: 600; }
.diag-card--tree { display: grid; align-content: start; gap: 8px; }
.diag-node { padding: 6px 10px; border-radius: 5px; background: var(--tile); font-size: 12px; color: var(--ink); }
.diag-node--root { font-weight: 600; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.diag-branches { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.diag-node--active { background: var(--ink); color: #fff; font-weight: 600; }
.diag-more-link { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin: 0.95rem 0 0; font-size: 15px; font-weight: 500; }
.diag-more-link a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 0; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.24em; text-decoration-color: #b9b9c0; transition: text-decoration-color 0.15s ease, color 0.15s ease; }
.diag-more-link a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.diag-topics { font-size: 14px; font-weight: 400; color: var(--grey); }
.diag-topics a { color: var(--grey); padding: 4px 0; }

/* The newsletter's tile in the first column, its latest issues from the second column's edge */
.writing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.writing-grid .log { grid-column: span 2; }
.log ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.log li a { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.log time { color: var(--grey); font-size: 14px; }
.log li span { font-size: 1.12rem; font-weight: 500; line-height: 1.35; letter-spacing: -0.012em; text-wrap: pretty; }
.log li a:hover span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.log p { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 1.1rem 0 0; font-size: 15px; font-weight: 500; }
.btn-quiet { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid #8a8c94; border-radius: var(--radius); background: #fff; color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease; }
.btn-quiet:hover { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Who he is: one ink rule, then three columns on the grid */
.author-bridge { padding-bottom: clamp(56px, 7vw, 96px); }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--gap); align-items: start; padding-top: 16px; border-top: 1px solid var(--ink); }
.about-lead { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr); gap: 16px; padding-right: clamp(12px, 2vw, 28px); }
.author-portrait-frame { display: block; align-self: start; overflow: hidden; border-radius: var(--radius); background: var(--tile); }
.author-portrait { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.author-bridge-role { margin: 0; font-weight: 600; }
.author-bridge-bio { margin: 4px 0 0; color: var(--grey); font-size: 15px; line-height: 1.45; text-wrap: pretty; }
.author-bridge-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; padding: 8px 0; font-size: 15px; font-weight: 500; }
.ledger { margin: 0; }
.ledger div { display: grid; grid-template-columns: 4.8rem minmax(0, 1fr); gap: 16px; padding: 0 0 13px; }
.ledger div + div { padding-top: 13px; border-top: 1px solid var(--line); }
.ledger dt { color: var(--grey); font-size: 14px; padding-top: 2px; }
.ledger dd { margin: 0; text-wrap: pretty; }
.contact { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin: -8px 0 0; font-size: 15px; font-weight: 500; }
.contact a, .log p a:not(.btn-quiet) { display: inline-flex; align-items: center; gap: 7px; padding: 8px 0; }
.contact a, .log p a:not(.btn-quiet), .author-bridge-link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.24em; text-decoration-color: #b9b9c0; transition: text-decoration-color 0.15s ease; }
.contact a:hover, .log p a:not(.btn-quiet):hover, .author-bridge-link:hover { text-decoration-color: var(--ink); }

.foot { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: baseline; padding-block: 22px 34px; border-top: 1px solid var(--line); color: var(--grey); font-size: 14px; }
.foot p { margin: 0; }
.foot-line { display: flex; flex-wrap: wrap; gap: 4px 14px; font-variant-numeric: tabular-nums; }
.foot-motto { color: var(--ink); font-weight: 500; }
.foot-copy { text-align: right; }

/* Under 1000px the bento drops to two columns, and so do these */
@media (max-width: 999px) {
  .diag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .writing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .writing-grid .log { grid-column: auto; }
  .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .contact { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 0 24px; margin-top: 0; }
}

@media (max-width: 699px) {
  .diag-grid, .writing-grid, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .writing-grid { row-gap: 20px; }
  .about-lead { padding-right: 0; }
}

@media (max-width: 820px) {
  .hero-stage { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { grid-column: auto; min-height: 0; padding: 28px 22px; }
  .hero-photo { height: clamp(300px, 112vw, 440px); }
  .hero-photo img { object-position: 50% 22%; }
  .foot { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .foot-copy { text-align: left; }
}

@media (max-width: 430px) {
  .hero h1 { font-size: clamp(1.48rem, 6.4vw, 1.66rem); text-wrap: pretty; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
