/* Self-hosted fonts, SIL Open Font License. Latin subset only. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-500-latin.woff2") format("woff2");
}

:root {
  --bg: #090d0e;
  --surface: #10171a;
  --surface-2: #162125;
  --line: #1f2d30;
  --line-strong: #2c3f43;
  --text: #e6f2f0;
  --muted: #8fa6a3;
  --faint: #6c8381;
  --accent: #4fe3cf;
  --accent-strong: #00d2be;
  --accent-hover: #2be0cc;
  --on-accent: #032521;
  --ok: #3ddc97;
  --warn: #f5b544;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-weight: 600;
}

.skip:focus {
  top: 16px;
}

.label {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 600 15px/1 var(--font-display);
  letter-spacing: 0.02em;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 24%;
}

.site-nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
  color: var(--muted);
}

.site-nav a:hover {
  color: var(--text);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  font: 500 15px/1 var(--font-body);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn:hover {
  border-color: #3e565b;
  background: var(--surface-2);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--on-accent);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding-block: clamp(40px, 8vh, 96px) clamp(64px, 10vh, 120px);
}

.hero .label {
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(48px, 7vw, 100px);
  line-height: 0.95;
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
}

.lede {
  max-width: 40ch;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--muted);
  margin: 0 0 40px;
  text-wrap: pretty;
}

.lede strong {
  color: var(--text);
  font-weight: 500;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- network diagram ---------- */

.diagram {
  width: 100%;
  max-width: 560px;
  justify-self: end;
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, #000 65%, transparent 100%);
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, #000 65%, transparent 100%);
}

.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.diagram .link {
  stroke: var(--line-strong);
  stroke-width: 1.25;
  fill: none;
}

.diagram .link.trunk {
  stroke: #3b5a5e;
  stroke-width: 1.5;
}

.diagram .link.down {
  stroke: var(--warn);
  stroke-dasharray: 4 5;
  opacity: 0.65;
}

.diagram .icon {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.diagram .glyph {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diagram .dot {
  fill: var(--accent);
}

.diagram .cloud .icon {
  stroke: #7fa9a3;
}

.diagram .host,
.diagram .speed {
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 5px;
  stroke-linejoin: round;
  text-anchor: middle;
}

.diagram .host {
  font: 500 10.5px var(--font-mono);
  fill: var(--muted);
}

.diagram .speed {
  font: 500 9.5px var(--font-mono);
  fill: var(--faint);
}

.diagram .led {
  stroke: var(--bg);
  stroke-width: 2;
  fill: var(--ok);
}

.diagram .led.warn {
  fill: var(--warn);
}

.diagram .packet {
  fill: #b9f7ee;
  filter: url(#glow);
}

/* ---------- DashyNMS ---------- */

.project {
  border-top: 1px solid var(--line);
  padding-block: clamp(72px, 10vw, 128px);
  overflow: hidden;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(48px, 6vw, 88px);
  align-items: center;
}

.project-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
}

.project-head img {
  width: 44px;
  height: 44px;
}

h2 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.tagline {
  font: 500 clamp(20px, 2vw, 24px)/1.35 var(--font-display);
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

.project-body {
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 46ch;
}

.platforms {
  list-style: none;
  margin: 0 0 36px;
  padding: 0;
  border-top: 1px solid var(--line);
}

.platforms li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.platforms svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-top: 2px;
}

.platforms h3 {
  font: 600 16px/1.3 var(--font-body);
  margin: 0 0 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.platforms .avail {
  font: 500 11.5px/1.2 var(--font-mono);
  color: var(--faint);
  letter-spacing: 0.02em;
}

.platforms p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

.pill {
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 99px;
  color: var(--accent);
  background: rgba(79, 227, 207, 0.1);
  border: 1px solid rgba(79, 227, 207, 0.25);
}

.project-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 500;
  font-size: 15px;
}

.textlink svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s;
}

.textlink:hover svg {
  transform: translate(2px, -2px);
}

.visual {
  position: relative;
  width: calc(100% + var(--gutter) + 120px);
  padding-bottom: 56px;
}

.visual::before {
  content: "";
  position: absolute;
  inset: 6% 12% 4% 0;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(0, 210, 190, 0.22), transparent);
  filter: blur(40px);
}

.window {
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #10131a;
  padding: 6px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.7);
}

.window img {
  border-radius: 9px;
}

.phone {
  position: absolute;
  left: -36px;
  bottom: 0;
  width: clamp(140px, 22%, 210px);
  aspect-ratio: 390 / 844;
  border-radius: clamp(22px, 3vw, 34px);
  background: #050708;
  padding: clamp(5px, 0.6vw, 8px);
  box-shadow: 0 0 0 1px #2a383b, 0 30px 60px -12px rgba(0, 0, 0, 0.8);
}

.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: clamp(17px, 2.4vw, 27px);
}

/* ---------- contact ---------- */

.contact {
  border-top: 1px solid var(--line);
  padding-block: clamp(72px, 10vw, 120px);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 88px);
}

.contact-grid p {
  color: var(--muted);
  margin: 20px 0 0;
  max-width: 34ch;
}

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.links a {
  display: grid;
  grid-template-columns: 28px 1fr auto 20px;
  align-items: center;
  gap: 16px;
  padding: 26px 4px;
  border-bottom: 1px solid var(--line);
  transition: padding 0.25s;
}

.links a:hover {
  padding-inline: 12px 0;
}

.links a:hover .arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.links .ico {
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.links .name {
  font: 500 clamp(20px, 2.2vw, 26px)/1 var(--font-display);
  letter-spacing: -0.01em;
}

.links .handle {
  font: 500 13px/1 var(--font-mono);
  color: var(--faint);
}

.links .arrow {
  width: 18px;
  height: 18px;
  color: var(--faint);
  transition: transform 0.25s, color 0.25s;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-block: 28px;
  font-size: 14px;
  color: var(--faint);
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 70vh;
  display: grid;
  align-content: center;
  gap: 20px;
  padding-block: 64px;
}

.notfound h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.notfound p {
  color: var(--muted);
  margin: 0 0 12px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .site-nav {
    display: none;
  }

  .site-header {
    padding-block: 22px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-block: 24px 64px;
    gap: 48px;
  }

  .diagram {
    justify-self: center;
    max-width: 480px;
  }

  .project-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .visual {
    width: calc(100% + var(--gutter));
    padding-left: 28px;
  }

  .phone {
    left: 0;
  }

  .links .handle {
    display: none;
  }

  .links a {
    grid-template-columns: 28px 1fr 20px;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
