:root {
  color-scheme: light;
  --ink: #141817;
  --muted: #5f6864;
  --paper: #f7f5ef;
  --paper-soft: #fbfaf6;
  --surface: #ffffff;
  --line: #d8ded7;
  --teal: #087f82;
  --teal-bright: #7ff5ef;
  --green: #6d8a4f;
  --amber: #d1973c;
  --charcoal: #11191c;
  --shadow: 0 20px 50px rgba(20, 24, 23, 0.12);
  --shadow-strong: 0 26px 70px rgba(20, 24, 23, 0.16);
  --content-width: clamp(1240px, 92vw, 1760px);
  --content-gutter: 40px;
  --hero-copy-left: clamp(48px, 9vw, 160px);
  --hero-copy-right: clamp(24px, 5vw, 80px);
  --project-media-height: clamp(196px, 14vw, 260px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--paper) 0%, #f3f1eb 58%, #f8f7f2 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

a {
  color: inherit;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 18px var(--hero-copy-right) 18px var(--hero-copy-left);
  color: #ffffff;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.site-header.is-scrolled {
  border-bottom: 1px solid rgba(216, 222, 215, 0.84);
  background: rgba(247, 245, 239, 0.9);
  box-shadow: 0 16px 34px rgba(20, 24, 23, 0.08);
  color: var(--ink);
  backdrop-filter: blur(18px);
}

.brand,
.nav-links,
.hero-actions,
.contact-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  overflow: hidden;
  background: #071012;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-header.is-scrolled .brand-mark {
  border-color: rgba(8, 127, 130, 0.32);
}

.nav-links {
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(20, 24, 23, 0.22);
  backdrop-filter: blur(18px);
}

