/* martoncsernai.com v1 draft. Tokens first, then layout, then components. Class selectors only, one level deep, so nothing cancels out. */

:root {
  --paper: #f7f5f0;
  --paper-2: #ede9e0;
  --ink: #14213d;
  --ink-soft: #4b5266;
  --rule: #d9d3c7;
  --signal: #f0561d;
  --signal-deep: #c8430f;
  --signal-tint: #fde6db;
  --portrait-tint: 0%; /* how much signal orange sits behind the portrait: 0% = page background, 100% = solid orange */
  --portrait-size: 280px; /* width of the portrait card on desktop; the card is 3:4, so 373px tall. On phones it becomes a 160px square above the greeting */
  --h1-row-gap: 0.12em; /* extra space between the headline and the rotating use-case line */

  --font-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --font-hand: 'Caveat', 'Bradley Hand', cursive;

  --step--1: 0.9375rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.625rem;
  --step-3: 2.125rem;
  --step-4: 2.75rem;
  --step-5: clamp(2.25rem, 1rem + 3.6vw, 3.25rem);

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --space-section: clamp(72px, 10vw, 128px);
  --rail: 300px;
  --radius: 4px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--signal-deep);
}

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
h1 {
  font-size: clamp(2rem, 6.6cqw, 3.25rem);
  line-height: 1.1;
}
.nowrap {
  white-space: nowrap;
}
h2 {
  font-size: var(--step-3);
  line-height: 1.1;
}
h3 {
  font-size: var(--step-1);
  line-height: 1.25;
  font-weight: 600;
}
p {
  margin: 0;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: var(--radius);
  z-index: 100;
}
.skip:focus {
  left: 8px;
}

/* Header */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}
.wordmark {
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: var(--step-1);
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark__suffix {
  color: var(--ink-soft);
  font-weight: 500;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: var(--step--1);
  font-weight: 500;
}
.nav a {
  text-decoration: none;
}
.nav a:hover {
  color: var(--signal-deep);
}
.nav-toggle {
  display: none;
  font: inherit;
  font-weight: 500;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 6px 12px;
  color: var(--ink);
  cursor: pointer;
}

@keyframes portrait-in {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Buttons */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--step-0);
  line-height: 1;
  padding: 15px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}
.btn:hover {
  background: #0d1730;
  border-color: #0d1730;
  color: var(--paper);
}
.btn--signal {
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
}
.btn--signal:hover {
  background: var(--signal-deep);
  border-color: var(--signal-deep);
  color: #fff;
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
}
.btn--ghost:hover {
  background: var(--paper-2);
  border-color: var(--ink);
  color: var(--ink);
}
.btn--small {
  padding: 9px 14px;
  font-size: var(--step--1);
}

/* Hero */

