/* ==========================================================================
   SergeMagarik.com — static rebuild
   Fonts: Alata (display) + Montserrat (body), self-hosted.
   ========================================================================== */

@font-face {
  font-family: "Alata";
  src: url("../fonts/alata-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens ------------------------------------------------------------- */

:root {
  --bg: #ebebeb;
  --ink: #000;
  --paper: #fff;
  --muted: #757575;
  --muted-on-dark: rgba(255, 255, 255, 0.68);
  --hairline: #e2e2e2;
  --hairline-on-dark: rgba(255, 255, 255, 0.18);
  --wrap: 1100px;
  --pad-x: 100px;
  --font-display: "Alata", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.68, 0.24, 1);
}

/* --- Reset -------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.95;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0;
}

p {
  margin: 0;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: 2px dashed currentColor;
  outline-offset: 4px;
}

::selection {
  background: #000;
  color: #fff;
}

.section--dark ::selection {
  background: #fff;
  color: #000;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 18px;
  background: #fff;
  color: #000;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid #000;
}

.skip-link:focus {
  top: 16px;
}

/* --- Page shell --------------------------------------------------------- */

.page {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-top: 77px;
}

.section {
  padding: 100px var(--pad-x);
}

.section--light {
  background: var(--paper);
  color: var(--ink);
}

.section--dark {
  background: #000;
  color: #fff;
}

.section__title {
  font-size: clamp(34px, 4.4vw, 50px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}

.section__lede {
  max-width: 54ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 2;
}

[id] {
  scroll-margin-top: 93px;
}

.section--dark .section__lede {
  color: var(--muted-on-dark);
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.section--dark .eyebrow {
  color: var(--muted-on-dark);
}

/* Dark sections keep the same muted tone as the original light-grey copy. */
.section--dark .is-muted {
  color: var(--muted-on-dark);
}

hr.rule {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

/* --- Header -------------------------------------------------------------
   Under 1370px the header is a 77px black bar across the top of the page
   (logo left, menu right). From 1370px up it detaches into a floating
   column that sits just outside the right edge of the 1100px content card,
   aligned with the top of the card.
   ------------------------------------------------------------------------ */

.site-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 77px;
  background: #000;
  padding: 0 calc(max(0px, (100% - var(--wrap)) / 2) + 20px) 0
    calc(max(0px, (100% - var(--wrap)) / 2) + 30px);
}

.brand {
  display: block;
  width: 80px;
  height: 65px;
  text-decoration: none;
}

.brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.menu-btn {
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 21'%3E%3Cpath d='M1 10.5h26M19.5 3.5 26.5 10.5l-7 7' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 30px;
  height: 21px;
  margin-top: 25px;
  padding: 0;
}

.menu-btn span {
  display: block;
  height: 3px;
  background: #fff;
  transition: transform 0.28s var(--ease), opacity 0.18s linear,
    background-color 0.2s linear;
}

.menu-btn span:nth-child(1) {
  width: 25px;
}

.menu-btn span:nth-child(2) {
  width: 17px;
}

.menu-btn span:nth-child(3) {
  width: 30px;
}

/* Open: the three rules become the arrow that closes the menu. */
.menu-btn[aria-expanded="true"] span {
  opacity: 0;
  transform: scaleX(0.35);
}

.menu-btn[aria-expanded="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 21px;
  background-color: #fff;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  transition: background-color 0.2s linear;
}

/* --- Full-screen navigation -------------------------------------------- */

/* Sits *under* the header so the wordmark stays visible and the same
   control (now an arrow) closes the menu. */

.site-menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: #000;
  color: #fff;
  padding: 100px 24px 48px
    calc(max(0px, (100% - var(--wrap)) / 2) + 55px);
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s linear, visibility 0s linear 0.3s;
}

.site-menu.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

body.menu-open {
  overflow: hidden;
}

.site-menu__list {
  display: block;
}

.site-menu__list a {
  display: inline-block;
  padding: 5px 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 9vw, 40px);
  line-height: 1.25;
  letter-spacing: -2px;
  text-decoration: none;
  color: #fff;
}

.site-menu__list a:hover,
.site-menu__list a:focus-visible,
.site-menu__list a.is-active {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

/* Not part of the original design. */
.site-menu__list .num,
.site-menu__foot,
.site-menu__close {
  display: none;
}

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

.hero {
  position: relative;
  min-height: 608px;
  padding: 120px 100px 11px 95px;
  background: #000;
  color: #fff;
  overflow: visible;
}

.hero__text {
  position: relative;
  z-index: 2;
  max-width: 455px;
}

.hero__title {
  font-size: clamp(38px, 5.6vw, 57px);
  line-height: 1.16;
  letter-spacing: -0.045em;
  margin-bottom: 25px;
}

.hero__role {
  margin-bottom: 35px;
  font-size: 15px;
  line-height: 2;
}

.hero__quote {
  max-width: 406px;
  margin-bottom: 31px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 2.05;
  text-transform: uppercase;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  background: #747474;
  color: #fff;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-decoration: none;
  box-shadow: 0 2px 0 #fff;
  transition: background 0.2s linear, color 0.2s linear;
}

.btn:hover {
  background: #fff;
  color: #000;
}

.socials {
  display: flex;
  align-items: center;
  gap: 14px;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

.socials svg {
  width: 22px;
  height: 22px;
}

.socials--lines a {
  width: 50px;
  height: 50px;
  padding-bottom: 10px;
  border-bottom: 2px solid currentColor;
}

.hero__media {
  position: absolute;
  top: 76px;
  right: 100px;
  z-index: 2;
  width: 440px;
  max-width: 45%;
  margin: 0;
}

.hero__media img {
  width: 100%;
  aspect-ratio: 440 / 718;
  object-fit: cover;
  object-position: 50% 30%;
}

/* --- About -------------------------------------------------------------- */

.about {
  padding: 92px var(--pad-x) 104px;
}

.about__body {
  display: grid;
  gap: 22px;
  max-width: 430px;
  color: var(--muted);
  font-size: 15px;
  line-height: 2.05;
}

.link-underline {
  display: inline-block;
  margin-top: 36px;
  padding-bottom: 6px;
  color: #000;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid #000;
}

.link-underline:hover {
  color: #555;
  border-bottom-color: #555;
}

/* --- Interests ---------------------------------------------------------- */

.interests {
  position: relative;
}

.interests__intro {
  max-width: 34ch;
}

.interests__list {
  max-width: calc(100% - 430px);
  margin-top: 46px;
}

.interest__row {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 24px 20px;
  border-top: 1px solid var(--hairline-on-dark);
  color: #fff;
  text-decoration: none;
  transition: background 0.25s linear;
}

.interests__list li:last-child .interest__row {
  border-bottom: 1px solid var(--hairline-on-dark);
}

.interest__row:hover,
.interest__row:focus-visible,
.interest__row.is-active {
  background: #161616;
}

.interest__row:focus-visible {
  outline-offset: -4px;
}

.interest__num {
  flex: none;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.55);
}

.interest__name {
  font-family: var(--font-display);
  font-size: clamp(25px, 2.6vw, 32px);
  line-height: 1.2;
}

.interest__go {
  margin-left: auto;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s linear, transform 0.25s var(--ease);
}

.interest__row:hover .interest__go,
.interest__row:focus-visible .interest__go {
  opacity: 1;
  transform: none;
}

.interests__media {
  position: absolute;
  top: 100px;
  right: var(--pad-x);
  z-index: 2;
  width: 380px;
  max-width: 34%;
  margin: 0;
  background: #111;
}

.interests__media img {
  width: 100%;
  aspect-ratio: 380 / 565;
  object-fit: cover;
  transition: opacity 0.22s linear;
}

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

.experience__lede {
  max-width: 64ch;
}

.jobs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 72px;
  max-width: 900px;
  margin-top: 64px;
}

.job__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 22px;
  margin-bottom: 16px;
}

