:root {
  color-scheme: light;
  --background: #f7f8fc;
  --ink: #171926;
  --muted: #565b70;
  --blue: #2728ad;
  --line: #c9ccda;
  --display: "Space Grotesk", "Arial", sans-serif;
  --gutter: clamp(1.25rem, 4.6vw, 4.75rem);
  font-family: "DM Sans", "Arial", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--ink); }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
h1, h2, h3, h4, p { margin: 0; }
img { display: block; max-width: 100%; }
.wrap { width: min(100% - 2 * var(--gutter), 82rem); margin-inline: auto; }
::selection { background: var(--blue); color: white; }

.skip {
  position: absolute;
  z-index: 5;
  top: .5rem;
  left: .5rem;
  padding: .75rem 1rem;
  background: var(--blue);
  color: white;
  transform: translateY(-150%);
}
.skip:focus { transform: none; }

.site-header {
  min-height: 4.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.mark {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding-right: .5rem;
  font: 700 1.75rem/1 var(--display);
  letter-spacing: -.09em;
}
.mark span { color: var(--blue); }
.site-header nav { display: flex; align-items: center; gap: clamp(1rem, 3.1vw, 2.7rem); }
.site-header nav a { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .9375rem; font-weight: 600; }
.site-header nav a:hover { color: var(--blue); }
.nav-contact { color: var(--blue); }

.hero { padding-block: clamp(2.65rem, 4.4vw, 5.25rem) clamp(1.65rem, 2.6vw, 3.5rem); }
.role {
  margin-bottom: clamp(.75rem, 1.6vw, 1.5rem);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .115em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero h1 {
  font: 700 clamp(3.2rem, 11.25vw, 10.5rem)/.96 var(--display);
  letter-spacing: -.081em;
  color: var(--blue);
}
.hero h1 span { white-space: nowrap; }
.hero-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(1.2rem, 2.6vw, 2.45rem);
}
.hero-summary p {
  max-width: 29rem;
  font-size: clamp(1.05rem, 1.52vw, 1.3rem);
  line-height: 1.45;
  text-wrap: pretty;
}
.button {
  flex-shrink: 0;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding-inline: .9rem;
  border: 1px solid var(--blue);
  border-radius: 2px;
  color: var(--blue);
  font-size: .9375rem;
  font-weight: 700;
  transition: color .18s, background .18s;
}
.button:hover { background: var(--blue); color: white; }
.button:focus-visible { outline-color: var(--blue); }

.work { padding-bottom: clamp(3.5rem, 7vw, 7rem); }
.section-heading {
  border-top: 1px solid var(--line);
  padding-block: 1.05rem 1.25rem;
}
.section-heading h2 {
  font: 700 clamp(1.45rem, 2.5vw, 2.15rem)/1.15 var(--display);
  letter-spacing: -.055em;
}
.featured { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr); gap: clamp(1.25rem, 2.5vw, 2.25rem); }
.cover {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(14rem, 28vw, 26rem);
  overflow: hidden;
  border: 1px solid #d6daea;
  border-radius: 2px;
}
.rider { background: #e2e6f0; }
.rider::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, #8490ae32 0 1px, transparent 1px 34px),
              repeating-linear-gradient(0deg, #8490ae32 0 1px, transparent 1px 34px);
  mask-image: radial-gradient(ellipse, #000 28%, transparent 84%);
}
.device {
  position: absolute;
  width: 34%;
  aspect-ratio: .78;
  overflow: hidden;
  border-radius: 11% 11% 0 0;
  background: #16171b;
  box-shadow: .65rem .9rem 2.1rem #20294440;
  transition: transform .3s ease-out;
}
.device-ride { left: 22%; bottom: -10%; transform: rotate(-9deg); z-index: 1; }
.device-voice { right: 19%; bottom: -1%; transform: rotate(8deg); }
.project .device-ride { bottom: -3%; }
.project .device-voice { bottom: 7%; }
.device img { width: 121%; max-width: none; height: auto; margin-inline: -10.5%; transform: translateY(-27%); }
.rider:hover .device-ride { transform: translateY(-3%) rotate(-10deg); }
.rider:hover .device-voice { transform: translateY(-4%) rotate(9deg); }
.mox { background: #eaecf7; }
.mox img {
  width: 84%;
  height: auto;
  border-radius: 5px;
  outline: 1px solid #a7afcb66;
  box-shadow: 0 .85rem 1.9rem #30395e23;
  transform: translateY(12%);
  transition: transform .3s ease-out;
}
.mox:hover img { transform: translateY(7%); }
.cover:focus-visible { outline-color: var(--blue); }
.cover[data-preview]::after {
  content: attr(data-preview);
  position: absolute;
  z-index: 2;
  top: .7rem;
  right: .7rem;
  padding: .3rem .6rem;
  border: 1px solid #2728ad28;
  border-radius: 2px;
  background: var(--background);
  color: var(--blue);
  font-size: .875rem;
  font-weight: 700;
  transition: color .2s, background .2s;
}
.cover[data-preview]:is(:hover, :focus-visible)::after { background: var(--blue); color: white; }

.project-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .2rem .6rem;
  margin-bottom: .7rem;
}
.category { color: var(--muted); font-size: .9375rem; font-weight: 600; }
.project-heading h3 { font: 700 clamp(1.65rem, 3.4vw, 2.6rem)/1.05 var(--display); letter-spacing: -.068em; }
.repository h4 a:hover { color: var(--blue); }
.project-info p { max-width: 32rem; margin-top: .75rem; line-height: 1.53; color: var(--muted); }
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: underline;
  text-decoration-color: #2728ad80;
  text-underline-offset: .25em;
  font-size: .9375rem;
  font-weight: 700;
  color: var(--blue);
}
.project-info .text-link { margin-top: .32rem; }
.text-link:hover { text-decoration-color: currentColor; }
.repositories { margin-top: clamp(2.6rem, 5.75vw, 5.5rem); }
.repositories > h3 { margin-bottom: 1rem; font: 700 1.65rem/1.16 var(--display); letter-spacing: -.06em; }
.repository {
  display: grid;
  grid-template-columns: minmax(11.5rem, 1fr) minmax(15rem, 1.3fr) max-content;
  align-items: center;
  gap: 1.3rem;
  padding-block: .7rem;
  border-top: 1px solid var(--line);
}
.repository:last-child { border-bottom: 1px solid var(--line); }
.repository h4 { font: 700 clamp(1.15rem, 2vw, 1.5rem)/1.25 var(--display); letter-spacing: -.045em; }
.repository p { color: var(--muted); line-height: 1.5; }

.contact { background: var(--blue); color: white; }
.contact h2 { font: 700 clamp(2.3rem, 5.5vw, 5rem)/1.03 var(--display); letter-spacing: -.067em; }
.contact-inner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: clamp(2.65rem, 6vw, 5.25rem);
}
.email {
  display: inline-block;
  margin-top: 1rem;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .23em;
}
.contact-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding-inline: 1.1rem;
  border: 1px solid #ffffffad;
  border-radius: 2px;
  font-weight: 700;
}
.contact-social:hover { background: white; color: var(--blue); }
.contact-social:focus-visible { outline-color: white; }
.footer-line {
  border-top: 1px solid #ffffff5c;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .85rem;
  min-height: 3.5rem;
  font-size: .875rem;
  font-weight: 600;
}
.footer-line a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.footer-line a:hover { text-decoration: underline; }

