:root {
  --ink: #090909;
  --paper: #f6f6f3;
  --hero-surface: #d9d9d5;
  --accent: #090909;
  --muted: #666661;
  --line: rgba(9, 9, 9, 0.2);
  color-scheme: light;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

.preview-label,
.project-index {
  background-color: var(--paper);
}

body,
.work-section,
.contact-section,
footer {
  background-color: var(--hero-surface);
}

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

.wordmark span,
.hero h1 em,
.hero-stamp b,
.contact-cta,
.text-link {
  color: var(--ink);
}

.wordmark img {
  width: 5rem;
  height: auto;
  display: block;
}

@media (max-width: 800px) {
  .wordmark img {
    width: 4.25rem;
  }
}

.availability i {
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(9, 9, 9, 0.08);
}

.hero-stamp {
  background: transparent;
}

.ticker {
  width: 100%;
  margin-left: 0;
  transform: none;
  background: var(--ink);
  color: var(--paper);
}

.ticker-group i {
  border: 1px solid var(--paper);
  background: transparent;
}

.project-media {
  --project-accent: var(--ink) !important;
  background-color: #deded9;
  background-image:
    linear-gradient(135deg, #eeeeea, #d4d4cf),
    repeating-linear-gradient(90deg, transparent 0 9.9%, rgba(9, 9, 9, 0.045) 10% 10.1%);
}

.project-browser {
  border-color: rgba(9, 9, 9, 0.35);
  background: #fff;
  box-shadow: 0 1.4rem 3.5rem rgba(9, 9, 9, 0.2);
}

.project-browser__bar {
  background: #fff;
}

.project-browser__dots i,
.project-browser__dots i:first-child {
  background: #b9b9b4;
}

.project-browser__dots i:first-child {
  background: var(--ink);
}

.project-browser__screen img,
.project-media .project-browser__screen img {
  filter: grayscale(1) contrast(0.96);
  transition: filter 650ms var(--ease), transform 700ms var(--ease);
}

.project-open:hover .project-browser__screen img,
.project-open:focus-visible .project-browser__screen img {
  filter: grayscale(0) contrast(1);
}

.project-kind {
  background: var(--ink);
  color: var(--paper);
}

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

.about-section .text-link,
.about-section .capability-list dt {
  color: var(--paper);
}

.contact-cta {
  color: var(--ink);
}

.project-dialog,
.dialog-bar {
  border-color: #333;
}

.dialog-bar {
  background: var(--ink);
}

.dialog-actions a {
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Editorial hero: software craft presented as a working visual system. */
.hero--editorial {
  min-height: 100svh;
  padding: 88px 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(30rem, 0.8fr);
  grid-template-rows: auto;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
}

.hero-main {
  min-width: 0;
  min-height: calc(100svh - 88px);
  padding: clamp(3rem, 6vw, 6.5rem) clamp(1.25rem, 4vw, 4.5rem) 2.25rem;
  display: flex;
  flex-direction: column;
}

.hero--editorial .hero-kicker {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ink);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero--editorial h1 {
  max-width: 10ch;
  margin: auto 0;
  font-size: clamp(4.2rem, 7.8vw, 9.2rem);
  line-height: 0.82;
  letter-spacing: -0.072em;
}

.hero--editorial h1 em {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0.08em 0 0 clamp(1rem, 5vw, 6rem);
  padding: 0.02em 0.08em 0.08em;
  border-bottom: 0.06em solid currentColor;
  font-weight: 400;
  white-space: nowrap;
}

.hero--editorial .hero-footer {
  align-self: auto;
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) auto;
  align-items: end;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink);
}

.hero--editorial .hero-footer p {
  max-width: 35rem;
  font-size: clamp(0.95rem, 1.15vw, 1.15rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--ink);
}

.hero-action {
  min-height: 48px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background-color 250ms var(--ease), color 250ms var(--ease);
}

.hero-action + .hero-action {
  border-left: 1px solid var(--ink);
}

.hero-action--primary,
.hero-action:hover,
.hero-action:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.hero-action--primary:hover,
.hero-action--primary:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

.hero-ledger {
  margin: 2rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hero-ledger div {
  min-width: 0;
  padding: 0.85rem 0.75rem 0.85rem 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
}

.hero-ledger div + div {
  padding-left: 0.75rem;
  border-left: 1px solid var(--line);
}

.hero-ledger dt,
.hero-ledger dd {
  margin: 0;
  font-size: 0.58rem;
  line-height: 1.4;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero-ledger dt {
  color: var(--muted);
}

.hero-showcase {
  position: relative;
  min-width: 0;
  padding: clamp(2rem, 4vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  isolation: isolate;
}

.hero-showcase::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
  background-size: 3.5rem 3.5rem;
  transform: perspective(700px) rotateX(58deg) scale(1.5);
}

.hero-showcase__header,
.hero-showcase__note {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.57rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-showcase__header {
  position: absolute;
  top: 2rem;
  right: clamp(2rem, 4vw, 4rem);
  left: clamp(2rem, 4vw, 4rem);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.hero-project {
  position: relative;
  display: block;
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2.5rem 5rem rgba(0, 0, 0, 0.38);
  transition: transform 550ms var(--ease), filter 400ms var(--ease);
}

.hero-project img {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: contain;
  background: #e4e4df;
  filter: grayscale(1) contrast(1.03);
  transition: filter 450ms var(--ease);
}

.hero-project > span {
  padding: 0.65rem 0.2rem 0.15rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.hero-project b {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 400;
}

.hero-project small {
  font-size: 0.53rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-project--back {
  z-index: 1;
  width: 76%;
  margin: 1rem 0 0 auto;
  transform: translate(4%, 8%) rotate(4deg);
  filter: brightness(0.68);
}

.hero-project--front {
  z-index: 2;
  width: 90%;
  margin-top: -3rem;
  transform: translateX(-3%) rotate(-2.5deg);
}

.hero-project:hover,
.hero-project:focus-visible {
  z-index: 4;
  filter: brightness(1);
  transform: translate(0, -0.5rem) rotate(0);
}

.hero-project:hover img,
.hero-project:focus-visible img {
  filter: grayscale(0) contrast(1);
}

.hero-showcase__note {
  margin: 2rem 0 0;
  justify-content: flex-end;
  text-align: right;
}

@media (max-width: 1100px) {
  .hero--editorial {
    grid-template-columns: minmax(0, 1.1fr) minmax(25rem, 0.9fr);
  }

  .hero--editorial h1 {
    font-size: clamp(4rem, 7.4vw, 6.8rem);
  }

  .hero--editorial .hero-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .hero--editorial {
    padding-top: 72px;
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-main {
    min-height: calc(100svh - 72px);
    padding-top: 2.5rem;
  }

  .hero--editorial .hero-kicker {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero--editorial .hero-kicker span:first-child {
    grid-column: 1 / -1;
  }

  .hero--editorial h1 {
    margin: 3.5rem 0;
    font-size: clamp(3.8rem, 17vw, 6.5rem);
  }

  .hero--editorial h1 em {
    width: auto;
    margin-left: 0;
    white-space: normal;
  }

  .hero--editorial .hero-footer {
    display: grid;
    align-items: stretch;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero-ledger {
    grid-template-columns: 1fr;
  }

  .hero-ledger div + div {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .hero-showcase {
    min-height: 42rem;
    padding: 5rem 1.25rem 2rem;
  }

  .hero-showcase__header {
    right: 1.25rem;
    left: 1.25rem;
  }

  .hero-project--back {
    width: 78%;
  }

  .hero-project--front {
    width: 94%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-browser__screen img,
  .project-media .project-browser__screen img,
  .hero-project,
  .hero-project img,
  .hero-action {
    transition: none;
  }
}
