:root {
  color-scheme: dark;
  --bg: #03090c;
  --panel: rgba(7, 18, 23, 0.88);
  --panel-solid: #071217;
  --ink: #eefcff;
  --muted: #8fa7ad;
  --line: rgba(128, 232, 255, 0.18);
  --cyan: #63efff;
  --cyan-hot: #b8f8ff;
  --green: #72ffb2;
  --shell: min(1480px, calc(100vw - 56px));
  --sans: "Space Grotesk", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 77% -12%, rgba(40, 219, 255, 0.16), transparent 32rem),
    linear-gradient(180deg, #020608 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 239, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 239, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
  content: "";
  pointer-events: none;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border: 1px solid var(--cyan);
  background: var(--bg);
  color: var(--cyan);
  font: 500 12px var(--mono);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-frame {
  width: var(--shell);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan);
  color: var(--cyan-hot);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
  box-shadow: inset 0 0 16px rgba(99, 239, 255, 0.08), 0 0 18px rgba(99, 239, 255, 0.08);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  width: 7px;
  height: 7px;
  content: "";
}

.brand-mark::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--cyan-hot);
  border-left: 2px solid var(--cyan-hot);
}

.brand-mark::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid var(--cyan-hot);
  border-bottom: 2px solid var(--cyan-hot);
}

.brand-mark > span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 7px;
  height: 2px;
  background: var(--cyan);
  transform: rotate(45deg);
}

.brand-name {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.045em;
}

.studio-label,
.eyebrow,
.signal,
.card-number,
.card-state,
.card-kicker,
.card-links,
.site-footer {
  font-family: var(--mono);
}

.studio-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.studio-label > span,
.signal > span,
.card-state > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.site-header nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-header nav a {
  color: var(--muted);
  font: 500 11px var(--mono);
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: color 160ms ease;
}

.site-header nav a:hover {
  color: var(--cyan-hot);
}

.site-header nav .contact-link {
  padding: 10px 14px;
  border: 1px solid var(--line);
  color: var(--ink);
}

.site-header nav .contact-link:hover {
  border-color: var(--cyan);
}

main {
  min-height: 0;
  display: grid;
  align-content: center;
  padding: clamp(24px, 4.2vh, 46px) 0 clamp(20px, 3vh, 34px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.6fr);
  align-items: end;
  gap: 40px;
  margin-bottom: clamp(24px, 4vh, 40px);
}

.eyebrow {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow > span {
  margin-right: 11px;
  color: var(--cyan);
}

h1 {
  max-width: 970px;
  margin: 0;
  font-size: clamp(42px, 5.1vw, 76px);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.065em;
}

h1 em {
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 1px var(--cyan);
  text-shadow: 0 0 24px rgba(99, 239, 255, 0.16);
}

.hero-aside {
  align-self: end;
  padding-bottom: 3px;
}

.hero-aside > p {
  max-width: 420px;
  margin: 0;
  color: #aec1c6;
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.55;
}

.signal {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 21px;
  color: var(--cyan-hot);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

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

.project-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(14, 33, 41, 0.95), rgba(5, 13, 17, 0.96));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.project-card::before {
  position: absolute;
  z-index: 5;
  top: -1px;
  right: -1px;
  width: 27px;
  height: 27px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  content: "";
  transition: border-color 180ms ease;
}

.project-card:hover {
  z-index: 2;
  border-color: rgba(99, 239, 255, 0.58);
  transform: translateY(-4px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36), 0 0 35px rgba(99, 239, 255, 0.06);
}

.card-visual {
  position: relative;
  height: clamp(155px, 22vh, 235px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #061218;
}

.card-visual > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.74) contrast(1.04) brightness(0.68);
  transform: scale(1.01);
  transition: filter 300ms ease, transform 500ms cubic-bezier(.2, .7, .2, 1);
}

.project-card:hover .card-visual > img {
  filter: saturate(0.92) contrast(1.03) brightness(0.78);
  transform: scale(1.035);
}

.visual-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(1, 7, 9, 0.68), transparent 44%, rgba(1, 7, 9, 0.44)),
    linear-gradient(90deg, rgba(7, 34, 40, 0.22), transparent);
  pointer-events: none;
}

