:root {
  color-scheme: light;
  --paper: #f8f7fb;
  --ink: #1c1827;
  --muted: #544f62;
  --line: #dedbe7;
  --accent: #5542a1;
  --lavender: #cebfff;
  --night: #221b35;
  --radius: 1.5rem;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img { display: block; width: 100%; }

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

.skip-link {
  position: fixed;
  z-index: 2;
  inset: 0.75rem auto auto 0.75rem;
  padding: 0.625rem 1rem;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

.wrap {
  width: min(74rem, calc(100% - 2 * clamp(1.125rem, 5vw, 4rem)));
  margin-inline: auto;
}

.site-header { border-bottom: 1px solid var(--line); }

.header-inner,
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

.header-inner { min-height: 4.75rem; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.125rem;
  font-weight: 780;
  letter-spacing: -0.045em;
  white-space: nowrap;
  text-decoration: none;
}

.brand-spot {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.875rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
}

.brand-spot::before {
  content: "";
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--lavender);
  transform: translate(12%, -12%);
}

.site-header nav {
  display: flex;
  gap: clamp(0.65rem, 3vw, 2rem);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.site-header nav a,
.site-footer a { text-decoration-color: transparent; text-underline-offset: 0.25em; }
.site-header nav a { padding-block: 0.5rem; }
.site-header nav a:hover,
.site-footer a:hover { color: var(--accent); text-decoration-color: currentColor; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding-block: clamp(3.5rem, 7vw, 4.625rem);
}

.hero h1 {
  font-size: clamp(3.5rem, 7.25vw, 6.75rem);
  font-weight: 790;
  letter-spacing: -0.06em;
  word-spacing: 0.035em;
  line-height: 0.98;
}

.hero h1 em {
  display: block;
  color: var(--accent);
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -0.065em;
}

.hero-copy > p {
  max-width: 30ch;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.65vw, 1.3125rem);
  line-height: 1.55;
}

.hero-art {
  position: relative;
  isolation: isolate;
  width: min(100%, 27.5rem);
  justify-self: end;
  aspect-ratio: 1.26;
  overflow: clip;
}

.orbit-field {
  --orbit-tilt: -28deg;
  position: absolute;
  inset: 6% 4%;
  transform: translate(var(--spot-x, 0), var(--spot-y, 0)) rotate(var(--orbit-tilt));
  transition: transform 350ms ease-out;
}

.orbit {
  position: absolute;
  inset: 0;
  margin: auto;
}

.orbit-outer { width: 96%; height: 54%; }
.orbit-middle { width: 82%; height: 46%; }
.orbit-inner { width: 68%; height: 38%; }

.orbit::before,
.orbit::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #a597c7;
  border-radius: 50%;
}

