/* =========================================================
   MATEUSZ CHABAJ — PORTFOLIO
   1. Tokens
   2. Reset
   3. Base type
   4. Layout utilities
   5. Header
   6. Footer
   7. Components
   8. Page sections
   9. Hover (pointer devices only)
   10. Motion
   11. Responsive (all media queries)
   ========================================================= */


/* =========================================================
   1. TOKENS
   ========================================================= */

:root {
  /* Colour — strictly monochrome. No accent colour anywhere. */
  --white: #FFFFFF;
  --off-white: #F7F7F8;
  --black: #0B0B0C;
  --graphite: #3A3B3E;
  --silver: #9A9DA3;
  --silver-light: #D9DBDE;
  --silver-faint: #EDEEF0;

  /* Type */
  --font-display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --fs-display-xl: clamp(2.6rem, 6vw, 5rem);
  --fs-display-l: clamp(1.9rem, 3.6vw, 3rem);
  --fs-h3: clamp(1.15rem, 1.6vw, 1.4rem);
  --fs-body: 1.0625rem;
  --fs-body-lg: clamp(1.15rem, 1.5vw, 1.35rem);
  --fs-label: 0.6875rem;

  /* Spacing — 8px base */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 72px;
  --s7: 112px;
  --s8: 160px;

  /* Layout */
  --content: 1200px;
  --gutter: 80px;
  --header-h: 72px;
  --section-y: 128px;
  --prose: 68ch;
  --intro: 46ch;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-hover: 200ms;
  --t-row: 250ms;
  --t-press: 160ms;
  --t-menu: 200ms;

  --radius: 4px;
  --hairline: 1px solid var(--silver-light);
  --shadow-hover: 0 8px 24px rgba(11, 11, 12, 0.06);
}


/* =========================================================
   2. RESET
   ========================================================= */

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

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

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

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

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

img {
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.cta :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--white);
}

::selection {
  background: var(--black);
  color: var(--white);
}


/* =========================================================
   3. BASE TYPE
   ========================================================= */

body {
  background: var(--white);
  color: var(--graphite);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--black);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-display-xl);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--fs-display-l);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p {
  max-width: var(--prose);
}

strong {
  font-weight: 500;
  color: var(--black);
}

.label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silver);
}

.lead {
  font-size: var(--fs-body-lg);
  line-height: 1.55;
  color: var(--graphite);
  max-width: var(--intro);
}

.intro {
  max-width: 60ch;
}


/* =========================================================
   4. LAYOUT UTILITIES
   ========================================================= */

.container {
  width: 100%;
  max-width: calc(var(--content) + (var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section--tint {
  background: var(--off-white);
}

.section--flush {
  padding-top: 0;
}

.site-main {
  padding-top: var(--header-h);
}

[id] {
  scroll-margin-top: calc(var(--header-h) + var(--s3));
}

.section-head {
  margin-bottom: var(--s5);
}

.section-head .label {
  margin-bottom: var(--s2);
}

.section-head .rule {
  border-top: var(--hairline);
  margin-bottom: var(--s5);
}

.section-head h2 {
  max-width: 20ch;
}

.section-head .intro {
  margin-top: var(--s3);
}

.rule {
  border-top: var(--hairline);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--s1);
  inset-inline-start: var(--s1);
  z-index: 200;
  padding: 12px 16px;
  background: var(--black);
  color: var(--white);
  font-size: 15px;
  border-radius: var(--radius);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}


/* =========================================================
   5. HEADER
   ========================================================= */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-hover) var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--silver-light);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s2);
  min-height: 44px;
  padding-block: 10px;
}

/* MC. wordmark — set in the display face at the same tracking as the H1s,
   so the logo and the headlines read as one voice. */
.brand__mark {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--black);
}

.brand__role {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silver);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: var(--graphite);
  transition: color var(--t-hover) var(--ease);
}

.nav__link[aria-current="page"] {
  color: var(--black);
}

.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  border-bottom: 1px solid var(--black);
}

.nav-toggle {
  display: none;
  align-items: center;
  min-height: 44px;
  padding-inline: 0;
  font-size: 15px;
  color: var(--black);
}

/* Mobile overlay */
/* Visibility (not display) so the overlay can fade both ways.
   Exit is faster than enter — the system responds quicker than it invites. */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  background: var(--white);
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms var(--ease), visibility 150ms;
}

.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition-duration: var(--t-menu);
}

.nav-overlay__bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: var(--header-h);
  flex: 0 0 auto;
}