.card-number,
.card-state {
  position: absolute;
  z-index: 2;
  top: 16px;
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-number {
  left: 17px;
  color: var(--cyan-hot);
}

.card-state {
  right: 25px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #d6e7ea;
}

.card-state > span {
  width: 5px;
  height: 5px;
}

.card-body {
  padding: clamp(17px, 2vw, 25px);
}

.card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.card-kicker {
  margin: 0 0 7px;
  color: var(--cyan);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.card-heading h2 {
  margin: 0;
  font-size: clamp(25px, 2.25vw, 36px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.055em;
}

.arrow-link {
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-size: 17px;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.arrow-link:hover {
  border-color: var(--cyan);
  background: var(--cyan);
  color: var(--bg);
}

.card-description {
  min-height: 42px;
  margin: 15px 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.card-links a {
  position: relative;
  color: #afc5ca;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
}

.card-links a::after {
  position: absolute;
  right: 0;
  bottom: -4px;
  left: 0;
  height: 1px;
  background: var(--cyan);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease;
}

.card-links a:hover {
  color: var(--cyan-hot);
}

.card-links a:hover::after {
  transform: scaleX(1);
}

.terminal-visual {
  padding: 46px 20px 16px;
  background:
    linear-gradient(rgba(99, 239, 255, 0.045) 1px, transparent 1px),
    #051014;
  background-size: 100% 27px;
}

.terminal-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(99, 239, 255, 0.12);
  background: rgba(2, 8, 10, 0.84);
}

.terminal-bar > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid #45636a;
}

.terminal-bar > span:first-child {
  border-color: var(--cyan);
  box-shadow: 0 0 6px rgba(99, 239, 255, 0.5);
}

.terminal-bar > p {
  margin: 0 0 0 6px;
  color: #6c858b;
  font: 400 8px var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.terminal-copy {
  position: relative;
  z-index: 1;
  font: 400 clamp(8px, 0.72vw, 10px)/2 var(--mono);
}

.terminal-copy p {
  margin: 0;
  color: #93adb3;
  white-space: nowrap;
}

.terminal-copy i {
  margin-right: 12px;
  color: #4b6b72;
  font-style: normal;
}

.terminal-copy b {
  color: var(--green);
  font-weight: 500;
}

.terminal-active {
  color: var(--cyan-hot) !important;
}

.terminal-active > span {
  width: 6px;
  height: 12px;
  display: inline-block;
  margin-left: 4px;
  background: var(--cyan);
  vertical-align: middle;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.site-footer {
  min-height: 50px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-top: 1px solid var(--line);
  color: #647d83;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0;
}

.site-footer p:nth-child(2) {
  justify-self: center;
}

.site-footer a {
  justify-self: end;
  color: #89a4aa;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--cyan);
}

a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

@media (min-width: 1101px) and (min-height: 720px) {
  .site-frame {
    height: 100dvh;
  }
}

@media (max-width: 1100px) {
  .site-frame {
    width: min(920px, calc(100vw - 40px));
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-aside {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
  }

  .hero-aside > p {
    max-width: 620px;
  }

  .signal {
    flex: 0 0 auto;
    margin: 0;
  }

  .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-webtail {
    grid-column: span 2;
  }

  .project-webtail .card-visual {
    height: 190px;
  }
}

@media (max-width: 720px) {
  :root {
    --shell: calc(100vw - 28px);
  }

  .site-header {
    min-height: 65px;
    grid-template-columns: 1fr auto;
  }

  .studio-label,
  .site-header nav > a:first-child {
    display: none;
  }

  .site-header nav {
    gap: 0;
  }

  main {
    padding-top: 32px;
  }

  .hero {
    margin-bottom: 30px;
  }

  h1 {
    font-size: clamp(42px, 13.8vw, 62px);
  }

  .hero-aside {
    display: block;
  }

  .signal {
    margin-top: 17px;
  }

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

  .project-webtail {
    grid-column: auto;
  }

  .card-visual,
  .project-webtail .card-visual {
    height: min(52vw, 235px);
  }

  .card-description {
    min-height: 0;
  }

  .site-footer {
    min-height: 70px;
    grid-template-columns: 1fr auto;
  }

  .site-footer p:nth-child(2) {
    display: none;
  }
}

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

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