:root {
  --ink: #222222;
  --muted: #70757a;
  --line: #dddddd;
  --paper: #ffffff;
  --soft: #f7f7f4;
  --mist: #eef4f6;
  --paint: #d85f4f;
  --code: #167286;
  --split: 50%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #111111;
  color: #ffffff;
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 4vw, 42px);
  color: #d7d7d7;
  font-size: 0.96rem;
}

.site-nav a {
  text-decoration: none;
  text-transform: lowercase;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #ffffff;
}

.hero {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, #ffffff 0 50%, var(--mist) 50% 100%);
  touch-action: pan-y;
}

.hero-shell {
  position: relative;
  width: min(1120px, calc(100% - 40px));
  min-height: clamp(520px, calc(100svh - 132px), 680px);
  margin: 0 auto;
  display: flex;
  align-items: end;
  justify-content: center;
  padding-top: 44px;
}

.hero-side {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: 50%;
  display: flex;
  align-items: center;
  color: #62676c;
  text-decoration: none;
}

.hero-side-designer {
  left: 0;
  justify-content: flex-start;
  text-align: left;
}

.hero-side-coder {
  right: 0;
  justify-content: flex-end;
  text-align: right;
}

.role-copy {
  display: block;
  width: min(380px, 44vw);
  margin-top: -42px;
  opacity: 1;
  transition: opacity 220ms ease, transform 220ms ease;
}

.role-title {
  display: block;
  color: #333333;
  font-size: clamp(3rem, 8vw, 5.25rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: 0;
  transition: color 220ms ease, transform 220ms ease;
}

.role-text {
  display: block;
  max-width: 290px;
  margin-top: 14px;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.15rem);
  line-height: 1.45;
}

.hero-side-coder .role-text {
  margin-left: auto;
}

.hero[data-active="designer"] .hero-side-designer .role-title,
.hero-side-designer:focus-visible .role-title {
  color: var(--paint);
  transform: translateX(4px);
}

.hero[data-active="coder"] .hero-side-coder .role-title,
.hero-side-coder:focus-visible .role-title {
  color: var(--code);
  transform: translateX(-4px);
}

.hero[data-active="designer"] .hero-side-coder .role-copy {
  opacity: 0;
  transform: translateX(12px);
}

.hero[data-active="coder"] .hero-side-designer .role-copy {
  opacity: 0;
  transform: translateX(-12px);
}

.portrait {
  position: relative;
  z-index: 6;
  width: clamp(305px, 42vw, 500px);
  aspect-ratio: 1 / 1;
  margin: 0;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
}

.portrait-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
  user-select: none;
  transition: clip-path 420ms cubic-bezier(0.22, 1, 0.36, 1), filter 220ms ease;
}

.portrait-paint {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
  filter: saturate(1.05);
}

.portrait-color {
  clip-path: inset(0 0 0 var(--split));
}