body:has(.project-view[open]) { overflow: hidden; }
.project-view {
  width: min(100% - 2rem, 70rem);
  max-width: none;
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  overscroll-behavior: contain;
  background: var(--background);
  color: var(--ink);
  box-shadow: 0 1.6rem 7rem #11132e48;
}
.project-view[open] { animation: view-open .32s cubic-bezier(.21,.72,.27,1) both; }
.project-view::backdrop { background: #16163790; backdrop-filter: blur(5px); animation: view-dim .24s both; }
.view-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .6rem clamp(.8rem, 2.5vw, 1.6rem);
  border-bottom: 1px solid var(--line);
  background: var(--background);
}
.view-switch { display: flex; gap: .2rem; }
.view-bar button {
  min-height: 2.75rem;
  padding-inline: .7rem;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font: 700 .9375rem/1.1 "DM Sans", sans-serif;
  cursor: pointer;
}
.view-bar button[aria-pressed="true"] { background: #e5e6f8; color: var(--blue); }
.view-bar button:hover { color: var(--blue); border-color: var(--line); }
.view-close { text-decoration: underline; text-underline-offset: .22em; }
.view-content { overflow: hidden; }
.view-stage {
  --wipe-start: polygon(0 0, 4% 0, 20% 100%, 0 100%);
  --slide: 1.2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.3rem, 3.1vw, 3rem);
  padding: clamp(.8rem, 2.5vw, 1.6rem);
}
.view-stage[data-direction="back"] {
  --wipe-start: polygon(96% 0, 100% 0, 100% 100%, 80% 100%);
  --slide: -1.2rem;
}
.view-art {
  height: auto;
  aspect-ratio: 1.38;
  animation: view-reveal .52s cubic-bezier(.22,.7,.2,1) both;
}
.view-art .device { width: 38%; }
.view-art.mox img { transform: none; }
.view-info { animation: view-copy .38s cubic-bezier(.22,.7,.2,1) .09s both; }
.view-info h2 {
  margin-block: .35rem .65rem;
  color: var(--blue);
  font: 700 clamp(2.2rem, 5.2vw, 4.5rem)/1 var(--display);
  letter-spacing: -.07em;
  overflow-wrap: anywhere;
}
.view-description { max-width: 30rem; font-size: 1rem; line-height: 1.56; color: var(--muted); }
.view-info .button { margin-top: 1rem; }