.site-header.is-scrolled .nav-links {
  border-color: rgba(20, 24, 23, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  text-decoration: none;
}

.site-header.is-scrolled .nav-links a {
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.site-header.is-scrolled .nav-links a:hover,
.site-header.is-scrolled .nav-links a:focus-visible {
  background: rgba(8, 127, 130, 0.1);
  color: var(--ink);
}

.hero {
  position: relative;
  --hero-height: clamp(480px, 78svh, 820px);
  min-height: var(--hero-height);
  overflow: hidden;
  background: var(--charcoal);
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  object-position: 20% center;
}

@media (min-width: 1600px) and (min-aspect-ratio: 21/9) {
  .hero {
    --hero-height: clamp(440px, 82svh, 1080px);
    height: var(--hero-height);
    min-height: var(--hero-height);
  }

  .hero-content {
    height: 100%;
    min-height: 100%;
    padding-bottom: clamp(52px, 8svh, 128px);
  }

  .hero-image {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 20% center;
  }
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(3, 10, 12, 0.94) 0%, rgba(3, 10, 12, 0.68) 42%, rgba(3, 10, 12, 0.06) 100%),
    linear-gradient(0deg, rgba(3, 10, 12, 0.82) 0%, rgba(3, 10, 12, 0) 44%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  max-width: none;
  min-height: var(--hero-height);
  margin: 0;
  padding: 150px var(--hero-copy-right) 76px var(--hero-copy-left);
  color: #ffffff;
}

.eyebrow,
.section-kicker,
.project-type {
  margin: 0;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  color: #7ff5ef;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.6rem, 4.45vw, 4.65rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 2.15rem;
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero-copy,
.hero-tagline {
  max-width: 600px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.12rem;
}

.hero-tagline {
  color: #7ff5ef;
  font-weight: 800;
}

.hero-actions,
.contact-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 750;
  text-decoration: none;
}

.button-primary {
  background: var(--teal);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(8, 127, 130, 0.28);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #066b6e;
}

.button-secondary {
  border-color: rgba(255, 255, 255, 0.54);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.24);
}

.section {
  width: min(var(--content-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0;
  scroll-margin-top: 96px;
}

.intro {
  padding-top: clamp(44px, 5vw, 56px);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1fr);
  gap: clamp(48px, 7vw, 96px);
  align-items: end;
}

.approach-section .principle-list p,
.project-body p:not(.project-type) {
  color: var(--muted);
}

.section-heading {
  max-width: 660px;
  margin-bottom: 28px;
}

.work-section {
  width: min(var(--content-width), calc(100% - 48px));
  padding-top: 18px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.project-card:hover,
.project-card:focus-within {
  border-color: rgba(8, 127, 130, 0.32);
  box-shadow: var(--shadow-strong);
  transform: translateY(-3px);
}

.project-card-link {
  display: grid;
  grid-template-rows: var(--project-media-height) 1fr;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.project-card-link:focus-visible {
  outline: 3px solid rgba(8, 127, 130, 0.34);
  outline-offset: 4px;
}

.project-media {
  position: relative;
  min-height: var(--project-media-height);
  padding: 24px;
  overflow: hidden;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.project-media::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 44px);
  content: "";
}

.project-media-clipforge,
.project-media-homesafe,
.project-media-deepdark,
.project-media-beacon,
.project-media-libpq {
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-media-clipforge {
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 247, 222, 0.88) 0 26%, transparent 27%),
    radial-gradient(circle at 82% 18%, rgba(209, 151, 60, 0.56), transparent 24%),
    radial-gradient(circle at 16% 84%, rgba(127, 245, 239, 0.34), transparent 26%),
    linear-gradient(135deg, #2d1d12 0%, #d1973c 58%, #087f82 100%);
}

.project-media-icon {
  position: relative;
  z-index: 1;
  width: min(144px, 58%);
  height: auto;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(45, 29, 18, 0.18),
    0 22px 44px rgba(45, 29, 18, 0.34);
}

.project-media-icon-generated {
  border-radius: 22%;
}

.project-media-homesafe {
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 214, 143, 0.48), transparent 24%),
    linear-gradient(135deg, #211406 0%, #d1973c 100%);
}

.project-media-deepdark {
  background:
    radial-gradient(circle at 76% 20%, rgba(214, 237, 166, 0.42), transparent 25%),
    linear-gradient(135deg, #111b0e 0%, #6d8a4f 100%);
}

.project-media-libpq {
  background:
    radial-gradient(circle at 76% 20%, rgba(214, 237, 166, 0.42), transparent 25%),
    linear-gradient(135deg, #111b0e 0%, #6d8a4f 100%);
}

.project-media-beacon {
  background:
    radial-gradient(circle at 82% 18%, rgba(127, 245, 239, 0.36), transparent 24%),
    radial-gradient(circle at 18% 82%, rgba(209, 151, 60, 0.32), transparent 26%),
    linear-gradient(135deg, #07121e 0%, #2b6f87 100%);
}

.project-body {
  display: flex;
  flex-direction: column;
  padding: 26px;
}

.project-meta {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
}

.project-body h3 {
  margin-bottom: 10px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 18px;
  padding: 0;
  list-style: none;
}

.project-tags li {
  padding: 5px 7px;
  border: 1px solid rgba(95, 104, 100, 0.18);
  border-radius: 999px;
  background: #f5f3ed;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.project-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 0;
  color: var(--teal);
  font-weight: 800;
}

.project-action::after {
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.project-card:hover .project-action::after,
.project-card:focus-within .project-action::after {
  transform: translateX(4px) rotate(45deg);
}

.principle-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.principle-list div {
  min-height: 190px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(251, 250, 246, 0.9)),
    var(--paper-soft);
}

.principle-icon {
  position: relative;
  display: block;
  width: 38px;
  height: 38px;
  margin-bottom: 22px;
  border: 1px solid rgba(8, 127, 130, 0.22);
  border-radius: 8px;
  background: rgba(8, 127, 130, 0.07);
}

.principle-icon::before,
.principle-icon::after {
  position: absolute;
  content: "";
}

.principle-icon-workflow::before {
  inset: 9px 8px 13px;
  border: 2px solid var(--teal);
  border-top: 0;
}

.principle-icon-workflow::after {
  top: 8px;
  left: 17px;
  width: 4px;
  height: 20px;
  background: var(--amber);
}

.principle-icon-shape::before {
  inset: 9px;
  border: 2px solid var(--teal);
  border-radius: 5px;
}

.principle-icon-shape::after {
  top: 2px;
  right: 9px;
  bottom: 2px;
  width: 4px;
  border-radius: 999px;
  background: var(--green);
}

.principle-icon-release::before {
  top: 10px;
  left: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow:
    14px 3px 0 var(--green),
    7px 17px 0 var(--amber);
}

.principle-icon-release::after {
  inset: 14px 9px 12px 14px;
  border-top: 1px solid rgba(8, 127, 130, 0.52);
  border-bottom: 1px solid rgba(8, 127, 130, 0.52);
  transform: rotate(24deg);
}

.contact-section {
  align-items: center;
  padding-top: 48px;
  padding-bottom: 88px;
  border-top: 1px solid var(--line);
}

.contact-section p:not(.section-kicker) {
  max-width: 420px;
  color: var(--muted);
}

.contact-actions {
  justify-content: flex-end;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px max(var(--content-gutter), calc((100vw - var(--content-width)) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--teal);
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 1180px) {
  .project-grid {
    grid-template-columns: repeat(5, minmax(280px, 1fr));
    padding: 4px 0 14px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-color: rgba(8, 127, 130, 0.38) transparent;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  .project-card {
    scroll-snap-align: start;
  }
}

@media (max-width: 900px) {
  .site-header {
    padding: 14px 24px;
  }

  .hero-content {
    width: 100%;
    margin: 0;
    padding-right: 24px;
    padding-left: 24px;
  }

  .hero-image {
    object-position: 20% center;
  }

  h1 {
    font-size: 3.35rem;
  }

  h2 {
    font-size: 1.85rem;
  }

  .section {
    width: min(100% - 32px, 720px);
    padding: 54px 0;
  }

  .contact-section,
  .principle-list {
    grid-template-columns: 1fr;
  }

  .project-card-link {
    grid-template-rows: 184px 1fr;
  }

  .project-media {
    min-height: 184px;
  }

  .contact-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header {
    position: absolute;
    align-items: flex-start;
    padding: 14px 16px;
  }

  .brand span:last-child {
    display: none;
  }

  .nav-links {
    gap: 2px;
  }

  .nav-links a {
    padding: 8px 9px;
    font-size: 0.84rem;
  }

  .hero {
    --hero-height: auto;
    min-height: 0;
    background: #030a0c;
  }

  .hero-image {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
  }

  .hero-shade {
    display: none;
  }

  .hero-content {
    width: 100%;
    margin: 0;
    min-height: 0;
    justify-content: flex-end;
    padding: 24px 16px 26px;
    background: none;
  }

  h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 10vw, 2.35rem);
  }

  .hero-tagline {
    margin-bottom: 22px;
    font-size: 0.95rem;
  }

  .hero-actions {
    align-items: flex-start;
  }

  .button {
    justify-content: center;
    width: auto;
    min-width: 150px;
    min-height: 44px;
    padding: 10px 16px;
  }

  .section {
    width: calc(100% - 28px);
    padding: 34px 0;
  }

  .intro {
    padding-top: 24px;
    padding-bottom: 10px;
  }

  .work-section {
    padding-top: 12px;
    padding-bottom: 18px;
  }

  .project-grid {
    align-items: start;
    grid-template-columns: repeat(5, minmax(272px, 82vw));
    gap: 14px;
    padding-bottom: 0;
    scrollbar-width: none;
  }

  .project-grid::-webkit-scrollbar {
    display: none;
  }

  .project-card {
    align-self: start;
  }

  .project-card-link {
    grid-template-rows: 184px 1fr;
    height: auto;
  }

  .project-media {
    min-height: 184px;
  }

  .project-body,
  .principle-list div {
    padding: 24px;
  }

  .project-body p:not(.project-type) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .project-tags {
    margin: 18px 0 16px;
  }

  .contact-section {
    border-top: 0;
    gap: 24px;
    padding-top: 18px;
    padding-bottom: 34px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 16px;
  }
}