.nav-overlay__close {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 15px;
  color: var(--black);
}

.nav-overlay__list {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding-top: var(--s6);
}

/* Staggered on the way in, all at once on the way out. */
.nav-overlay__list li,
.nav-overlay__meta {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t-menu) var(--ease),
    transform var(--t-menu) var(--ease);
}

.nav-overlay.is-open .nav-overlay__list li,
.nav-overlay.is-open .nav-overlay__meta {
  opacity: 1;
  transform: none;
}

.nav-overlay.is-open .nav-overlay__list li:nth-child(1) {
  transition-delay: 40ms;
}

.nav-overlay.is-open .nav-overlay__list li:nth-child(2) {
  transition-delay: 80ms;
}

.nav-overlay.is-open .nav-overlay__list li:nth-child(3) {
  transition-delay: 120ms;
}

.nav-overlay.is-open .nav-overlay__meta {
  transition-delay: 160ms;
}

.nav-overlay__list a {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--black);
}

.nav-overlay__list a[aria-current="page"] {
  border-bottom: 1px solid var(--black);
}

.nav-overlay__meta {
  margin-top: auto;
  padding-block: var(--s5);
  border-top: var(--hairline);
}

.nav-overlay__meta a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--graphite);
  font-size: 15px;
}

body.is-locked {
  overflow: hidden;
}


/* =========================================================
   6. FOOTER
   ========================================================= */

.site-footer {
  background: var(--black);
  color: var(--silver-light);
  padding-block: var(--s6);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer a {
  color: var(--silver-light);
  transition: color var(--t-hover) var(--ease);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--s5);
  padding-bottom: var(--s5);
}

.footer__name {
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
}

.footer__role {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silver);
  margin-top: var(--s1);
}

.footer__col ul {
  display: flex;
  flex-direction: column;
  font-size: 15px;
}

.footer__col li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer__bottom span {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silver);
}


/* =========================================================
   7. COMPONENTS
   ========================================================= */

/* Buttons and links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--black);
  border-radius: var(--radius);
  background: var(--black);
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
  transition: transform var(--t-press) var(--ease),
    background-color var(--t-hover) var(--ease),
    border-color var(--t-hover) var(--ease),
    box-shadow var(--t-hover) var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.btn--invert {
  background: var(--white);
  border-color: var(--white);
  color: var(--black);
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  color: var(--black);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--silver-light);
  text-underline-offset: 6px;
  transition: text-decoration-color var(--t-hover) var(--ease);
}

.link-arrow span {
  display: inline-block;
  transition: transform var(--t-hover) var(--ease);
}

.link-quiet {
  border-bottom: 1px solid var(--silver-light);
  transition: border-color var(--t-hover) var(--ease);
}

.actions {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: var(--hairline);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  color: var(--graphite);
  background: var(--white);
}

/* Image placeholder */
.frame {
  position: relative;
  overflow: hidden;
  background: var(--silver-faint);
  border-radius: var(--radius);
}

.frame::after {
  content: attr(data-fallback);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--silver);
}

.frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-row) var(--ease);
}

.frame img.is-missing {
  display: none;
}

/* Forms */
.field {
  display: block;
  margin-bottom: var(--s4);
}

.field__label {
  display: block;
  margin-bottom: var(--s1);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silver);
}

.field__label .optional {
  text-transform: none;
  letter-spacing: 0.06em;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--black);
  background: var(--white);
  border: var(--hairline);
  border-radius: var(--radius);
  transition: border-color var(--t-hover) var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 160px;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--black);
  outline: none;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 3px;
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--black);
}

.field__error {
  display: none;
  margin-top: var(--s1);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--graphite);
}

.field.has-error .field__error {
  display: block;
}

.honeypot {
  display: none;
}

.form__status {
  margin-top: var(--s3);
  font-size: 15px;
  color: var(--graphite);
}