.job__years {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #000;
}

.job__company {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
}

.job__text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.95;
}

.job__link {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid #000;
}

.job__link:hover {
  color: #555;
  border-bottom-color: #555;
}

/* --- Skills ------------------------------------------------------------- */

.skills__list {
  display: grid;
  gap: 20px;
  max-width: 940px;
  margin-top: 38px;
}

.skill {
  display: flex;
  align-items: center;
  gap: 18px;
}

.skill__meta {
  display: none;
}

.skill__track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 62px;
}

.skill__track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
}

.skill__bar {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  align-items: center;
  width: var(--pct, 0%);
  min-width: 0;
  padding: 0 26px;
  background: #fff;
  color: #000;
  transition: width 1.1s var(--ease);
}

.js .skill__bar {
  width: 0;
}

.skill__name {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  white-space: nowrap;
}

.skill__value {
  flex: none;
  width: 62px;
  text-align: right;
  font-size: 16px;
}

/* --- Blog --------------------------------------------------------------- */

.posts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 54px;
}

.blog__all {
  margin-top: 48px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #ececec;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
}

.post-card__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f2f2f2;
}

.post-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.post-card:hover .post-card__img img {
  transform: scale(1.035);
}

.post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 22px 20px 24px;
}

.post-card__title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.post-card__title a {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease);
}