@keyframes view-open {
  from { opacity: 0; transform: translateY(1rem) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes view-dim { from { opacity: 0; } to { opacity: 1; } }
@keyframes view-reveal {
  from { clip-path: var(--wipe-start); transform: scale(.975); }
  to { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); transform: none; }
}
@keyframes view-copy {
  from { opacity: 0; transform: translateX(var(--slide)); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 700px) {
  .site-header { min-height: 4rem; }
  .site-header nav { gap: clamp(.75rem, 4vw, 1.5rem); }
  .site-header nav a { font-size: .875rem; }
  .hero { padding-block: clamp(2.45rem, 7.25vw, 3.6rem) 1.9rem; }
  .hero h1 { font-size: clamp(3.2rem, 15.4vw, 6.45rem); }
  .hero h1 span { display: block; }
  .hero-summary { align-items: start; flex-direction: column; }
  .hero-summary p { max-width: 23rem; }
  .featured { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.7rem, 3vw, 1.3rem); }
  .cover { height: auto; aspect-ratio: 1.42; }
  .project .cover[data-preview]::after { top: .34rem; right: .34rem; padding: .23rem .36rem; font-size: .8125rem; }
  .project .device { width: 42%; }
  .project .device-ride { left: 13%; }
  .project .device-voice { right: 13%; }
  .project .mox img { width: 90%; }
  .project-heading { flex-direction: column; }
  .project-heading h3 { font-size: clamp(1.42rem, 6vw, 2.2rem); letter-spacing: -.055em; }
  .project-heading .category { font-size: .875rem; }
  .repository { grid-template-columns: minmax(0, 1fr) auto; column-gap: .85rem; row-gap: .25rem; padding-block: .9rem; }
  .repository p { grid-column: 1; grid-row: 2; }
  .repository a.text-link { grid-column: 2; grid-row: 1 / span 2; }
  .contact-inner { flex-wrap: wrap; }
  .project-view { width: calc(100% - 1rem); max-height: calc(100% - 1rem); margin: auto .5rem .5rem; }
  .view-stage { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-bottom: 1.1rem; }
  .view-art { aspect-ratio: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, .project-view::backdrop { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