.orbit::before { clip-path: inset(0 0 50%); }
.orbit::after { z-index: 2; clip-path: inset(50% 0 0); border-color: #9579c7; }

.hero-spot {
  position: absolute;
  z-index: 1;
  inset: 50% auto auto 50%;
  width: 53%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(calc(-1 * var(--orbit-tilt)));
  border: 1px solid #9c86e5;
  border-radius: 50%;
  background: radial-gradient(circle at 29% 23%, #eee6ff, #c4afff 48%, #9673ec 100%);
  box-shadow: inset -0.25rem -0.35rem 1rem #4e299e20, 0 1rem 2.4rem #7454b43b;
}

.orbit-moon {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-middle .orbit-moon {
  --orbit-duration: 15s;
  --orbit-delay: -5.7s;
  z-index: 3;
  top: 87%;
  left: 16.5%;
  width: 6.25%;
  background: radial-gradient(circle at 36% 25%, #5d4d7d, var(--night) 68%);
}

.orbit-outer .orbit-moon {
  --orbit-duration: 22s;
  --orbit-delay: -18.7s;
  top: 11.6%;
  left: 82%;
  width: 3.8%;
  background: radial-gradient(circle at 36% 25%, #f3a082, #c8563d 75%);
}

@supports (offset-path: ellipse(50% 50%)) {
  .has-orbit-animation .orbit-moon {
    top: 0;
    left: 0;
    transform: none;
    offset-path: ellipse(50% 50%);
    offset-rotate: 0deg;
    animation:
      orbit-travel var(--orbit-duration) linear var(--orbit-delay) infinite,
      orbit-depth var(--orbit-duration) step-end var(--orbit-delay) infinite;
    animation-play-state: var(--orbit-play-state, paused);
  }

  .is-orbiting { --orbit-play-state: running; }

  @keyframes orbit-travel {
    from { offset-distance: 0%; }
    to { offset-distance: 100%; }
  }

  /* The first half of the clockwise path is the foreground arc. */
  @keyframes orbit-depth {
    from { z-index: 3; }
    50%, to { z-index: 0; }
  }
}

.orbit-toggle {
  position: absolute;
  inset: auto 0.375rem 0.375rem auto;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--accent);
  cursor: pointer;
}

.orbit-toggle:not([hidden]) { display: grid; }
.orbit-toggle:hover { border-color: currentColor; }

.orbit-toggle::before {
  content: "";
  width: 0.625rem;
  height: 0.75rem;
  border-inline: 2px solid currentColor;
}

.orbit-toggle[aria-pressed="true"]::before {
  width: 0;
  height: 0;
  margin-left: 0.125rem;
  border: 0.375rem solid transparent;
  border-right: 0;
  border-left: 0.625rem solid currentColor;
}

.projects,
.project-card { scroll-margin-top: 1.25rem; }

.section-heading {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  margin-bottom: 1.125rem;
}

.section-heading h2 {
  font-size: 1.125rem;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.section-heading::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr);
  min-height: 24rem;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--night);
  color: var(--paper);
}

.project-art { overflow: hidden; }
.project-art img { height: 100%; object-fit: cover; }
.featured-art { min-height: 0; background: #091522; }
.featured-art img { object-position: 50% 53%; }

.featured-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.625rem, 4vw, 3.25rem);
}

.project-type {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.625rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 690;
  line-height: 1.35;
}

.featured .project-type { color: #d8caff; }

.featured h3,
.project-card h3 {
  margin-top: 0.375rem;
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 1.06;
}

.featured h3 { font-size: clamp(2.75rem, 5vw, 4.625rem); }
.featured .subtitle { margin-top: 0.375rem; color: #e7dbff; font-size: 1.125rem; }
.project-description { margin-top: 0.75rem; color: var(--muted); line-height: 1.6; }
.featured .project-description { margin-top: 1.0625rem; color: #eee7f9; }

.project-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 2.75rem;
  margin-top: 0.75rem;
  padding: 0.625rem 1.125rem;
  border-radius: 0.5rem;
  background: #e1d7ff;
  color: #211934;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}

.project-link:hover { background: #d2c5f7; }
.featured .project-link { margin-top: 1.375rem; }
.featured .project-link:focus-visible { outline-color: #e1d7ff; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 23.5rem), 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.project-card {
  overflow: hidden;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.card-art { aspect-ratio: 2 / 1; }
.iptv-art { background: #171426; }
.machine-art { background: #c58d76; }
.card-copy { padding: clamp(1.25rem, 3.75vw, 2rem); }
.card-copy .project-type { min-height: 1.5rem; }
.project-card h3 { font-size: clamp(2rem, 3.7vw, 3.125rem); }

.project-status {
  border-radius: 0.25rem;
  padding: 0.16rem 0.4rem;
  background: #fff0dc;
  color: #753d12;
}

.site-footer {
  margin-top: clamp(3rem, 7vw, 5.25rem);
  padding-block: 1.35rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer a { padding-block: 0.5rem; }

@media (max-width: 52rem) {
  .hero h1 { font-size: clamp(3rem, 8.9vw, 4.75rem); }
  .featured { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .featured h3 { font-size: clamp(2.625rem, 6vw, 4rem); }
}

@media (max-width: 39rem) {
  .header-inner { min-height: 4rem; }
  .hero { grid-template-columns: 1fr; gap: 0.75rem; padding-block: 2.875rem 1.875rem; }
  .hero h1 { font-size: clamp(3rem, 11vw, 4.25rem); }
  .hero-copy > p { margin-top: 1.125rem; }
  .hero-art { width: min(76%, 16rem); justify-self: center; aspect-ratio: 1.4; }
  .featured { grid-template-columns: minmax(0, 1fr); }
  .featured-art { aspect-ratio: 1.75; }
  .featured-copy { padding: 1.5rem; }
  .card-art { aspect-ratio: 1.95; }
}

@media (max-width: 24rem) {
  .header-inner { gap: 0.25rem 0.75rem; flex-wrap: wrap; padding-block: 0.5rem; }
  .site-header nav { gap: 0 0.75rem; flex-wrap: wrap; }
  .hero h1 { font-size: clamp(2.375rem, 13vw, 3.125rem); }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  .orbit-field { transform: rotate(var(--orbit-tilt)); transition: none; }
  .has-orbit-animation .orbit-moon { animation-play-state: paused; }
}
