/* 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 and height of the portrait card on desktop */

  --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;

  --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, 8cqw, 3.25rem);
  line-height: 1.1;
}
.h1__keep {
  white-space: nowrap; /* "verifiable" and the box never separate: row one breaks only after "I build" */
}
.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;
}

.wordmark__avatar {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  flex: none;
  background: color-mix(in srgb, var(--signal) var(--portrait-tint), var(--paper));
  box-shadow:
    0 0 0 1px var(--rule),
    0 4px 10px -4px rgba(20, 33, 61, 0.35);
}
.wordmark__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@keyframes avatar-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(48px, 8vw, 104px) 0 var(--space-section);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--portrait-size);
  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__meta {
  margin-top: 28px;
  color: var(--ink-soft);
  font-size: var(--step--1);
  max-width: 40em;
}
.hero__portrait {
  margin: 0;
  position: relative;
  width: var(--portrait-size);
  aspect-ratio: 1;
  background: color-mix(in srgb, var(--signal) var(--portrait-tint), var(--paper));
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(20, 33, 61, 0.08),
    0 18px 40px -12px rgba(20, 33, 61, 0.28);
}
.hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06) translateY(4%);
}

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

.hero__hello {
  font-size: var(--step-1);
  color: var(--ink-soft);
  margin-bottom: 10px;
}
/* The noun in its box: flips to the next word, the box follows its width */
.noun {
  display: inline-block;
  vertical-align: baseline;
  line-height: 1;
  padding: 0.08em 0.3em 0.04em;
  margin-left: 0.04em;
  border-radius: 0.12em;
  background: var(--signal);
  color: #fff;
  clip-path: inset(0 round 0.12em); /* clips the flip; overflow: hidden would move the baseline to the box bottom */
  transition: width 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.noun__word {
  display: inline-block;
  transition:
    transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 220ms ease;
}
.noun.is-out .noun__word {
  transform: translateY(-110%);
  opacity: 0;
}
.noun.is-in .noun__word {
  transform: translateY(110%);
  opacity: 0;
  transition: none;
}
.noun-measure {
  position: absolute;
  visibility: hidden;
  white-space: nowrap;
  pointer-events: none;
}

/* The use case line: typed and deleted in orange */
.rotator {
  display: block;
  margin-top: 0.16em;
  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;
  border-top: 1px solid var(--rule);
}
.section__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: 48px;
  align-items: start;
  margin-bottom: 48px;
}
.section__head .section__note {
  padding-top: 8px;
}
.section__note {
  color: var(--ink-soft);
  font-size: var(--step-0);
  max-width: 30em;
}
.grid-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: 64px;
  align-items: start;
}

/* 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__also {
  margin-top: 32px;
  color: var(--ink-soft);
  font-size: var(--step--1);
  max-width: 62em;
}

/* Offer panel: the one loud, salesy block */

.section--panel {
  background: var(--ink);
  color: var(--paper);
  border-top: 0;
}
.section--panel h2,
.section--panel h3 {
  color: var(--paper);
}
.section--panel .section__note {
  color: #c9cfdc;
}
.offers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.offer {
  padding: 8px 32px 8px 0;
  margin-right: 32px;
  border-right: 1px solid #2c3a5c;
}
.offer:last-child {
  border-right: 0;
  margin-right: 0;
  padding-right: 0;
}
.offer p {
  margin-top: 12px;
  color: #c9cfdc;
}
.offer__span {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--paper);
  font-size: var(--step-1);
  margin-top: 6px;
}
.offer__for {
  color: var(--paper);
  font-weight: 500;
}
.panel__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 56px;
}
.panel__alt {
  color: #c9cfdc;
}
.panel__alt a {
  color: var(--paper);
}
.panel__alt a:hover {
  color: var(--signal-tint);
}

/* 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;
}
.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;
  }
  .section__head {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }
  .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;
  }
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
  .hero__portrait {
    width: 240px;
  }
}

@media (max-width: 800px) {
  .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;
  }
  .hero {
    padding-top: 32px;
  }
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .hero__portrait {
    display: none;
  }
  .wordmark__avatar {
    display: block;
    animation: avatar-in 420ms cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
  }
  .offers {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .offer {
    padding: 0;
    margin: 0;
    border-right: 0;
    border-top: 1px solid #2c3a5c;
    padding-top: 24px;
  }
  .offer:first-child {
    border-top: 0;
    padding-top: 0;
  }
  .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): break after "I build" and let the type fill the width */
@container (max-width: 480px) {
  h1 {
    font-size: clamp(1.5rem, 10.2cqw, 2.75rem);
  }
  .h1__lead::after {
    content: '\A';
    white-space: pre;
  }
}

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