/* =========================================================
   Portfolio — styles
   Change --accent to re-colour the whole site.
   ========================================================= */

:root {
  --paper: #EEECE5;
  --paper-hover: #E6E3DA;
  --placeholder: #E7E4DB;
  --placeholder-line: #D9D5CA;
  --ink: #161512;
  --body: #3A3833;
  --muted: #6E6A61;
  --rule: #CBC7BC;
  --chip: #B9B4A8;
  --accent: #E0542C; /* try #3F74E0, #3A9A5B or #161512 */

  --dark-rule: #3A3833;
  --dark-muted: #9A958B;

  --sans: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;

  --pad: clamp(20px, 3.4vw, 48px);
  --gap: 24px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

/* ---------- Reset ---------- */
*, *::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(--sans);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--paper); }

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

section[id], footer[id] { scroll-margin-top: var(--header-h); }

.skip-link {
  position: absolute; left: var(--pad); top: -100px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 13px;
}
.skip-link:focus { top: 12px; }

/* ---------- Utilities ---------- */
.container { width: 100%; max-width: 1600px; margin-inline: auto; padding-inline: var(--pad); }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.mono-label {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mono-num { font-family: var(--mono); font-size: 13px; }

.link-u { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.link-u:hover { background-size: 100% 1px; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; }
.link-arrow svg { transition: transform .25s var(--ease); }
.link-arrow:hover span { text-decoration: underline; text-underline-offset: 4px; }
.link-arrow:hover svg { transform: translate(2px, -2px); }

.link-soon { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.link-soon__tag {
  padding: 2px 8px;
  border: 1px dashed var(--chip);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.row { transition: background-color .25s ease; }
.row:hover { background-color: var(--paper-hover); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 4px 10px;
  border: 1px solid var(--chip);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
}

/* ---------- Media placeholders / images ---------- */
.media {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--rule);
  background-color: var(--placeholder);
  background-image: repeating-linear-gradient(135deg, var(--placeholder-line) 0 1px, transparent 1px 12px);
}
.media--4x5 { aspect-ratio: 4 / 5; }
.media--16x10 { aspect-ratio: 16 / 10; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--wide { aspect-ratio: 1868 / 921; }
.media__label { padding: 16px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease);
}
a:hover .media img, .featured:hover .media img { transform: scale(1.03); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 500;
  border: 1px solid var(--ink);
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--outline { color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }

/* =========================================================
   Header
   ========================================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  padding-inline: var(--pad);
  background: rgba(238, 236, 229, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.01em;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--ink); color: var(--paper);
  font-weight: 500;
}

.nav { display: flex; align-items: center; gap: 36px; }
.nav__link { position: relative; display: flex; gap: 8px; padding-block: 6px; }
.nav__num { color: var(--accent); }
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }

.status { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.status__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
}

/* =========================================================
   Hero
   ========================================================= */
.hero { padding-top: clamp(44px, 6vw, 88px); }
.hero__meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }

.hero__name {
  margin-top: 28px;
  font-size: clamp(56px, 15vw, 216px);
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: -0.05em;
}
/* extra bottom room so descenders (y, g, p) aren't clipped; negative margin keeps spacing */
.hero__name .line { display: block; overflow: hidden; padding-bottom: 0.2em; margin-bottom: -0.17em; }

.hero__row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: end;
  margin-top: clamp(28px, 4vw, 56px);
}
.hero__intro {
  grid-column: 1 / span 6;
  font-size: clamp(19px, 1.7vw, 24px);
  line-height: 1.4;
  color: var(--body);
  text-wrap: pretty;
}
.hero__actions { grid-column: 8 / span 5; display: flex; justify-content: flex-end; gap: 12px; }

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(44px, 5vw, 72px);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
.fact { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 24px; }
.fact:first-child { padding-left: 0; }
.fact + .fact { border-left: 1px solid var(--rule); }
.fact dt { font-size: 12px; color: var(--muted); }
.fact dd { font-size: 20px; }

/* Load animation */
.rise { display: block; animation: rise 1s var(--ease) both; }
.rise--2 { animation-delay: .12s; }
.fade-in { animation: fade 0.9s ease .4s both; }
@keyframes rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* =========================================================
   Sections (label column + body column)
   ========================================================= */
.section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  padding-top: clamp(80px, 9vw, 128px);
}
.section__label { grid-column: 1 / span 3; display: flex; flex-direction: column; gap: 6px; }
.section__body { grid-column: 4 / span 9; }
.section--ruled .section__label { padding-top: 28px; }

/* ---------- About ---------- */
.about { display: flex; flex-direction: column; gap: clamp(28px, 4.5vw, 64px); }
.statement {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}
.about__grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: var(--gap); }
.about__grid .media { grid-column: 1 / span 4; }
.about__text { grid-column: 5 / span 5; display: flex; flex-direction: column; gap: 40px; }

