/* QuietNet — dark tech design system. One file, no framework. */

:root {
  --bg:        #0a0e13;
  --bg-elev:   #111820;
  --bg-elev-2: #16202b;
  --border:    #1e2a36;
  --text:      #e6edf3;
  --muted:     #8b9bab;
  --accent:    #38bdf8;
  --accent-dim:#0e7490;
  --focus:     #7dd3fc;
  --radius:    12px;
  --maxw:      1120px;
}

/* Minimal normalize */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

html {
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Focus visibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.9rem;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
}

/* Upper-right cluster: mobile toggle + nav + customer portal login */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  position: relative;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.4rem;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.site-nav {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  left: auto;
  min-width: 11rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 12;
}
.site-nav.open {
  display: flex;
}
.site-nav a {
  padding: 0.55rem 0;
  color: var(--muted);
}
.site-nav a:hover {
  color: var(--text);
}

/* Customer portal access — upper right, always visible */
a.portal-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
a.portal-login:hover {
  background: var(--focus);
  border-color: var(--focus);
  color: var(--bg);
}
a.portal-login.on {
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.35);
}

/* Portal login stub page */
.portal-role-grid {
  margin-top: 1.5rem;
}
.portal-role-card h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.portal-role-card .blurb {
  margin-bottom: 1rem;
}
.portal-role-btn {
  display: inline-block;
}
.portal-login-card {
  max-width: 40rem;
  margin-top: 1.5rem;
}
.portal-stub-note {
  margin-top: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.9rem;
}
.portal-stub-note strong {
  color: var(--accent);
  font-weight: 600;
}
.portal-help {
  margin-top: 1rem;
  font-size: 0.9rem;
}
.portal-help a {
  color: var(--accent);
}

/* Portal signed-in home (P1) */
.portal-app-card { max-width: 44rem; margin-top: 1.5rem; }
.portal-identity-row { display: flex; gap: .75rem; align-items: baseline;
                       padding-block: .35rem; flex-wrap: wrap; }
.portal-identity-label { color: var(--muted); font-size: .85rem;
                         text-transform: uppercase; letter-spacing: .06em; min-width: 7rem; }
.portal-identity-email { color: var(--text); font-weight: 600; word-break: break-all; }
.portal-role-badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px;
                     border: 1px solid var(--border); background: var(--bg-elev-2);
                     color: var(--accent); font-size: .8rem; letter-spacing: .04em; }
.portal-role-unknown { color: var(--muted); }
.portal-next-card { max-width: 44rem; margin-top: 1rem; }
.portal-app-links { display: flex; gap: 1.25rem; flex-wrap: wrap;
                    margin-top: 1.25rem; font-size: .9rem; }
.portal-app-links a { color: var(--accent); }
.portal-identity-tenant { color: var(--text); font-weight: 600; }

/* Portal documents (P2) */
.portal-doc-list { list-style: none; padding: 0; margin: 1.25rem 0 0;
                   display: grid; gap: .75rem; max-width: 44rem; }
.portal-doc { border: 1px solid var(--border); border-radius: 10px;
              background: var(--bg-elev-2); padding: .9rem 1rem; }
.portal-doc-title { font-weight: 600; color: var(--text); }
.portal-doc-meta { color: var(--muted); font-size: .8rem; letter-spacing: .04em;
                   margin-top: .2rem; }
.portal-doc-summary { color: var(--muted); font-size: .9rem; margin-top: .45rem; }
.portal-empty { max-width: 44rem; margin-top: 1.25rem; }

/* Portal vendor projects (P3) */
.portal-project-list { list-style: none; padding: 0; margin: 1.25rem 0 0;
                       display: grid; gap: .75rem; max-width: 44rem; }
.portal-project { border: 1px solid var(--border); border-radius: 10px;
                  background: var(--bg-elev-2); padding: .9rem 1rem; }
.portal-project-title { font-weight: 600; color: var(--text); }
.portal-project-title a { color: var(--text); text-decoration: none; }
.portal-project-title a:hover { color: var(--accent); }
.portal-project-meta { color: var(--muted); font-size: .8rem; letter-spacing: .04em;
                       margin-top: .2rem; }
.portal-project-summary { color: var(--muted); font-size: .9rem; margin-top: .45rem; }

/* Hero */
.hero {
  padding-block: 3.5rem 3rem;
  background:
    radial-gradient(600px 300px at 50% -10%, rgba(56, 189, 248, 0.15), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede-sub {
  color: var(--accent);
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  margin-top: 0.6rem;
  font-weight: 500;
}

.lede {
  color: var(--muted);
  max-width: 60ch;
  margin-top: 1rem;
  font-size: 1.05rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #06222f;
}
.btn-primary:hover {
  background: var(--focus);
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text);
  background: var(--bg-elev-2);
}
.btn-secondary:hover {
  border-color: var(--accent-dim);
}

/* Sections */
.section {
  padding-block: 3rem;
}

.section-alt {
  background: var(--bg-elev);
  border-block: 1px solid var(--border);
}

.section h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.section h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* Grid + cards */
.grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Services page: four equal columns on desktop so all offerings sit on one row */
.services-detail {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 960px) {
  .services-detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .services-detail {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover {
  border-color: var(--accent-dim);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.card .blurb {
  color: var(--muted);
  margin-bottom: 0.8rem;
}

/* B-style callout cards on home (A visual language) */
.section-lede {
  color: var(--muted);
  max-width: 40rem;
  margin: -0.5rem 0 0;
}

a.card-callout {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}
a.card-callout:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
}
a.card-callout .blurb {
  margin-bottom: 0;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.9rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.card-icon-infra::before { content: "SI"; }
.card-icon-mesh::before { content: "MN"; }
.card-icon-mail::before { content: "PM"; }
.card-icon-agents::before { content: "AP"; }

.card ul li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.4rem;
  color: var(--muted);
}
.card ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.services-detail .card h2 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.more-link {
  margin-top: 1.5rem;
}
.more-link a {
  color: var(--accent);
  font-weight: 600;
}

.cta-section {
  text-align: left;
}

.contact-link {
  margin-top: 0.75rem;
}
.contact-link a {
  color: var(--accent);
}

.contact-card {
  margin-top: 1.5rem;
  max-width: 480px;
}
.contact-address {
  margin-top: 1rem;
  font-size: 1.15rem;
  font-weight: 600;
}
.muted {
  color: var(--muted);
}

.not-found {
  text-align: center;
  padding-block: 6rem;
}
.not-found h1 {
  font-size: clamp(3rem, 10vw, 5rem);
  color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-nav {
  display: flex;
  gap: 1rem;
}
.footer-nav a:hover {
  color: var(--text);
}

/* Desktop breakpoint */
@media (min-width: 760px) {
  .nav-toggle {
    display: none;
  }
  .header-right {
    gap: 1.25rem;
  }
  .site-nav {
    display: flex;
    flex-direction: row;
    position: static;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    gap: 1.5rem;
  }
  .site-nav a {
    padding: 0;
  }
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
