/* ============================================================
   5i.fi — "The Node" patch-panel homepage
   Palette: dark server-room + fiber-optic light
   ============================================================ */

:root {
  --bg:        #0E1116;
  --panel:     #161B22;
  --panel-2:   #1B222B;
  --hairline:  #232A33;
  --hairline-2:#2C353F;
  --text:      #E6EDF3;
  --muted:     #7D8792;
  --muted-dim: #59626C;
  --aqua:      #3FE0C8;  /* fiber transceiver glow */
  --aqua-dim:  #1F6B62;
  --amber:     #F2A83B;  /* activity LED */

  --font-display: "Bricolage Grotesque", "IBM Plex Sans", sans-serif;
  --font-body:    "IBM Plex Sans", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, monospace;

  --maxw: 940px;
  --radius: 12px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Subtle server-room depth: two faint fiber-colored pools + a fine grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 82% -8%, rgba(63,224,200,0.07), transparent 60%),
    radial-gradient(760px 620px at -6% 108%, rgba(242,168,59,0.05), transparent 60%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 88%);
  pointer-events: none;
}

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

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

/* ---------- Shared LED ---------- */
.led {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--muted-dim);
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: background .25s ease, box-shadow .25s ease;
}
.led--idle { background: var(--muted-dim); }
.led--live {
  background: var(--aqua);
  box-shadow: 0 0 8px rgba(63,224,200,0.8);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(63,224,200,0.55); }
  50%      { box-shadow: 0 0 11px rgba(63,224,200,0.95); }
}

/* ---------- Top bar ---------- */
.topbar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.node-id {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.02em;
}
.node-id__name { font-weight: 500; }
.topnav {
  display: flex;
  gap: 22px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--muted);
}
.topnav a { transition: color .18s ease; }
.topnav a:hover { color: var(--aqua); }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 12vw, 128px) 24px clamp(48px, 8vw, 88px);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aqua);
  margin: 0 0 22px;
  display: inline-flex;
  align-items: center;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--aqua-dim);
  margin-right: 12px;
}
h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 11vw, 7rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
}
.hero__last { color: var(--muted); }
.hero__lede {
  max-width: 46ch;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: #C4CCD4;
  margin: 0 0 28px;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--muted);
}
.hero__meta em { font-style: normal; color: var(--text); }
.hero__meta .dot { color: var(--hairline-2); }
.hero__meta-as {
  display: inline-flex;
  align-items: center;
  transition: color .18s ease;
}
.hero__meta-as em {
  border-bottom: 1px dashed var(--aqua-dim);
  padding-bottom: 1px;
  transition: color .18s ease, border-color .18s ease;
}
.hero__meta-as:hover em { color: var(--aqua); border-color: var(--aqua); }

/* Inline text links */
.inline-link {
  color: var(--aqua);
  border-bottom: 1px solid var(--aqua-dim);
  transition: border-color .18s ease;
}
.inline-link:hover { border-color: var(--aqua); }

/* ---------- Section shell: services panel ---------- */
.panel {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.panel__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 4px;
}
.panel__label h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 0;
}
.panel__hint {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Ports (patch panel) ---------- */
.ports {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--hairline);              /* seams between ports */
  border: 1px solid var(--hairline);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.port { background: var(--panel); }

.port__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 24px 28px;
  height: 100%;
  position: relative;
  transition: background .2s ease, transform .2s ease;
}
/* left accent rail that lights on hover ("cable patched in").
   Inset past the container's 12px corner radius so the bottom-row ports
   don't clip the rail (or its glow) against the rounded corners. */
.port__link::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  transition: background .22s ease, box-shadow .22s ease;
}
a.port__link:hover {
  background: var(--panel-2);
}
a.port__link:hover::before {
  background: var(--aqua);
  box-shadow: 0 0 14px rgba(63,224,200,0.55);
}
a.port__link:hover .led {
  background: var(--aqua);
  box-shadow: 0 0 9px rgba(63,224,200,0.85);
}
a.port__link:hover .port__arrow {
  color: var(--aqua);
  transform: translate(2px, -2px);
}
a.port__link:hover .port__name { color: var(--aqua); }

.port__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.port__path {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.port__arrow {
  margin-left: auto;
  font-size: 15px;
  color: var(--muted-dim);
  transition: color .2s ease, transform .2s ease;
}
.port__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  transition: color .2s ease;
}
.port__desc {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 34ch;
}

.port--muted .port__link { cursor: default; }
.port--muted .port__name,
.port--muted .port__path { color: var(--muted-dim); }
.port--muted .port__desc { color: var(--muted-dim); }

/* ---------- About ---------- */
.about {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(72px, 11vw, 128px) 24px clamp(56px, 8vw, 96px);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.about__intro h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}
.about__intro p {
  color: #C4CCD4;
  margin: 0 0 18px;
  max-width: 52ch;
}

.specs {
  margin: 6px 0 0;
  border-top: 1px solid var(--hairline);
}
.specs__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.specs dt {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.specs dd {
  margin: 0;
  text-align: right;
  font-size: 0.98rem;
  color: var(--text);
}

/* ---------- Contact ---------- */
.contact {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px clamp(64px, 9vw, 104px);
}
.contact__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 28px;
}
.contact__label h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 0;
}
.contact__hint {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
}
.contact__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.contact__tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--aqua);
  margin-bottom: 16px;
}
.contact__addr {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  color: var(--text);
  transition: color .18s ease;
}
.contact__addr:hover { color: var(--aqua); }
.contact__addr--spaced { margin-top: 18px; }
.contact__sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.contact__pgp {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  width: 100%;
  display: flex;
  flex-direction: column;
}
.contact__pgp .contact__sub { margin-top: 0; margin-bottom: 8px; }
.contact__key {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--muted);
  word-spacing: 0.15em;
  max-width: 26ch;
  transition: color .18s ease;
}
a.contact__key:hover { color: var(--aqua); }
.contact__key--ssh {
  max-width: 30ch;
  word-spacing: normal;
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 24px 44px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.footer__node { display: inline-flex; align-items: center; gap: 9px; }
.footer__contact { transition: color .18s ease; }
.footer__contact:hover { color: var(--aqua); }

/* ---------- Load-in: ports come online ---------- */
@media (prefers-reduced-motion: no-preference) {
  .port {
    opacity: 0;
    transform: translateY(10px);
    animation: portOnline .5s cubic-bezier(.2,.7,.3,1) forwards;
  }
  .port:nth-child(1) { animation-delay: .05s; }
  .port:nth-child(2) { animation-delay: .12s; }
  .port:nth-child(3) { animation-delay: .19s; }
  .port:nth-child(4) { animation-delay: .26s; }
  .port:nth-child(5) { animation-delay: .33s; }
  .port:nth-child(6) { animation-delay: .40s; }
  .port:nth-child(7) { animation-delay: .47s; }
  .port:nth-child(8) { animation-delay: .54s; }

  .hero .eyebrow,
  .hero h1,
  .hero__lede,
  .hero__meta {
    opacity: 0;
    animation: riseIn .6s cubic-bezier(.2,.7,.3,1) forwards;
  }
  .hero h1       { animation-delay: .06s; }
  .hero__lede    { animation-delay: .14s; }
  .hero__meta    { animation-delay: .22s; }
}
@keyframes portOnline {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .topnav { gap: 16px; }
  .ports { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; gap: 40px; }
  .port__desc { max-width: none; }
}
@media (max-width: 460px) {
  .topnav a:not(:last-child) { display: none; } /* keep only Status on tiny screens */
  .footer { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .led--live { animation: none; }
}