.form__done {
  padding-top: var(--s2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 250ms var(--ease), transform 250ms var(--ease);
}

.form__done.is-visible {
  opacity: 1;
  transform: none;
}

.form__done p {
  margin-top: var(--s2);
  max-width: 48ch;
}


/* =========================================================
   8. PAGE SECTIONS
   ========================================================= */

/* --- Hero --- */
.hero {
  padding-top: var(--s7);
  padding-bottom: var(--s6);
}

.hero h1 {
  max-width: 21ch;
}

.hero__sub {
  margin-top: var(--s4);
}

.hero__actions {
  margin-top: var(--s5);
}

/* --- Work --- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
}

.work-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border: var(--hairline);
  border-radius: var(--radius);
  transition: box-shadow var(--t-row) var(--ease);
}

.work-card .frame {
  aspect-ratio: 16 / 10;
  border-radius: 0;
}

.work-card__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: var(--s3);
}

.work-card__title {
  display: flex;
  align-items: baseline;
  gap: var(--s1);
}

.work-card__arrow {
  font-size: 1rem;
  color: var(--black);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity var(--t-row) var(--ease),
    transform var(--t-row) var(--ease);
}

.work-card:focus-visible .work-card__arrow {
  opacity: 1;
  transform: translateX(0);
}

.work-card__outcome {
  margin-top: var(--s1);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* Pushed to the bottom so the metadata lines up across a row of cards. */
.work-card__meta {
  margin-top: auto;
  padding-top: var(--s3);
}

/* Typographic cover for a project with no image yet. The two lines share one
   grid cell and roll past each other inside the mask. */
.work-cover {
  display: grid;
  place-items: center;
}

.work-cover__roll {
  display: grid;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
  text-transform: uppercase;
  color: var(--black);
}

.work-cover__title,
.work-cover__status {
  grid-area: 1 / 1;
  transition: transform var(--t-row) var(--ease);
}

.work-cover__status {
  transform: translateY(100%);
}

.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  aspect-ratio: 4 / 3;
  background: var(--white);
  border: 1px dashed var(--silver-light);
  border-radius: var(--radius);
  text-align: center;
}

.slot__index {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silver);
}

.slot__note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--silver);
}

/* --- Capabilities --- */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s5);
}

.cap + .cap {
  border-inline-start: var(--hairline);
  padding-inline-start: var(--s5);
}

.cap__index {
  margin-bottom: var(--s3);
}

.cap h3 {
  margin-bottom: var(--s2);
}

.cap p {
  max-width: 34ch;
}

/* --- Cards (skills + process) --- */
.card {
  padding: var(--s3);
  background: var(--white);
  border: var(--hairline);
  border-radius: var(--radius);
}

.card h3 {
  font-size: 1.0625rem;
  font-weight: 500;
  margin-bottom: var(--s1);
}

.card p {
  font-size: 0.9375rem;
  line-height: 1.55;
  max-width: none;
}

/* --- Skills --- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s3);
}

/* --- Process --- */
.process-list,
.case-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s3);
}

p.process-step__index {
  display: block;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--silver);
  margin-bottom: var(--s3);
}

/* --- Case study --- */
.case-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s3);
  margin-top: var(--s5);
  padding-top: var(--s3);
  border-top: var(--hairline);
}

.case-facts dt {
  margin-bottom: var(--s1);
}

.case-facts dd {
  font-size: 15px;
  color: var(--black);
}

.case-shot .frame {
  border: var(--hairline);
}

.case-shot figcaption {
  margin-top: var(--s2);
}

.case-shot--inset {
  max-width: 640px;
  margin-top: var(--s4);
}

/* An organiser's question beside the section that answers it. */
.case-map {
  max-width: 720px;
  margin-top: var(--s3);
  border-top: var(--hairline);
}

.case-map div {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--s3);
  align-items: baseline;
  padding-block: var(--s2);
  border-bottom: var(--hairline);
}

.case-map dt {
  color: var(--black);
}

.case-prose p + p {
  margin-top: var(--s3);
}

.case-more {
  margin-top: var(--s5);
}

.case-gallery {
  display: grid;
  gap: var(--s5);
  margin-top: var(--s5);
}

/* Columns in the ratio that gives a 16:10 shot and a phone shot equal heights. */
.case-phone-pair {
  display: grid;
  grid-template-columns: minmax(0, 3.46fr) minmax(0, 1fr);
  gap: var(--s3);
}

.card p.case-stat {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-bottom: var(--s2);
}

/* --- Closing CTA --- */
.cta {
  background: var(--black);
  color: var(--silver-light);
  padding-block: var(--section-y);
}

.cta h2 {
  color: var(--white);
  max-width: 18ch;
}

.cta__sub {
  margin-top: var(--s3);
  color: var(--silver-light);
  max-width: 48ch;
}

.cta__actions {
  margin-top: var(--s5);
}

.cta__mail {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--silver-light);
  font-size: 15px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(255, 255, 255, 0.24);
  text-underline-offset: 6px;
  transition: color var(--t-hover) var(--ease),
    text-decoration-color var(--t-hover) var(--ease);
}

