/* martinbeck.dev
   Layout: a ledger. Section names run down a narrow left rail, content sits in the
   wide column, hairlines separate entries. The hero sets the name against a
   portrait, and a 96-tick strip (the quarter-hours of a power-market day) closes it. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 100%;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Colour: ink navy from the CV, one amber accent */
  --bg: #0b1520;
  --bg-raise: #101d2b;
  --panel: #142436;
  --panel-hi: #1d3349;
  --line: #213447;
  --line-strong: #2f475e;
  --text: #e9edf1;
  --muted: #a3b3c2;
  --faint: #7b8ea1;
  --accent: #f2b45e;
  --accent-ink: #1b1305;

  /* Type */
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.25rem;

  /* Layout */
  --page: 72rem;
  --rail: 13rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --radius: 6px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

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

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
pre {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
}
a:hover {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.wrap {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px));
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 5;
}
.skip:focus {
  left: 0.5rem;
}

.mono {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* ---------- Top bar ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding-block: 1.4rem;
}
.top__mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step-1);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.top__mark span {
  font-weight: 300;
}
.top__nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  font-size: 0.95rem;
}
.top__nav a {
  text-decoration: none;
  color: var(--muted);
  padding-block: 0.35rem;
}
.top__nav a:hover,
.top__nav a[aria-current="page"] {
  color: var(--text);
}
.top__nav a[aria-current="page"] {
  box-shadow: inset 0 -1.5px 0 var(--accent);
}
@media (max-width: 34rem) {
  .top {
    padding-block: 1.1rem 0.6rem;
  }
  .top__nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.25rem 0.5rem;
    font-size: 0.9rem;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.9rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover {
  background: #ffc77a;
  border-color: #ffc77a;
  color: var(--accent-ink);
}
.btn svg,
.arrow svg {
  width: 0.95em;
  height: 0.95em;
  flex: none;
}
.btn small {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.75;
}

.arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "photo" "body";
  gap: 1.75rem;
  padding-block: clamp(1.5rem, 5vw, 4rem) clamp(2rem, 5vw, 3.5rem);
}
.hero__head {
  grid-area: head;
  display: grid;
  gap: 1.1rem;
}
.hero__eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(4.4rem, 13.2vw, 9.75rem);
  line-height: 0.84;
  letter-spacing: -0.045em;
  font-variation-settings: "opsz" 96;
}
.hero h1 span {
  display: block;
}
.hero h1 .last {
  font-weight: 300;
  letter-spacing: -0.04em;
}
.hero__body {
  grid-area: body;
  display: grid;
  gap: 1.5rem;
  align-content: start;
}
.hero__lead {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.015em;
  max-width: 23em;
  text-wrap: balance;
}
.hero__sub {
  color: var(--muted);
  max-width: 34em;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  color: var(--muted);
}

.portrait {
  grid-area: photo;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 24rem;
  aspect-ratio: 1 / 1.04;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 70% 30%, var(--panel-hi) 0%, var(--panel) 46%, var(--bg-raise) 100%);
}
.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
    grid-template-areas:
      "head photo"
      "body photo";
    column-gap: clamp(2rem, 5vw, 4.5rem);
    row-gap: 2.25rem;
    align-items: start;
  }
  .portrait {
    max-width: none;
    aspect-ratio: 4 / 4.9;
    align-self: stretch;
    max-height: 37rem;
    justify-self: end;
  }
}

/* ---------- The power day: 96 quarter-hours ---------- */

.day {
  padding-block: 0 clamp(2.5rem, 6vw, 4.5rem);
}
.day__ticks {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 1.75rem;
  border-bottom: 1px solid var(--line-strong);
}
.day__ticks i {
  width: 1px;
  height: 32%;
  background: var(--line-strong);
}
.day__ticks i:nth-child(4n + 1) {
  height: 62%;
  background: var(--faint);
}
.day__ticks i.now {
  width: 3px;
  height: 100%;
  margin-inline: -1px;
  background: var(--accent);
  border-radius: 1px 1px 0 0;
}
.day__hours {
  display: flex;
  justify-content: space-between;
  padding-top: 0.45rem;
  color: var(--faint);
}
.day__note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding-top: 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.day__now {
  color: var(--accent);
}

/* ---------- Sections: rail + content ---------- */