.hero {
  padding: clamp(40px, 6vw, 80px) 0 clamp(40px, 5vw, 64px);
}
.hero__grid {
  display: grid;
  /* text on the left; on the right the portrait with its roles, and the handwritten notes beside it */
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.hero__text {
  max-width: 800px;
  container-type: inline-size; /* the headline sizes itself to this column */
}
.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  margin-top: 28px;
  max-width: 34em;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.hero__proof {
  margin-top: 24px;
  max-width: 36em;
  color: var(--ink-soft);
  font-size: var(--step--1);
  line-height: 1.6;
}
.hero__proof a {
  color: var(--ink);
  font-weight: 600;
}
/* Right column: the portrait with its roles. The handwritten PhD note hangs off its lower right corner
   without taking width from the text; --note-out is how far
   they reach past the photo, and as the screen narrows they slide further over it. */
.hero__side {
  --note-out: 56px;
  position: relative;
  margin-right: var(--note-out);
}
/* The PhD note sits on the lower right corner of the photo */
.hero__note--1 {
  position: absolute;
  z-index: 1; /* above the portrait card, which comes later in the markup */
  top: calc(var(--portrait-size) * 4 / 3 - 65px); /* just above the photo's bottom edge; the photo is 3:4 */
  right: calc(-1 * var(--note-out));
  width: max-content;
  padding: 2px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--paper) 85%, transparent); /* keeps the ink legible over the photo */
  transform: rotate(-3deg);
}
.hero__note {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.05;
  color: var(--signal-deep);
}
.hero__portrait {
  margin: 0;
  width: var(--portrait-size);
}
.portrait__card {
  position: relative;
  aspect-ratio: 3 / 4;
  background: color-mix(in srgb, var(--signal) var(--portrait-tint), var(--paper));
  border-radius: 24px;
  overflow: hidden;
  /* a tight contact shadow plus a wide, soft halo that spreads past the card on all sides */
  box-shadow:
    0 0 0 1px rgba(20, 33, 61, 0.06),
    0 2px 4px rgba(20, 33, 61, 0.08),
    0 24px 56px -8px rgba(20, 33, 61, 0.3),
    0 0 72px rgba(20, 33, 61, 0.1);
}
.portrait__card picture {
  display: contents;
}
.portrait__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portrait__roles {
  margin-top: 16px;
  font-size: var(--step-0);
  font-weight: 500;
  color: var(--ink-soft);
  text-align: center;
}
.portrait__roles ul {
  /* one line, wider than the photo if it needs to be, centred under it */
  width: max-content;
  margin-left: 50%;
  transform: translateX(-50%);
}
.portrait__roles li {
  display: inline-block;
}
.portrait__roles li:not(:last-child)::after {
  content: '\00a0·\00a0' / ''; /* visual separator only; screen readers get the list. On the role before it, so a wrapped line never starts with a dot */
}

/* Greeting, rotating line and the pills under the headline */

.hero__hello {
  font-size: var(--step-1);
  color: var(--ink-soft);
  margin-bottom: 10px;
}
/* The use case line: typed and deleted in orange */
.rotator {
  display: block;
  margin-top: var(--h1-row-gap);
  min-height: 1.1em;
  color: var(--signal-deep);
}
.rotator__text:empty::before {
  content: '\00a0';
}
.rotator__cursor {
  display: inline-block;
  width: 3px;
  height: 0.8em;
  margin-left: 5px;
  vertical-align: -0.06em;
  background: var(--signal);
  border-radius: 1px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Sections */

.section {
  padding: var(--space-section) 0;
}
/* Tone bands: each section sits on its own colour; the change of colour is the divider */
.section--tint {
  background: var(--paper-2);
}
.section--ink {
  background: var(--ink);
  color: var(--paper);
}
.section--ink h2,
.section--ink h3 {
  color: var(--paper);
}
.section__intro {
  margin-top: 16px;
  max-width: 40em;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-soft);
}
.section__outro {
  margin-top: 40px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-1);
  color: var(--ink);
}
.ledger {
  margin-top: 48px;
}
.grid-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: 64px;
  align-items: start;
}

/* How it works: four steps joined by arrows */

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
  margin-top: 48px;
}
.flow__step {
  position: relative;
}
.flow__step::after {
  content: '→';
  position: absolute;
  top: 6px;
  right: -30px;
  font-size: var(--step-2);
  color: var(--signal);
}
.flow__step:last-child::after {
  content: none;
}
.flow__icon {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.flow__step p {
  margin-top: 8px;
  color: var(--ink-soft);
}
.flow__step .flow__note {
  font-family: var(--font-hand);
  font-size: var(--step-1);
  line-height: 1.1;
  color: var(--signal-deep);
  transform: rotate(-2deg);
  transform-origin: left;
  /* sits beside the icon, in the 44px band above the question */
  position: absolute;
  top: 0;
  left: 58px;
  right: 8px;
  height: 44px;
  margin: 0;
  display: flex;
  align-items: center;
}

/* Proof ledger: rows, not cards */

.ledger__row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) var(--rail);
  gap: 40px;
  padding: 40px 0;
  border-top: 1px solid var(--rule);
}
.ledger__row:last-child {
  border-bottom: 1px solid var(--rule);
}
.ledger__who {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--step--1);
}
.ledger__client {
  font-weight: 600;
}
.ledger__role {
  color: var(--ink-soft);
}
.ledger__what p {
  margin-top: 12px;
  max-width: 36em;
  color: var(--ink-soft);
}
.ledger__check {
  border-left: 2px solid var(--signal);
  padding-left: 20px;
  font-size: var(--step--1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check__claim {
  font-weight: 500;
}
.check__evidence {
  color: var(--ink-soft);
  margin-top: 4px;
}
.ledger__stack {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink);
}
.check__quote {
  margin: 0 0 6px;
}
.check__quote p {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-0);
  line-height: 1.35;
}
.check__quote footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--ink-soft);
}
.quote__avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-soft);
}
.quote__avatar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.ledger__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rule);
  margin-top: 10px;
}