/* --- Page head (about / contact) --- */
.page-head {
  padding-top: var(--s7);
  padding-bottom: var(--s6);
}

.page-head .label {
  margin-bottom: var(--s2);
}

/* Spacing sits on whatever follows the rule: a mono label sits close under it,
   a display heading gets the full step. */
.page-head .rule + * {
  margin-top: var(--s5);
}

.page-head .rule + .label {
  margin-top: var(--s3);
  margin-bottom: 0;
}

.page-head .lead {
  margin-top: var(--s3);
}

/* --- About --- */
.prose-col {
  /* Spans the full section width and shares the left edge with the brand mark.
     Line length is held by the 68ch cap on paragraphs, not by this container. */
  font-size: 1.125rem;
}

.about-intro::after {
  content: "";
  display: block;
  clear: both;
}

/* Floated so the copy wraps beside the portrait and continues underneath it.
   No column-shaped gap at any width, and the text keeps its own measure. */
.about-intro .frame {
  float: inline-end;
  width: 420px;
  margin-block: 6px var(--s4);
  margin-inline: var(--s5) 0;
  aspect-ratio: 4 / 5;
}

.about-intro p + p {
  margin-top: var(--s3);
}

.about-block {
  margin-top: var(--s7);
}

.about-block__head {
  padding-top: var(--s3);
  border-top: var(--hairline);
  margin-bottom: var(--s5);
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline__item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--s4);
  padding-block: var(--s4);
  border-top: var(--hairline);
}

.timeline__item:first-child {
  border-top: 0;
  padding-top: 0;
}

.timeline__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silver);
  line-height: 1.7;
}

.timeline__org {
  margin-top: 6px;
  font-size: 1.0625rem;
  color: var(--black);
  font-weight: 500;
}

.timeline__desc {
  margin-top: var(--s2);
}

.cert-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s2) var(--s5);
}

.cert {
  padding-top: var(--s2);
  border-top: var(--hairline);
}

.cert__name {
  display: block;
  color: var(--black);
  font-size: 1.0625rem;
}

.cert__issuer {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--silver);
}

.tool-group + .tool-group {
  margin-top: var(--s4);
}

.tool-group .label {
  margin-bottom: var(--s2);
}

.lang-list {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.lang-list li {
  font-size: 1.0625rem;
  color: var(--black);
}

.lang-list span {
  color: var(--graphite);
}

.about-close {
  margin-top: var(--s7);
  padding-top: var(--s4);
  border-top: var(--hairline);
}

.about-close .actions {
  margin-top: var(--s3);
}

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--s8);
  align-items: start;
}

.contact-form {
  max-width: 560px;
}

.contact-info dl {
  border-top: 0;
}

.contact-info__row:first-child {
  padding-top: 0;
}

.contact-info__row {
  padding-block: var(--s3);
  border-bottom: var(--hairline);
}

.contact-info dt {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silver);
  margin-bottom: var(--s1);
}

.contact-info dd {
  margin: 0;
  font-size: 15px;
  color: var(--black);
}

.contact-info dd a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--silver-light);
  text-underline-offset: 6px;
  transition: text-decoration-color var(--t-hover) var(--ease);
}

.contact-info__links {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
}


/* =========================================================
   9. HOVER — pointer devices only
   Gated so a tap on a touch screen never leaves a stuck hover state.
   ========================================================= */

@media (hover: hover) and (pointer: fine) {
  .nav__link:hover {
    color: var(--black);
  }

  .site-footer a:hover {
    color: var(--white);
  }

  .btn:hover {
    background: var(--graphite);
    border-color: var(--graphite);
    box-shadow: var(--shadow-hover);
  }

  .btn--invert:hover {
    background: var(--silver-light);
    border-color: var(--silver-light);
    box-shadow: none;
  }

  .link-arrow:hover {
    text-decoration-color: var(--black);
  }

  .link-arrow:hover span {
    transform: translateX(3px);
  }

  .link-quiet:hover {
    border-bottom-color: var(--black);
  }

  .field input:hover,
  .field textarea:hover {
    border-color: var(--silver);
  }

  a.work-card:hover {
    box-shadow: var(--shadow-hover);
  }

  .work-card:hover .work-card__arrow {
    opacity: 1;
    transform: translateX(0);
  }

  .work-card:hover .frame img {
    transform: scale(1.02);
  }

  .work-card:hover .work-cover__title,
  .work-card:focus-visible .work-cover__title {
    transform: translateY(-100%);
  }

  .work-card:hover .work-cover__status,
  .work-card:focus-visible .work-cover__status {
    transform: translateY(0);
  }

  .cta__mail:hover {
    color: var(--white);
    text-decoration-color: var(--white);
  }

  .contact-info dd a:hover {
    text-decoration-color: var(--black);
  }
}


