@font-face { font-family: "Carlito"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/carlito-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Carlito"; font-style: italic; font-weight: 400; font-display: swap; src: url("assets/fonts/carlito-400-italic.woff2") format("woff2"); }

:root {
  --ink: #000000;
  --dim: #000000;
  --faint: #000000;
  --rule: #000000;
  --accent: #527b8e;
  --c1: #e8f7ee;
  --c2: #527b8e;
  --c3: #0a0908;
  --bg1: #e8f7ee;
  --bg2: #dbeaee;
  --bg3: #c6d9e1;
  --sheet: #fcfdfc;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Calibri-style (Carlito). No bold anywhere: hierarchy comes from size and italics. */
html, body, h1, h2, h3, p, a, span, em, b, strong, nav, button {
  font-family: Carlito, Calibri, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
}
b, strong { font-weight: 400; }
em { font-style: italic; }
a { color: inherit; text-decoration: none; }

body {
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(155deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  padding: 14px 10px 40px;
}

.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.backdrop { position: absolute; inset: -5%; background-size: cover; background-position: center; opacity: 0; filter: blur(30px); transition: opacity 1.5s; }
.backdrop.on { opacity: 0.35; }

/* ---------- the sheet ---------- */
.sheet {
  max-width: 1360px; margin: 0 auto; min-height: calc(100vh - 54px);
  padding: 22px clamp(18px, 2.4vw, 34px) 56px;
  background:
    linear-gradient(180deg, rgba(232, 247, 238, 0.26) 0%, rgba(82, 123, 142, 0.08) 220px, rgba(255, 255, 255, 0) 360px),
    var(--sheet);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 36px rgba(10, 40, 55, 0.1);
}

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.bar nav { display: flex; gap: 26px; }
.bar nav a, .gh { font-size: 15px; letter-spacing: 0.02em; color: var(--dim); padding: 4px 0; border-bottom: 3px solid transparent; transition: color .2s, border-color .2s; }
.bar nav a:hover, .gh:hover { color: var(--ink); }
.bar nav a.active { color: var(--ink); border-bottom-color: var(--accent); }
.gh { font-style: italic; }

/* ---------- tabs ---------- */
.tab { display: none; }
.tab.on { display: block; animation: rise .5s cubic-bezier(.2, .7, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- headlines ---------- */
.page-title, .name {
  font-size: clamp(52px, 9vw, 104px); line-height: 0.98; letter-spacing: -0.025em; color: var(--ink);
}
.page-title { margin: 44px 0 6px; }

/* ---------- home ---------- */
.hero-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 28px; margin: 44px 0 0; padding-bottom: 34px; border-bottom: 1px solid var(--rule); }
.name { margin: 0; }
.hero-side { display: flex; flex-direction: column; gap: 8px; padding-left: 24px; border-left: 1px solid var(--rule); min-width: 150px; margin-bottom: 8px; }
.hero-side a { font-size: 16px; color: var(--dim); transition: color .2s; }
.hero-side a:hover { color: var(--ink); }
.hero-side span { color: var(--accent); }

.home-grid { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: clamp(28px, 5vw, 64px); margin-top: 38px; align-items: start; }
.portrait { width: 100%; aspect-ratio: 573 / 802; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 22px rgba(10, 40, 55, 0.12); }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- rows (home index, project lists) ---------- */
.index, .rows { border-bottom: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 26px 0; border-top: 1px solid var(--rule); transition: background .25s, padding .25s; }
.row:hover { background: linear-gradient(90deg, rgba(232, 247, 238, 0.28), rgba(255, 255, 255, 0)); padding-left: 10px; }
.row-title { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; }
.row-meta { font-size: 15px; color: var(--faint); line-height: 1.4; }
.row-meta em { font-style: italic; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 7px 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--rule); color: var(--ink); transition: background .2s, border-color .2s;
}
.pill span { color: var(--accent); }
.pill:hover, .row:hover .pill { background: #e8f7ee; border-color: var(--accent); }

/* ---------- projects ---------- */
.block { margin-top: 48px; }
.block-title { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.1; margin-bottom: 18px; }
#cards { margin-top: 28px; }
#cards .block:first-child { margin-top: 0; }

/* ---------- project page ---------- */
.detail { max-width: 780px; }
.back { display: inline-block; margin-top: 36px; font-size: 15px; font-style: italic; color: var(--accent); }
.detail .meta { margin-top: 28px; font-size: 15px; color: var(--faint); }
.detail .page-title { font-size: clamp(40px, 6vw, 68px); margin: 10px 0 26px; }
.detail p { font-size: 19px; line-height: 1.6; color: var(--dim); }
.detail .ref { margin-top: 16px; font-size: 16px; }
.refs { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; font-size: 16px; }
.refs > em { color: var(--accent); font-size: 15px; }
.inline { width: fit-content; color: var(--ink); border-bottom: 1px solid var(--rule); line-height: 1.4; transition: border-color .2s; }
.inline:hover { border-color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.tags span { font-size: 13px; font-style: italic; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--rule); color: var(--dim); }
.links { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.links .pill { font-size: 15px; padding: 9px 20px; }

/* ---------- art ---------- */
.subnav { display: flex; gap: 24px; margin-top: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.subnav[hidden] { display: none; }
.subnav a { font-size: 16px; color: var(--dim); padding-bottom: 4px; border-bottom: 3px solid transparent; }
.subnav a.active { color: var(--ink); border-bottom-color: var(--accent); }
.gallery { margin-top: 8px; }
.masonry { display: flex; flex-wrap: wrap; gap: 14px; }
.masonry .frame { margin: 0; flex: 1 1 260px; border-radius: 10px; overflow: hidden; }
.masonry .frame img { width: 100%; height: auto; display: block; cursor: zoom-in; transition: transform .6s; }
.masonry .frame:hover img { transform: scale(1.02); }

.lightbox { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 4vmin; background: rgba(10, 9, 8, 0.6); backdrop-filter: blur(14px); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  body { padding: 10px 8px 32px; }
  .sheet { border-radius: 14px; padding-top: 18px; }
  .hero-row { grid-template-columns: 1fr; gap: 20px; }
  .hero-side { border-left: 0; padding-left: 0; flex-direction: row; gap: 22px; margin: 0; }
  .home-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 260px; }
  .row { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .row-meta { grid-column: 1; grid-row: 2; }
  .row .pill { grid-column: 2; grid-row: 1 / span 2; }
  .bar nav { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* a little closer to the Oxford page: vertical hairline beside the index */
.home-grid .index { border-left: 1px solid var(--rule); padding-left: clamp(24px, 4vw, 52px); border-bottom: 0; }
.home-grid { gap: clamp(24px, 4vw, 52px); }
@media (max-width: 760px) { .home-grid .index { border-left: 0; padding-left: 0; } }

/* menu: GitHub sits with the other links; Email me is the contact button at the right */
.bar nav a.gh { font-style: normal; }
.bar nav a.gh span { color: var(--accent); }
.bar .mail { font-size: 14px; padding: 6px 16px; }
.hero-row { grid-template-columns: 1fr; }

/* larger category headings on the Projects page */
.block-title { font-size: clamp(38px, 5.2vw, 58px); line-height: 1.05; letter-spacing: -0.015em; margin-bottom: 22px; }
.block { margin-top: 64px; }

.block-title { font-size: clamp(30px, 4vw, 44px); margin-bottom: 20px; }
.block { margin-top: 56px; }

/* the essay / paper is the main action on a project page */
.primary-link { margin: 4px 0 30px; }
.pill.primary { font-size: 19px; padding: 15px 34px; background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 22px rgba(82, 123, 142, 0.32); }
.pill.primary span { color: #fff; }
.pill.primary:hover { background: #3f6475; border-color: #3f6475; }

/* no floating vertical rule beside the home index */
.home-grid .index { border-left: 0; padding-left: 0; }

.sheet { max-width: 1580px; }

/* pure white everywhere; bold black outline around the sheet */
body { background: #ffffff; }
.sky { display: none; }
.sheet {
  background: #ffffff;
  border: 3px solid var(--ink);
  box-shadow: none;
}

/* full-strength black text everywhere (accent blue stays on underlines and arrows only) */
.back, .refs > em, .gh span, .hero-side span { color: #000; }
.tags span { color: #000; border-color: rgba(0, 0, 0, 0.4); }
.row-meta, .detail .meta, .detail p, .name, .page-title { color: #000; }

.pill span, .gh span, .hero-side span { color: inherit; }

/* even spacing around the home photo: same gap above and below */
.sheet { min-height: 0; padding-bottom: 40px; }
.home-grid { margin-top: 40px; margin-bottom: 0; }

/* equal breathing room on all four sides of the box */
body { padding: 14px; }
@media (max-width: 760px) { body { padding: 8px; } }

/* ---- thick black outlines everywhere (same weight as the sheet border) ---- */
.bar nav a.active, .subnav a.active { border-bottom-color: #000; }
.pill { border: 1.5px solid #000; }
.pill:hover, .row:hover .pill { border-color: #000; }
.tags span { border: 1px solid #000; }
.inline { border-bottom: 2px solid #000; }
.inline:hover { border-color: #000; }
.hero-side, .home-grid .index { border-color: #000; }

/* ---- the box fills the window with equal margin on every side ---- */
.sheet { max-width: 2200px; min-height: calc(100vh - 28px); }

/* active page: yellow highlight behind the text instead of an underline */
.bar nav { gap: 14px; margin-left: -10px; }
.bar nav a, .subnav a { padding: 4px 10px; border-bottom: 0; border-radius: 4px; }
.subnav { gap: 10px; margin-left: -10px; }
.bar nav a.active, .subnav a.active { background: #b3d7ff; color: #000; border-bottom: 0; }
.bar nav a:not(.active):hover, .subnav a:not(.active):hover { background: rgba(179, 215, 255, 0.5); }

/* active page: standard Mac selection blue behind the text, like highlighted text */
.bar nav { gap: 28px; margin-left: 0; }
.subnav { gap: 24px; margin-left: 0; }
.bar nav a, .subnav a { padding: 0; border: 0; border-radius: 0; line-height: 1.25; background: none; }
.bar nav a.active, .subnav a.active { background: #b3d7ff; color: #000; }
.bar nav a:not(.active):hover, .subnav a:not(.active):hover { background: none; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* only the box border stays thick; dividers and buttons are fine black lines */
.sheet { border: 3px solid var(--ink); }

/* no line above the first home row (Projects) */
.index .row:first-child { border-top: 0; }

/* project names in the lists are smaller; group headings a touch smaller */
.block-title { font-size: clamp(26px, 3.4vw, 38px); }
.row-title { font-size: clamp(19px, 2.2vw, 24px); }

/* home page: no divider lines (the box outline stays) */
body.is-home .bar { border-bottom: 0; }
body.is-home .hero-row { border-bottom: 0; }
body.is-home .index .row { border-top: 0; }

/* no divider lines anywhere (box outline, buttons and tags keep their outlines) */
.bar, .hero-row, .row, .rows, .index, .refs, .subnav, .hero-side, .home-grid .index { border: 0; }

/* buttons: no pill outline or fill, just blue text */
.pill, .pill.primary, .bar .mail, .links .pill {
  background: none; border: 0; box-shadow: none; border-radius: 0; padding: 0; color: #527b8e;
}
.pill span, .pill.primary span { color: inherit; }
.pill:hover, .pill.primary:hover, .row:hover .pill { background: none; color: #527b8e; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.pill.primary { font-size: 26px; }
.links .pill { font-size: 18px; }
.bar .mail { font-size: 15px; }

/* button text: gradient from black to the blue (clipped to the letters) */
.pill, .pill.primary, .bar .mail, .links .pill,
.pill:hover, .pill.primary:hover, .row:hover .pill {
  background: linear-gradient(90deg, #000000 0%, #527b8e 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #527b8e; /* underline colour on hover; letters take the gradient */
}
.pill span, .pill.primary span { color: inherit; -webkit-text-fill-color: transparent; }

/* button text gradient: black to the light highlight blue */
.pill, .pill.primary, .bar .mail, .links .pill,
.pill:hover, .pill.primary:hover, .row:hover .pill {
  background: linear-gradient(90deg, #000000 0%, #b3d7ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration-color: #000000;
}

/* no View buttons: rows are two columns and the whole row is the link */
.row { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 760px) { .row { grid-template-columns: 1fr; } .row-meta { grid-column: 1; grid-row: auto; } }

/* home rows: growth is driven by script (slow, endless while hovered); replace the old hover effect */
.sheet { overflow: hidden; }
.index .row { transform-origin: left center; position: relative; will-change: transform; }
.index .row:hover { background: none; padding-left: 0; z-index: 3; }

/* home rows: while hovered, grow slowly and never stop (about 6% per second) */

@keyframes grow-forever { from { transform: scale(1); } to { transform: scale(121); } }

/* name: black, light blue in the middle, black again at the end */
.name {
  width: fit-content;
  background: linear-gradient(90deg, #000000 0%, #b3d7ff 50%, #000000 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #000000;
}

/* give the gradient text room for descenders (the g) and edges, without moving anything */
.name { padding: 0.04em 0.06em 0.22em 0; margin: -0.04em 0 -0.22em 0; }

.name { padding: 0.06em 0.08em 0.32em 0; margin: -0.06em 0 -0.32em 0; }

/* home rows: the title grows from the left edge, the right-hand text grows from the right edge (stays right-aligned) */
.index .row-title, .index .row-meta { position: relative; }
.index .row:hover .row-title { transform-origin: left center; animation: grow-forever 2000s linear forwards; z-index: 3; }
.index .row:hover .row-meta { transform-origin: right center; animation: grow-forever 2000s linear forwards; z-index: 3; }
.index .row { transform: none !important; animation: none !important; }
@media (min-width: 761px) { .index .row-meta { text-align: right; justify-self: end; } }

/* Email me: plain black text with the same blue arrow as GitHub (no gradient, no button) */
.mail-link { font-size: 15px; letter-spacing: 0.02em; color: #000000; padding: 4px 0; background: none; -webkit-text-fill-color: #000000; }
.mail-link span { color: #527b8e; -webkit-text-fill-color: #527b8e; }
.mail-link:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* name split into letters: the gradient moves onto each letter (script sets its slice) */
.name.split { background: none; -webkit-background-clip: border-box; background-clip: border-box; -webkit-text-fill-color: initial; position: relative; cursor: default; }
.name .ch {
  display: inline-block; white-space: pre;
  background-image: linear-gradient(90deg, #000000 0%, #b3d7ff 50%, #000000 100%);
  background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #000000;
  padding: 0.06em 0.05em 0.32em; margin: -0.06em -0.05em -0.32em;
  will-change: transform;
}

.group-note { font-size: 18px; line-height: 1.5; color: #000; margin: 0 0 18px; max-width: 70ch; }

/* big page titles: same black / light blue / black gradient as the name (room below for descenders) */
.page-title {
  width: fit-content; max-width: 100%;
  background: linear-gradient(90deg, #000000 0%, #b3d7ff 50%, #000000 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #000000;
  padding: 0.06em 0.08em 0.32em 0;
  margin: calc(44px - 0.06em) 0 calc(6px - 0.32em);
}
.detail .page-title { margin: calc(10px - 0.06em) 0 calc(26px - 0.32em); }

.group-note { max-width: 100ch; }

/* tiny line under "Email me" */
.bar { align-items: flex-start; }
.mail-wrap { display: flex; flex-direction: column; align-items: flex-end; }
.mail-note { font-size: 11px; letter-spacing: 0.02em; line-height: 1.2; color: #000; margin-top: -1px; white-space: nowrap; }
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; gap: 6px 16px; }
  .mail-wrap { align-items: flex-start; }
}

.name .word { display: inline-block; white-space: nowrap; }

/* switching pages: no slide or fade, the new page simply appears in place */
.tab.on { animation: none; }