/* Placeholder: content Marci still has to supply. Visible on purpose; the check script lists every one. */
.placeholder {
  padding: 10px 12px;
  border: 1.5px dashed var(--signal);
  border-radius: 8px;
  background: var(--signal-tint);
  color: var(--signal-deep);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
}
.placeholder--thumb {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  margin-top: 10px;
}
.ledger__also {
  margin-top: 32px;
  color: var(--ink-soft);
  font-size: var(--step--1);
  max-width: 62em;
}

/* Offers on navy: three columns that share one grid, so the buyer's question, the offer name,
   the duration and the description line up across all three whatever their length */

.offers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  margin-top: 48px;
}
.offer {
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 0;
  padding: 4px 32px;
  border-left: 1px solid #2c3a5c;
}
.offer:first-child {
  padding-left: 0;
  border-left: 0;
}
.offer:last-child {
  padding-right: 0;
}
.offer__for {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-2);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--paper);
  padding-bottom: 22px;
}
.offer h3 {
  color: var(--signal);
}
.offer__span {
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--paper);
}
.offer__text {
  margin-top: 12px;
  color: #c9cfdc;
}
.offers__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 48px;
}
.offers__alt {
  color: #c9cfdc;
  max-width: 36em;
}
.starts__title {
  margin-top: 56px;
  color: var(--paper);
}
.starts {
  list-style: none;
  counter-reset: start;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 20px 0 0;
  padding: 0;
}
.starts li {
  counter-increment: start;
  padding-top: 14px;
  border-top: 1px solid #2c3a5c;
  color: #c9cfdc;
}
.starts li::before {
  content: counter(start);
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  color: var(--signal);
}

/* Closing band: navy, like Work with me */

.close h2 {
  margin-inline: auto;
}
.close {
  text-align: center;
}
.close__quote {
  margin: 0 auto 40px;
  max-width: 38em;
  color: #c9cfdc;
}
.close__quote footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: var(--step--1);
}
.close .quote__avatar {
  background: #2c3a5c;
  color: #c9cfdc;
}
.close__line {
  margin: 16px auto 0;
  max-width: 36em;
  color: #c9cfdc;
}
.close__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 36px;
}
.close__alt {
  color: #c9cfdc;
}
.close a:not(.btn) {
  color: var(--paper);
}

/* About */

.prose > p {
  margin-top: 20px;
  max-width: 34em;
}
.prose > p:first-of-type {
  margin-top: 28px;
}
.prose > h3 {
  margin-top: 56px;
  margin-bottom: 20px;
}
.prose > .about__skills {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.rail__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
}
.placeholder--photo {
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.timeline li {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}
.timeline li:last-child {
  border-bottom: 1px solid var(--rule);
}
.timeline__when {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-soft);
  padding-top: 2px;
}
.pubs li {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  max-width: 40em;
}
.pubs li:last-child {
  border-bottom: 1px solid var(--rule);
}
.pubs__venue {
  color: var(--ink-soft);
}
.rail {
  border-left: 2px solid var(--signal);
  padding-left: 20px;
  position: sticky;
  top: 96px;
}
.rail__title {
  font-size: var(--step-0);
  font-weight: 600;
}
.rail__list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: var(--step--1);
}