.post-card:hover .post-card__title a {
  background-size: 100% 1px;
}

.post-card__excerpt {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.post-card__more {
  margin-top: auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid #000;
  align-self: flex-start;
  padding-bottom: 3px;
}

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

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 7vw, 100px);
  margin-top: 30px;
}

.contact__intro {
  max-width: 30ch;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.75;
}

.contact__note {
  margin-top: 42px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.contact__details {
  margin-top: 34px;
  font-size: 14px;
  line-height: 2.4;
  color: var(--muted);
}

.contact__details dt {
  display: inline;
  font-weight: 600;
  color: #000;
}

.contact__details dd {
  display: inline;
  margin: 0;
}

.contact__details dd::after {
  content: "";
  display: block;
}

.contact__details a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid #cfcfcf;
}

.contact__details a:hover {
  color: #000;
  border-bottom-color: #000;
}

.form {
  display: grid;
  gap: 8px;
}

.field {
  display: block;
  margin-bottom: 24px;
}

.field > span {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #000;
}

.field input,
.field textarea {
  width: 100%;
  padding: 8px 2px 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #000;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: #000;
  transition: box-shadow 0.2s linear;
}

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

.field input:focus,
.field textarea:focus {
  outline: none;
  box-shadow: 0 1px 0 0 #000;
}

.field input:user-invalid,
.field textarea:user-invalid {
  border-bottom-color: #b00020;
}

.send {
  display: inline-flex;
  align-items: center;
  gap: 30px;
  margin-top: 12px;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.send__circle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1.5px solid #000;
  border-radius: 50%;
  font-size: 16px;
  letter-spacing: 0;
  transition: background 0.25s linear, color 0.25s linear;
}

.send:hover .send__circle,
.send:focus-visible .send__circle {
  background: #000;
  color: #fff;
}

.form__status {
  min-height: 1.6em;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

.form__status:focus {
  outline: none;
}

.form__status.is-success {
  color: #1c6b3a;
}

.form__status.is-error {
  color: #a11227;
}

/* Off-screen honeypot: hidden from people, visible to naive bots. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field__error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #a11227;
}

.field.has-error input,
.field.has-error textarea {
  border-bottom-color: #a11227;
  box-shadow: 0 1px 0 0 #a11227;
}

.send[disabled] {
  cursor: progress;
  opacity: 0.6;
}

.send.is-sending .send__circle {
  animation: send-pulse 1s linear infinite;
}

@keyframes send-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* --- Footer ------------------------------------------------------------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
  padding: 30px var(--pad-x);
  background: #000;
  color: #fff;
}

.footer__copy {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer__nav a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.footer__nav a:hover {
  color: #fff;
}

.footer .socials {
  margin-left: auto;
}

.footer .socials svg {
  width: 18px;
  height: 18px;
}

/* --- Back to top -------------------------------------------------------- */

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: #6f6f6f;
  color: #fff;
  border: 0;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s linear, transform 0.25s var(--ease),
    background 0.2s linear;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.to-top:hover {
  background: #000;
}

/* --- Inner pages -------------------------------------------------------- */

.inner-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  gap: 30px 60px;
  background: #000;
  color: #fff;
  padding: 72px var(--pad-x) 76px;
}