.section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--line);
}
.section > h2 {
  font-family: var(--display);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.section__body {
  min-width: 0;
}
@media (min-width: 56rem) {
  .section {
    grid-template-columns: var(--rail) minmax(0, 1fr);
    column-gap: clamp(2rem, 5vw, 4.5rem);
  }
  .section > h2 {
    position: sticky;
    top: 1.5rem;
    align-self: start;
  }
}

.prose {
  display: grid;
  gap: 1.1rem;
  max-width: 39rem;
}
.prose--lead p:first-child {
  font-family: var(--display);
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
@media (max-width: 34rem) {
  .prose--lead p:first-child {
    font-size: 1.4rem;
  }
}
.muted {
  color: var(--muted);
}

/* ---------- Experience ---------- */

.jobs {
  display: grid;
  gap: 3rem;
}
.job {
  display: grid;
  gap: 1.5rem;
}
.job__head {
  display: grid;
  gap: 0.2rem 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}
.job__head h3 {
  font-family: var(--display);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.job__role {
  font-size: var(--step-1);
  color: var(--text);
}
.job__when {
  color: var(--accent);
}
.job__intro {
  color: var(--muted);
  max-width: 39rem;
}
@media (min-width: 40rem) {
  .job__head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
  }
  .job__when {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }
}

.builds {
  display: grid;
}
.build {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem 2rem;
  padding-block: 1.15rem;
  border-top: 1px solid var(--line);
}
.build:last-child {
  border-bottom: 1px solid var(--line);
}
.build h4 {
  margin: 0;
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.35;
}
.build p {
  color: var(--muted);
  max-width: 36rem;
}
.build .mono {
  color: var(--faint);
  padding-top: 0.35rem;
}
@media (min-width: 46rem) {
  .build {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
  .build .mono {
    grid-column: 2;
  }
}

/* ---------- Projects ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding: clamp(1.25rem, 3.5vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel) 0%, var(--bg-raise) 70%);
}
.feature__text {
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
}
.feature h3 {
  font-family: var(--display);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.feature p {
  max-width: 34rem;
}
.status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0.6rem;
  color: var(--muted);
}
.status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  color: var(--faint);
}
@media (min-width: 62rem) {
  .feature {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
  }
}

/* The chat illustration */
.chat {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
}
.chat__frame {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 1.1rem;
  background: var(--bg);
}
.chat__msg {
  justify-self: end;
  max-width: 88%;
  display: grid;
  gap: 0.5rem;
  padding: 0.6rem;
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: var(--panel-hi);
  font-size: 0.95rem;
  line-height: 1.4;
}
.chat__photo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 4.75rem;
  border-radius: 0.6rem;
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(255, 255, 255, 0.035) 9px 10px),
    var(--panel);
  color: var(--faint);
}
.chat__voice {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding-inline: 0.25rem;
}
.chat__voice svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  margin-top: 0.2rem;
  color: var(--accent);
}
.chat__receipt {
  justify-self: start;
  width: min(100%, 17rem);
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 1rem 1rem 1rem 0.25rem;
  background: var(--bg-raise);
  font-size: 0.95rem;
  line-height: 1.4;
}
.chat__receipt .mono {
  color: var(--accent);
}
.chat__receipt strong {
  font-weight: 600;
}
.chat__receipt span {
  color: var(--muted);
}
.chat__undo {
  justify-self: start;
  margin-top: 0.4rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--muted);
  font-size: 0.8rem;
}
.chat figcaption {
  color: var(--faint);
}

.rows {
  display: grid;
  margin-top: 2.5rem;
}
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.4rem 2rem;
  padding-block: 1.35rem;
  border-top: 1px solid var(--line);
}
.row:last-child {
  padding-bottom: 0;
}
.row h3 {
  font-family: var(--display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.row__meta {
  color: var(--faint);
  padding-top: 0.3rem;
}
.row__text {
  display: grid;
  gap: 0.6rem;
  justify-items: start;
  min-width: 0;
}
.row__text p {
  color: var(--muted);
  max-width: 36rem;
}
@media (min-width: 46rem) {
  .row {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
}

/* ---------- Education and skills ---------- */

.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem clamp(2rem, 5vw, 4rem);
}
@media (min-width: 46rem) {
  .facts {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
}
.timeline {
  display: grid;
}
.timeline li {
  display: grid;
  grid-template-columns: 6.25rem minmax(0, 1fr);
  gap: 0.1rem 1rem;
  padding-block: 1rem;
  border-top: 1px solid var(--line);
}
.timeline li:last-child {
  border-bottom: 1px solid var(--line);
}
.timeline .mono {
  color: var(--accent);
  padding-top: 0.25rem;
}
.timeline strong {
  display: block;
  font-weight: 600;
}
.timeline span {
  color: var(--muted);
}
.skills {
  display: grid;
  gap: 1.4rem;
  align-content: start;
}
.skills dt {
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-bottom: 0.3rem;
}
.skills dd {
  font-size: var(--step-1);
  line-height: 1.4;
}
.skills dd.small {
  font-size: var(--step-0);
  color: var(--muted);
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  gap: 1.75rem;
  justify-items: start;
}
.contact__mail {
  font-family: var(--display);
  font-size: clamp(1.45rem, 5.6vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  text-decoration-thickness: 2px;
}
.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.75rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
}
.foot a {
  color: var(--muted);
}

/* ---------- Tools page ---------- */

.pagehead {
  display: grid;
  gap: 1.25rem;
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(2.5rem, 6vw, 4rem);
}
.pagehead h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.4rem, 10vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
}
.pagehead__lead {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: 26em;
  text-wrap: balance;
}

.tool {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
}
.tool__lead {
  font-family: var(--display);
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: 24em;
  text-wrap: balance;
}
.tool__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem 2rem;
  padding-block: 1.1rem;
  border-block: 1px solid var(--line);
}
.tool__meta dt {
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-bottom: 0.15rem;
}
.tool__meta dd {
  color: var(--text);
}
.tool__points {
  display: grid;
  gap: 0.6rem;
  max-width: 39rem;
  color: var(--muted);
}
.tool__points li {
  padding-left: 1.2rem;
  position: relative;
}
.tool__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.5rem;
  height: 1.5px;
  background: var(--accent);
}
.code {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}
.code__label {
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.code pre {
  overflow-x: auto;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raise);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text);
  tab-size: 2;
}
.code pre .c {
  color: var(--faint);
}
.tool__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.keys {
  white-space: nowrap;
}
kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.08em 0.4em;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-raise);
  white-space: nowrap;
}
code {
  font-family: var(--mono);
  font-size: 0.9em;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

/* Shown only when the home page is printed as the CV (css/print.css). */
.print-only {
  display: none;
}