.prose { display: flex; flex-direction: column; gap: 18px; line-height: 1.6; color: var(--body); }
.prose p { text-wrap: pretty; }

.skills { border-top: 1px solid var(--rule); }
.skills__row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.skills__row dt { font-size: 12px; color: var(--muted); padding-top: 5px; }
.recognition { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; font-size: 16px; }

/* ---------- Experience ---------- */
.jobs { border-top: 1px solid var(--ink); }
.job {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: var(--gap);
  padding: 30px 0;
  border-bottom: 1px solid var(--rule);
}
.job__date { grid-column: 1 / span 2; padding-top: 6px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.job__title { grid-column: 3 / span 3; display: flex; flex-direction: column; gap: 4px; }
.job__title h3 { font-size: clamp(24px, 2vw, 28px); font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; }
.job__title p { font-size: 17px; color: var(--muted); }
.job__detail { grid-column: 6 / span 4; display: flex; flex-direction: column; gap: 14px; }
.job__detail p:first-child { font-size: 17px; line-height: 1.55; color: var(--body); text-wrap: pretty; }
.job__tags { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* =========================================================
   Projects
   ========================================================= */
.projects {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding-top: clamp(80px, 9vw, 128px);
  padding-bottom: clamp(72px, 9vw, 128px);
}
.projects__head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: end;
  padding-top: 28px;
  border-top: 1px solid var(--ink);
}
.projects__head .section__label { align-self: start; }
.projects__title {
  grid-column: 4 / span 7;
  font-size: clamp(60px, 6.7vw, 96px);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.projects__count { grid-column: 11 / span 2; justify-self: end; color: var(--muted); text-transform: none; }

/* Featured */
.featured { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.featured__media-link { grid-column: 1 / span 8; align-self: start; }
.featured__info { grid-column: 9 / span 4; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.featured__top { display: flex; flex-direction: column; gap: 18px; }
.featured__kicker { display: flex; justify-content: space-between; color: var(--muted); text-transform: none; letter-spacing: 0; }
.featured__title { font-size: clamp(34px, 3vw, 44px); line-height: 1.02; font-weight: 700; letter-spacing: -0.03em; }
.featured__heading { display: flex; flex-direction: column; gap: 8px; }
.featured__subtitle { font-size: 17px; color: var(--muted); }
.featured__desc { line-height: 1.55; color: var(--body); text-wrap: pretty; }
.featured__bottom { display: flex; flex-direction: column; gap: 24px; }
.featured__links { display: flex; flex-wrap: wrap; gap: 24px; font-size: 16px; font-weight: 500; }

.specs { border-top: 1px solid var(--rule); font-size: 15px; }
.specs__row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.specs__row dt { font-size: 12px; color: var(--muted); }
.specs__row dd { text-align: right; }

/* Pair of cards */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-top: 40px; }
.card { display: flex; flex-direction: column; gap: 20px; }
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.card__name { display: flex; align-items: baseline; gap: 14px; }
.card__name h3 { font-size: clamp(26px, 2.2vw, 32px); font-weight: 700; line-height: 1.1; letter-spacing: -0.025em; }
.card__kicker { margin-top: -10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.card__desc { max-width: 600px; font-size: 17px; line-height: 1.55; color: var(--body); text-wrap: pretty; }
.card__link { align-self: flex-start; min-height: 44px; font-size: 16px; font-weight: 500; }

/* Archive */
.archive { margin-top: 40px; }
.archive__head, .archive__row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
}
.archive__head { padding-bottom: 14px; border-bottom: 1px solid var(--ink); font-size: 12px; color: var(--muted); }
.archive__row { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.archive__year { grid-column: 1 / span 1; }
.archive__name { grid-column: 2 / span 5; }
.archive__type { grid-column: 7 / span 2; }
.archive__stack { grid-column: 9 / span 3; }
.archive__arrow { grid-column: 12 / span 1; justify-self: end; }
.archive__row .archive__year,
.archive__row .archive__stack { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.archive__row .archive__name { font-size: 22px; font-weight: 500; }
.archive__row .archive__type { font-size: 15px; color: var(--muted); }
.archive__row svg { transition: transform .25s var(--ease); }
.archive__row:hover svg { transform: translate(3px, -3px); color: var(--accent); }

/* =========================================================
   Contact / footer
   ========================================================= */
.contact {
  padding-top: clamp(72px, 8vw, 112px);
  padding-bottom: 36px;
  background: var(--ink);
  color: var(--paper);
}
.contact ::selection { background: var(--accent); color: var(--ink); }
.contact__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: end;
}
.contact__main { grid-column: 1 / span 8; display: flex; flex-direction: column; gap: 36px; }
.contact__label { display: flex; gap: 12px; }
.contact__title {
  font-size: clamp(60px, 11vw, 156px);
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: -0.05em;
}
.contact__email {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  align-self: flex-start;
  min-height: 44px;
  font-size: clamp(22px, 2.8vw, 40px);
  font-weight: 500;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.contact__email svg { width: 0.75em; height: 0.75em; flex-shrink: 0; transition: transform .25s var(--ease); }
.contact__email:hover svg { transform: translate(3px, -3px); color: var(--accent); }

.socials { grid-column: 9 / span 4; border-top: 1px solid var(--dark-rule); }
.socials__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  border-bottom: 1px solid var(--dark-rule);
  font-size: 18px;
  transition: padding .3s var(--ease), color .2s ease;
}
.socials__link:hover { padding-inline: 8px; color: var(--accent); }
.socials__handle { font-family: var(--mono); font-size: 13px; color: var(--dark-muted); }

.contact__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  margin-top: clamp(56px, 7vw, 96px);
  padding-top: 24px;
  border-top: 1px solid var(--dark-rule);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dark-muted);
}
.contact__bottom .link-arrow { min-height: 44px; color: var(--paper); }

/* =========================================================
   Scroll reveal (only when JS is running)
   ========================================================= */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .9s var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .nav { gap: 24px; }
  .status { display: none; }

  .featured__media-link { grid-column: 1 / -1; }
  .featured__info { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }

  /* Header -> menu button + dropdown */
  .brand__name { display: none; }
  .menu-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--pad) 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
  }
  .nav.is-open { display: flex; animation: fade .3s ease both; }
  .nav__link {
    align-items: baseline;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    font-family: var(--sans);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  .nav__link:last-child { border-bottom: 0; }
  .nav__link::after { display: none; }
  .nav__num { font-family: var(--mono); font-size: 13px; font-weight: 400; }

  /* Hero */
  .hero__row { display: flex; flex-direction: column; align-items: stretch; gap: 28px; }
  .hero__actions { justify-content: flex-start; flex-wrap: wrap; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 0; }
  .fact { padding: 16px 0 16px 12px; border-bottom: 1px solid var(--rule); }
  .fact + .fact { border-left: 0; }
  .fact:nth-child(odd) { padding-left: 0; padding-right: 12px; }
  .fact:nth-child(even) { border-left: 1px solid var(--rule); }
  .fact dd { font-size: 17px; }

  /* Sections stack */
  .section { display: flex; flex-direction: column; gap: 28px; }
  .section__label { flex-direction: row; gap: 10px; }
  .section--ruled { gap: 20px; }
  .section--ruled .section__label { padding-top: 20px; border-top: 1px solid var(--ink); }
  .section--ruled .jobs { border-top: 0; }

  .about__grid { display: flex; flex-direction: column; gap: 28px; }
  .about__grid .media { max-width: 520px; }
  .about__text { gap: 28px; }

  .job { display: flex; flex-direction: column; gap: 10px; padding: 22px 0; }
  .job__date { padding-top: 0; font-size: 12px; }
  .job__detail { gap: 10px; }
  .job__detail p:first-child { font-size: 16px; }

  /* Projects */
  .projects { gap: 28px; }
  .projects__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 20px; }
  .projects__head .section__label { order: 1; }
  .projects__count { order: 2; }
  .projects__title { order: 3; flex-basis: 100%; }

  .featured { display: flex; flex-direction: column; gap: 16px; }
  .featured__info { display: flex; flex-direction: column; gap: 16px; }
  .featured__top { gap: 16px; }

  .pair { margin-top: 20px; }

  .archive { margin-top: 20px; }
  .archive__head { display: flex; }
  .archive__head span:not(.archive__name) { display: none; }
  .archive__row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "name name arrow" "year type arrow";
    column-gap: 10px;
    row-gap: 2px;
    min-height: 68px;
    padding: 12px 0;
  }
  .archive__row .archive__name { grid-area: name; font-size: 19px; }
  .archive__row .archive__year { grid-area: year; font-size: 12px; }
  .archive__row .archive__type { grid-area: type; font-family: var(--mono); font-size: 12px; }
  .archive__row .archive__type::before { content: "· "; }
  .archive__row .archive__stack { display: none; }
  .archive__row .archive__arrow { grid-area: arrow; }

  /* Contact */
  .contact__grid { display: flex; flex-direction: column; align-items: stretch; gap: 56px; }
  .contact__main { gap: 24px; }
  .socials__link { min-height: 56px; font-size: 17px; }
  .contact__city { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .hero__meta { flex-direction: column; gap: 4px; font-size: 12px; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; padding: 0 20px; }
  .skills__row { grid-template-columns: 1fr; gap: 10px; padding: 16px 0; }
  .skills__row dt { padding-top: 0; }
  .pair { grid-template-columns: 1fr; gap: 48px; }
  .card { gap: 14px; }
  .mono-label { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