.split-line {
  position: absolute;
  top: 4%;
  bottom: 0;
  left: var(--split);
  width: 2px;
  pointer-events: none;
  transform: translateX(-1px);
  background: linear-gradient(180deg, rgba(20, 20, 20, 0), rgba(20, 20, 20, 0.34) 18%, rgba(20, 20, 20, 0.3) 84%, rgba(20, 20, 20, 0));
  transition: left 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.code-cloud {
  position: absolute;
  right: clamp(10px, 8vw, 96px);
  bottom: clamp(34px, 7vw, 92px);
  z-index: 1;
  width: clamp(240px, 29vw, 360px);
  height: clamp(180px, 22vw, 280px);
  pointer-events: none;
  color: rgba(25, 31, 39, 0.16);
  font-family: "SFMono-Regular", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
  user-select: none;
}

.code-chip {
  position: absolute;
  display: block;
  line-height: 1;
  white-space: nowrap;
}

.code-chip-html {
  top: 8%;
  left: 8%;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.code-chip-rule {
  top: 26%;
  left: 0;
  font-size: clamp(0.95rem, 1.35vw, 1.15rem);
}

.code-chip-size {
  top: 41%;
  left: 12%;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
}

.code-chip-tag {
  top: 52%;
  left: 4%;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
}

.code-chip-word {
  top: 58%;
  right: 0;
  font-size: clamp(1.85rem, 3vw, 2.8rem);
  letter-spacing: 0;
}

.code-chip-color {
  bottom: 19%;
  left: 18%;
  font-size: clamp(1rem, 1.35vw, 1.14rem);
}

.code-chip-media {
  bottom: 6%;
  left: 10%;
  font-size: clamp(0.95rem, 1.3vw, 1.08rem);
}

.code-chip-js {
  top: 72%;
  right: 11%;
  font-size: clamp(0.92rem, 1.2vw, 1.02rem);
}

@media (min-width: 901px) {
  .hero-side {
    align-items: flex-start;
    padding-top: clamp(48px, 7svh, 72px);
  }

  .role-copy {
    margin-top: 0;
  }
}

.section-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.intro-band {
  background: #111111;
  color: #ffffff;
  padding: clamp(36px, 6vw, 72px) 0;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 6vw, 84px);
  align-items: start;
}

.intro-lead {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.04;
  font-weight: 800;
}

.intro-copy {
  margin: 0;
  color: #d0d5d8;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.section {
  padding: clamp(70px, 10vw, 120px) 0;
}

.work-section {
  background: var(--soft);
}

.section-heading {
  max-width: 690px;
  margin-bottom: clamp(34px, 6vw, 64px);
}

.eyebrow {
  margin: 0 0 12px;
  color: #777d82;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-heading h1,
.contact-layout h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.work-card {
  min-height: 430px;
  padding: 24px;
  border: 1px solid #d9d9d4;
  border-radius: 8px;
  background: #ffffff;
}

.work-card h2,
.service-list h2 {
  margin: 24px 0 10px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.work-card p,
.service-list p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.62;
}

.work-preview {
  position: relative;
  overflow: hidden;
  height: 210px;
  border: 1px solid #d7dbdd;
  border-radius: 6px;
  background: #f4f7f8;
}

.work-preview span {
  position: absolute;
  display: block;
  border-radius: 4px;
}

.preview-system span:nth-child(1) {
  inset: 18px 18px auto;
  height: 38px;
  background: #111111;
}

.preview-system span:nth-child(2) {
  left: 18px;
  bottom: 20px;
  width: 38%;
  height: 112px;
  background: #d85f4f;
}

.preview-system span:nth-child(3) {
  right: 18px;
  bottom: 20px;
  width: 42%;
  height: 112px;
  background: repeating-linear-gradient(135deg, #ffffff 0 8px, #d9e5e8 8px 16px);
}

.preview-commerce {
  background: #132124;
}

.preview-commerce span:nth-child(1) {
  left: 22px;
  top: 26px;
  width: 52%;
  height: 24px;
  background: #ffffff;
}

.preview-commerce span:nth-child(2) {
  left: 22px;
  top: 72px;
  width: 72%;
  height: 68px;
  background: #86c7d2;
}

.preview-commerce span:nth-child(3) {
  left: 22px;
  bottom: 24px;
  width: 116px;
  height: 34px;
  background: #f3c660;
}

.preview-motion {
  background: linear-gradient(135deg, #f9f4ed, #d8ecef);
}

.preview-motion span:nth-child(1) {
  width: 92px;
  height: 92px;
  left: 22px;
  top: 22px;
  border-radius: 50%;
  background: #167286;
}

.preview-motion span:nth-child(2) {
  width: 128px;
  height: 20px;
  right: 22px;
  top: 46px;
  background: #232323;
}

.preview-motion span:nth-child(3) {
  right: 22px;
  bottom: 24px;
  width: 56%;
  height: 92px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #d4d6d6;
}

.service-section {
  background: #ffffff;
}

.services-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(34px, 8vw, 92px);
  align-items: start;
}

.service-list {
  display: grid;
  gap: 28px;
}

.service-list div {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.service-list h2 {
  margin-top: 0;
}

.contact-band {
  padding: clamp(58px, 8vw, 96px) 0;
  background: #111111;
  color: #ffffff;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
}

.contact-layout .eyebrow {
  color: #9ea7ac;
}

.contact-layout h1 {
  max-width: 760px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
}

.contact-link:hover,
.contact-link:focus-visible {
  background: #ffffff;
  color: #111111;
}

@media (max-width: 900px) {
  .hero {
    background: linear-gradient(180deg, #ffffff 0 56%, var(--mist) 56% 100%);
  }

  .hero-shell {
    min-height: auto;
    padding: 34px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .portrait {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    width: min(78vw, 430px);
  }

  .code-cloud {
    display: none;
  }

  .hero-side {
    position: relative;
    grid-row: 1;
    width: auto;
    min-height: auto;
    align-items: start;
    padding-bottom: 18px;
  }

  .hero-side-designer {
    grid-column: 1;
  }

  .hero-side-coder {
    grid-column: 2;
  }

  .role-copy {
    width: 100%;
    margin-top: 0;
  }

  .role-title {
    font-size: clamp(2.2rem, 10vw, 4.6rem);
  }

  .role-text {
    display: none;
  }

  .intro-grid,
  .services-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }

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

  .work-card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .header-inner {
    width: min(100% - 28px, 1120px);
    height: 64px;
  }

  .site-nav {
    gap: 16px;
    font-size: 0.88rem;
  }

  .hero-shell,
  .section-inner {
    width: min(100% - 28px, 1120px);
  }

  .hero-shell {
    padding-top: 28px;
  }

  .hero-side {
    padding-bottom: 12px;
  }

  .role-title {
    font-size: clamp(1.9rem, 8.4vw, 3.4rem);
  }

  .portrait {
    width: min(88vw, 360px);
  }

  .contact-link {
    width: 100%;
  }
}

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

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