.inner-hero__media {
  margin: 0;
  align-self: center;
}

.inner-hero__media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.inner-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
}

.inner-hero__back:hover {
  color: #fff;
}

.inner-hero__title {
  max-width: 18ch;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 22px;
}

.inner-hero__lede {
  max-width: 46ch;
  color: var(--muted-on-dark);
  font-size: 16px;
  line-height: 1.9;
}

/* Portfolio galleries */
.gallery-section {
  padding: 74px var(--pad-x) 100px;
}

.masonry {
  columns: 3;
  column-gap: 22px;
}

.masonry--two {
  /* Two photos are a pair, not a masonry column set: use a grid so both
     images share one row height instead of following their own ratios. */
  columns: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.masonry--two .masonry__item {
  margin-bottom: 0;
  aspect-ratio: 3 / 4;
}

.masonry--two .masonry__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.masonry__item {
  display: block;
  break-inside: avoid;
  margin-bottom: 22px;
  background: #111;
  overflow: hidden;
}

.masonry__item img {
  width: 100%;
  transition: opacity 0.3s linear;
}

.masonry__item:hover img {
  opacity: 0.86;
}

.portfolio-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px 60px;
  padding: 74px var(--pad-x) 10px;
  background: #000;
  color: #fff;
  align-items: end;
}

.portfolio-intro__cover img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.portfolio-intro__text {
  padding-bottom: 8px;
}

.portfolio-intro__text p {
  color: var(--muted-on-dark);
  max-width: 40ch;
}

/* Blog listing */
.blog-hero {
  padding: 100px var(--pad-x) 70px;
  background: #fff;
}

.blog-hero__title {
  font-size: clamp(38px, 5vw, 56px);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.blog-hero__lede {
  margin-top: 20px;
  max-width: 52ch;
  color: var(--muted);
}

.blog-grid {
  display: block;
  padding: 0 var(--pad-x) 100px;
  background: #fff;
}

.blog-grid .post-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 34px;
  padding: 30px 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  background: transparent;
}

.blog-grid .post-card:last-child {
  border-bottom: 1px solid var(--hairline);
}

.blog-grid .post-card:hover {
  transform: none;
  box-shadow: none;
}

.blog-grid .post-card__img {
  flex: none;
  width: 280px;
  aspect-ratio: 4 / 3;
  background: #f4f4f4;
}

.blog-grid .post-card__img img {
  object-fit: contain;
}

.blog-grid .post-card:hover .post-card__img img {
  transform: none;
}

.blog-grid .post-card__body {
  padding: 0;
}