/* Sources */

.section--sources {
  background: var(--paper-2);
}
.sources {
  counter-reset: src;
  max-width: 760px;
}
.sources li {
  counter-increment: src;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 2px 12px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 96px;
  transition: background-color 400ms ease;
}
.sources li:last-child {
  border-bottom: 1px solid var(--rule);
}
.sources li::before {
  content: counter(src);
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--step--1);
  color: var(--signal-deep);
  padding-top: 3px;
}
.sources li:target {
  background: var(--signal-tint);
}
.sources li a {
  grid-column: 2;
  display: block;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.sources__meta {
  grid-column: 2;
  display: block;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

/* Footer */

.site-foot {
  border-top: 1px solid var(--rule);
  padding: 48px 0 56px;
  font-size: var(--step--1);
}
.site-foot__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 48px;
  align-items: start;
}
.site-foot__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-0);
}
.site-foot__muted {
  color: var(--ink-soft);
  margin-top: 6px;
}
.site-foot__links,
.site-foot__legal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Responsive */

@media (max-width: 1024px) {
  :root {
    --rail: 260px;
  }
  .grid-rail {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .rail {
    position: static;
  }
  .placeholder--thumb,
  .ledger__thumb {
    max-width: 280px;
  }
  .ledger__row {
    grid-template-columns: minmax(0, 1fr) var(--rail);
    gap: 28px;
    padding: 32px 0;
  }
  .ledger__who {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 16px;
  }
  :root {
    --portrait-size: 240px;
  }
  .hero__side {
    --note-out: 16px;
  }
  .portrait__roles ul {
    width: auto;
    margin-left: 0;
    transform: none;
  }
}

@media (max-width: 800px) {
  .starts {
    grid-template-columns: minmax(0, 1fr);
  }
  .flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }
  .flow__step::after {
    content: '↓';
    top: auto;
    right: auto;
    left: 12px;
    bottom: -40px;
  }
  .nav-toggle {
    display: inline-block;
  }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px var(--gutter) 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }
  .nav.is-open {
    display: flex;
  }
  .nav a {
    padding: 8px 0;
  }
  .nav .btn {
    margin-top: 8px;
    padding: 10px 20px;
  }
  .hero {
    padding-top: 32px;
  }
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  /* phones: photo and roles above the greeting, the notes after the proof line */
  .hero__side {
    display: contents;
  }
  .hero__portrait {
    order: -1;
    width: auto;
    margin: 8px auto 4px;
  }
  .hero__note--1 {
    display: none; /* too crowded on a phone; the proof line carries the credentials there */
  }
  .portrait__roles ul {
    width: auto;
    margin-left: 0;
    transform: none;
  }
  .portrait__card {
    width: 160px;
    aspect-ratio: 1;
    border-radius: 28px;
    margin-inline: auto;
    animation: portrait-in 420ms cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
  }
  .offers {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }
  .offer,
  .offer:first-child {
    grid-row: auto;
    grid-template-rows: none;
    padding: 28px 0;
    border-left: 0;
    border-top: 1px solid #2c3a5c;
  }
  .site-foot__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

@media (max-width: 400px) {
  .site-head__row {
    gap: 12px;
  }
  .wordmark {
    font-size: var(--step-0);
  }
}

@media (max-width: 640px) {
  .wordmark__suffix {
    display: none;
  }
  .ledger__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .timeline li {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* Narrow columns (phones): the type fills the width; "I build verifiable AI" stays on one row */
@container (max-width: 480px) {
  h1 {
    font-size: clamp(1.125rem, 6.4cqw, 2.75rem); /* sized so the longest use-case line fits one row; all three rows share it */
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .rotator__cursor,
  .portrait__card {
    animation: none;
  }
  .btn {
    transition: none;
  }
}

/* Legal pages: a plain bulleted list inside the prose column */
.legal-list {
  max-width: 34em;
  margin-top: 12px;
  padding-left: 1.2em;
  list-style: disc;
}
.legal-list li {
  margin-top: 4px;
}