/* =========================================================
   10. MOTION
   ========================================================= */

.has-motion [data-reveal],
.has-motion [data-hero] {
  opacity: 0;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}


/* =========================================================
   11. RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {
  .contact-grid {
    gap: var(--s6);
  }
}

@media (max-width: 1024px) {
  :root {
    --gutter: 48px;
    --section-y: 80px;
  }

  .hero {
    padding-top: var(--s6);
  }

  .skill-grid,
  .process-list,
  .case-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  /* Three capability columns hold until they drop under the 34ch measure the
     desktop layout uses; below that they stack. */
  .cap-grid {
    grid-template-columns: 1fr;
    gap: var(--s4);
  }

  .cap + .cap {
    border-inline-start: 0;
    border-top: var(--hairline);
    padding-inline-start: 0;
    padding-top: var(--s4);
  }

  .cap p {
    max-width: 60ch;
  }

  /* Stacked: the portrait sits above the copy, no float. */
  .about-intro .frame {
    float: none;
    width: 100%;
    max-width: 320px;
    margin-block: 0 var(--s4);
    margin-inline: 0;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    gap: var(--s2);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--s6);
  }

  .contact-form {
    max-width: none;
  }
}

@media (max-width: 767.98px) {
  :root {
    --gutter: 20px;
    --section-y: 64px;
  }

  .nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero {
    padding-top: var(--s5);
    padding-bottom: var(--s5);
  }

  .hero h1 {
    max-width: none;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .skill-grid,
  .process-list,
  .case-cards {
    grid-template-columns: 1fr;
  }

  .case-map div {
    grid-template-columns: 1fr;
    gap: var(--s1);
  }

  .case-phone-pair {
    grid-template-columns: 1fr;
  }

  .case-phone-pair .case-shot:last-child {
    max-width: 200px;
  }

  .case-facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--s4);
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s1);
  }

  .cert-list {
    grid-template-columns: 1fr;
  }

  .about-block {
    margin-top: var(--s6);
  }

  .about-close {
    margin-top: var(--s6);
  }
}

@media (max-width: 640px) {
  .brand__role {
    display: none;
  }
}

@media (max-width: 480px) {
  .actions {
    gap: var(--s3);
  }

  .actions .btn {
    width: 100%;
  }

  .about-intro .frame {
    max-width: none;
  }
}

/* Beside a project card a slot takes the height of the row, not its own ratio. */
@media (min-width: 768px) {
  .work-grid:has(.work-card) .slot {
    aspect-ratio: auto;
  }
}

/* Reduced motion means fewer and gentler animations, not none. Colour and
   opacity still transition — they aid comprehension. Nothing moves. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-property: opacity, visibility, color, background-color,
      border-color, text-decoration-color, box-shadow !important;
    transition-duration: var(--t-hover) !important;
    transition-delay: 0ms !important;
  }

  .has-motion [data-reveal],
  .has-motion [data-hero] {
    opacity: 1;
  }

  /* The cover keeps its swap as a fade. */
  .work-card:hover .work-cover__title,
  .work-card:focus-visible .work-cover__title {
    opacity: 0;
    transform: none;
  }

  .work-cover__status,
  .work-card:hover .work-cover__status,
  .work-card:focus-visible .work-cover__status {
    transform: none;
  }

  .work-cover__status {
    opacity: 0;
  }

  .work-card:hover .work-cover__status,
  .work-card:focus-visible .work-cover__status {
    opacity: 1;
  }

  .btn:active,
  .work-card:hover .frame img,
  .link-arrow:hover span,
  .nav-overlay__list li,
  .nav-overlay__meta,
  .form__done {
    transform: none;
  }

  .work-card__arrow {
    transform: none;
  }
}

/* Without a hover to reveal it, the project status stays on the cover. */
@media (hover: none), (pointer: coarse) {
  .work-cover__status {
    grid-area: 2 / 1;
    margin-top: var(--s1);
    font-family: var(--font-mono);
    font-size: var(--fs-label);
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--graphite);
    opacity: 1;
    transform: none;
  }
}