.blog-grid .post-card__title {
  font-size: 22px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.blog-grid .post-card__excerpt {
  font-size: 14px;
}

/* Blog article */
.article {
  background: #fff;
  padding: 90px var(--pad-x) 100px;
}

.article__head {
  max-width: 820px;
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.article__title {
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.16;
  letter-spacing: -0.03em;
}

.article__figure {
  margin: 42px 0 0;
}

.article__figure img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.article__body {
  max-width: 720px;
  margin-top: 44px;
  font-size: 16px;
  line-height: 2;
  color: #333;
}

.article__body > * + * {
  margin-top: 1.35em;
}

.article__body h2,
.article__body h3 {
  margin-top: 1.8em;
  font-size: 26px;
  line-height: 1.3;
  color: #000;
}

.article__body a {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article__body blockquote {
  margin-left: 0;
  padding-left: 24px;
  border-left: 2px solid #000;
  font-size: 19px;
  line-height: 1.8;
  color: #111;
}

.article__body figure {
  margin: 2em 0;
}

.article__body figcaption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.article__body img {
  width: 100%;
  height: auto;
}

.article__body ul,
.article__body ol {
  padding-left: 1.3em;
  list-style: disc;
}

.article__body ol {
  list-style: decimal;
}

.article__foot {
  max-width: 720px;
  margin-top: 60px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 18px 30px;
  align-items: center;
  justify-content: space-between;
}

/* --- Lightbox ----------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 24px;
  background: rgba(0, 0, 0, 0.97);
  color: #fff;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.28s linear, visibility 0s linear 0.28s;
}

.lightbox.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 170px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
}

.lightbox__close {
  top: 20px;
  right: 20px;
}

.lightbox__prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: #fff;
  color: #000;
}

.lightbox__count {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.7);
}

/* --- Responsive --------------------------------------------------------- */

/* Desktop: the content is a 1100px card and the wordmark leaves the top bar
   to float alongside it. */
@media (min-width: 1370px) {
  .page {
    padding-top: 30px;
  }

  [id] {
    scroll-margin-top: 24px;
  }

  .site-head {
    top: 30px;
    left: auto;
    right: max(16px, calc((100% - var(--wrap)) / 2 - 145px));
    width: 120px;
    height: auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: transparent;
    padding: 0;
  }

  .brand {
    width: 120px;
    height: 98px;
  }

  .menu-btn {
    margin-top: 26px;
  }

  .menu-btn span {
    background: #000;
  }

  .site-menu {
    padding-left: calc(max(0px, (100% - var(--wrap)) / 2));
  }
}

/* Tablets and small laptops: the card keeps its two-column hero but the
   page becomes full-bleed with proportional gutters. */
@media (max-width: 1099px) {
  :root {
    --pad-x: 52px;
  }

  .hero {
    /* the original keeps the photo inside the dark panel at these widths */
    min-height: 69vw;
    padding: 94px clamp(24px, 4.4vw, 45px) 56px clamp(24px, 4.3vw, 45px);
  }

  .hero__media {
    top: 40px;
    right: clamp(24px, 4.4vw, 45px);
    width: 440px;
    max-width: 45%;
  }

  .hero__text {
    max-width: 55%;
  }

  .interests__media {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 42px;
  }

  .interests__media img {
    aspect-ratio: 16 / 9;
  }

  .interests__list {
    max-width: none;
  }
}


@media (max-width: 900px) {
  .section {
    padding: 64px 32px;
  }

  .hero__title {
    letter-spacing: -0.03em;
  }

  .interests__media {
    display: none;
  }

  .jobs {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact__grid {
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .portfolio-intro,
  .gallery-section,
  .blog-hero,
  .blog-grid,
  .article,
  .inner-hero {
    padding-left: 32px;
    padding-right: 32px;
  }

  .inner-hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 34px;
  }

  .inner-hero__media {
    max-width: none;
  }

  .inner-hero__media img {
    aspect-ratio: 16 / 9;
    max-height: 420px;
  }

  .portfolio-intro {
    grid-template-columns: 1fr;
  }

  .blog-grid .post-card {
    gap: 24px;
  }

  .blog-grid .post-card__img {
    width: 220px;
  }

  .footer {
    padding: 28px 32px;
  }
}

/* Phones: the hero stacks — portrait first, then the copy. */
@media (max-width: 767px) {
  .hero {
    display: flex;
    flex-direction: column-reverse;
    gap: 20px;
    min-height: 0;
    padding: 30px 15px 46px;
  }

  .hero__text {
    max-width: none;
  }

  .hero__media {
    position: static;
    width: 100%;
    max-width: 350px;
    margin: 0;
  }

  .hero__media img {
    aspect-ratio: 350 / 571;
    max-height: none;
    object-position: 50% 30%;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
    line-height: 1.9;
  }

  .section {
    padding: 52px 22px;
  }

  .hero__title {
    font-size: clamp(34px, 10.4vw, 44px);
    line-height: 1.12;
    margin-bottom: 14px;
  }

  .hero__role {
    margin-bottom: 26px;
    font-size: 14px;
  }

  .hero__quote {
   margin-bottom: 30px;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .hero__actions {
    gap: 22px;
  }

  .socials {
    gap: 16px;
  }

  .socials svg {
    width: 20px;
    height: 20px;
  }

  .about {
    padding: 52px 22px 60px;
  }

  .interests__intro {
    max-width: 100%;
  }

  .interests__list {
    margin-top: 34px;
  }

  .interest__row {
    padding: 20px 14px;
    gap: 18px;
  }

  .jobs {
    margin-top: 42px;
  }

  .skills__list {
    gap: 26px;
    margin-top: 32px;
  }

  .skill {
    display: block;
  }

  .skill__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .skill__meta span:last-child {
    flex: none;
    font-size: 14px;
    letter-spacing: 0;
  }

  .skill__track {
    display: block;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
  }

  .skill__track::before {
    display: none;
  }

  .skill__bar {
    height: 100%;
    padding: 0;
    transition-duration: 0.9s;
  }

  .skill__name,
  .skill__value {
    display: none;
  }

  .posts {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 40px;
  }

  .post-card__img {
    /* Single column: let each photo keep its own proportions instead of being
       cropped to 16:10, so portrait graphics (e.g. the Delta/Kraus deal)
       show in full. */
    aspect-ratio: auto;
    background: transparent;
  }

  .post-card__img img {
    height: auto;
    object-fit: contain;
  }

  .contact__intro {
    font-size: 17px;
  }

  .contact__details {
    line-height: 2.2;
  }

  .portfolio-intro,
  .gallery-section,
  .blog-hero,
  .blog-grid,
  .article,
  .inner-hero {
    padding-left: 22px;
    padding-right: 22px;
  }

  .inner-hero {
    padding-top: 70px;
    padding-bottom: 60px;
  }

  .inner-hero__media img {
    aspect-ratio: 4 / 3;
  }

  .gallery-section {
    padding-top: 40px;
    padding-bottom: 64px;
  }

  .blog-grid .post-card {
    gap: 18px;
    padding: 22px 0;
  }

  .blog-grid .post-card__img {
    width: 112px;
    aspect-ratio: 1 / 1;
  }

  .blog-grid .post-card__title {
    font-size: 17px;
  }

  .blog-grid .post-card__excerpt {
    display: none;
  }

  .blog-grid .post-card__more {
    margin-top: 12px;
  }

  .blog-hero__title {
    font-size: clamp(32px, 10vw, 42px);
  }

  .masonry {
    columns: 2;
    column-gap: 12px;
  }

  .masonry__item {
    margin-bottom: 12px;
  }

  .blog-hero {
    padding-top: 64px;
  }

  .article {
    padding-top: 60px;
    padding-bottom: 64px;
  }

  .article__body {
    font-size: 15px;
    line-height: 1.95;
  }

  .footer {
    padding: 26px 22px;
  }

  .footer__nav {
    order: 3;
    width: 100%;
  }

  .footer .socials {
    margin-left: auto;
  }

  .to-top {
    right: 14px;
    bottom: 14px;
  }

  .lightbox {
    padding: 64px 12px 100px;
  }

  .lightbox__prev,
  .lightbox__next {
    top: auto;
    bottom: 20px;
    transform: none;
  }

  .lightbox__prev {
    left: calc(50% - 60px);
  }

  .lightbox__next {
    right: calc(50% - 60px);
  }

  .lightbox__count {
    bottom: 34px;
  }
}

@media (max-width: 380px) {
  .interest__name {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
