/* ===================================================================
   GREAT AFFINITY — terminal / matrix-rain design system
   =================================================================== */

:root {
  --bg:            #030603;
  --bg-panel:      #081208;
  --bg-panel-2:    #0b170b;
  --green:         #33ff5b;
  --green-bright:  #a6ffb4;
  --amber-warn:    #ffb020; /* used once, sparingly, for the OC statement */
  --font-mono: 'Share Tech Mono', 'Courier New', monospace;

  /* Accessible-by-default tones: these meet WCAG AA (4.5:1 text / 3:1 UI)
     against both --bg and --bg-panel. The "special effects" toggle swaps
     these for the dimmer, moodier originals — see html.fx-on below. */
  --line:          #007016;
  --line-dim:      #005c12;
  --green-dim:     #00c226;
  --green-mute:    #00991e;
  --text-glow:     none;
}

/* Special-effects mode: the original lower-contrast, glow-heavy theme.
   Opt-in only, toggled by the "special effects" switch in the header. */
html.fx-on {
  --line:          #16401a;
  --line-dim:      #0d260f;
  --green-dim:     #1f8c33;
  --green-mute:    #145214;
  --text-glow:     0 0 6px rgba(51,255,91,0.55), 0 0 22px rgba(51,255,91,0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--green);
  font-family: var(--font-mono);
}

body {
  min-height: 100vh;
  position: relative;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

/* CRT scanline + vignette overlay — decorative, special-effects only.
   Left on by default these would darken the page enough to undercut the
   accessible contrast ratios above, so they're opt-in with fx-on. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 20, 0, 0.35) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
  display: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  box-shadow: inset 0 0 18vw rgba(0,0,0,0.75);
  display: none;
}

html.fx-on body::before,
html.fx-on body::after {
  display: block;
}

#rain-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

html.fx-on #rain-canvas {
  opacity: 0.16;
}

a { color: var(--green); }
a:visited { color: var(--green); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 2px;
}

/* ---------------- layout shell ---------------- */

.page {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

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

header.site-header {
  position: relative;
  z-index: 1;
  padding: 40px 24px 20px;
  max-width: 880px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.logo-mark {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  filter: none;
}

html.fx-on .logo-mark {
  filter: drop-shadow(0 0 6px rgba(51,255,91,0.35));
}

.logo-braille {
  margin: 0;
  white-space: pre;
  user-select: none;
  flex-shrink: 0;
  font-family: Consolas, "DejaVu Sans Mono", "Liberation Mono", Menlo, monospace;
  font-size: 4px;
  line-height: 4px;
  letter-spacing: 0;
}

.logo-text {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo {
  font-size: 2.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--green-bright);
  text-shadow: var(--text-glow);
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.2rem;
  background: var(--green-bright);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.tagline {
  margin: 6px 0 0;
  color: var(--green-dim);
  font-size: 0.95rem;
}

nav.site-nav {
  margin-top: 22px;
  font-size: 0.92rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
}

nav.site-nav a {
  text-decoration: none;
  padding: 4px 10px;
  color: var(--green-dim);
  border: 1px solid transparent;
  white-space: nowrap;
}

nav.site-nav a:hover,
nav.site-nav a:focus-visible {
  color: var(--green-bright);
  border-color: var(--line);
  background: var(--bg-panel);
}

nav.site-nav a[aria-current="page"] {
  color: var(--green-bright);
  border-color: var(--green-mute);
}

nav.site-nav a::before { content: "["; color: var(--line); }
nav.site-nav a::after  { content: "]"; color: var(--line); }

/* ---------------- generic content blocks ---------------- */

.section {
  margin-top: 56px;
}

.section-label {
  color: var(--green-dim);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

h1 {
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  color: var(--green-bright);
  margin: 0 0 12px;
}

h2 {
  font-size: 1.15rem;
  color: var(--green-bright);
  letter-spacing: 0.03em;
  margin: 0 0 10px;
}

p { color: var(--green); }
p.muted { color: var(--green-dim); }

.panel {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 22px 24px;
}

/* directory-listing style service blurbs on the homepage */

.dirlisting {
  border: 1px solid var(--line);
  background: var(--bg-panel);
}

.dirlisting .dir-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-dim);
  align-items: baseline;
}

.dirlisting .dir-row:last-child { border-bottom: none; }

.dirlisting .perm { color: var(--green-mute); font-size: 0.85rem; }
.dirlisting .dirname {
  color: var(--green-bright);
  font-weight: bold;
  letter-spacing: 0.02em;
}
.dirlisting .desc { color: var(--green); font-size: 0.95rem; grid-column: 1 / -1; }

@media (min-width: 620px) {
  .dirlisting .desc { grid-column: auto; }
  .dirlisting .dir-row { grid-template-columns: 170px 220px 1fr; }
}

/* certifications */

.cert-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

@media (min-width: 620px) {
  .cert-grid { grid-template-columns: 1fr 1fr; }
}

.cert-card {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 22px;
}

.cert-card .badge {
  display: inline-block;
  border: 1px solid var(--green-mute);
  color: var(--green-bright);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px;
  margin-bottom: 12px;
}

.cert-card h2 { margin-bottom: 6px; }
.cert-card p { color: var(--green-dim); font-size: 0.92rem; margin: 0; }

/* company page statements */

.statement {
  border-left: 2px solid var(--green-mute);
  padding-left: 18px;
  margin: 18px 0;
}

.statement.highlight {
  border-left-color: var(--green-bright);
}

/* contact */

.contact-line {
  font-size: 1.05rem;
  margin: 4px 0;
}

.contact-line .k { color: var(--green-dim); }

/* footer */

footer.site-footer {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 60px auto 0;
  padding: 24px 24px 40px;
  border-top: 1px solid var(--line);
  color: var(--green-mute);
  font-size: 0.82rem;
}

footer.site-footer .addr { color: var(--green-dim); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 1; }
  #rain-canvas { display: none !important; }
}

/* ---------------- special-effects toggle ---------------- */

.fx-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--green-dim);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}

.fx-toggle:hover,
.fx-toggle:focus-visible {
  color: var(--green-bright);
  border-color: var(--green-mute);
}

.fx-toggle-track {
  display: inline-block;
  width: 26px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
}

.fx-toggle-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  transition: left 0.15s ease;
}

.fx-toggle[aria-checked="true"] .fx-toggle-thumb {
  left: 13px;
}

.fx-toggle-state {
  text-transform: uppercase;
  min-width: 2.2em;
}

@media (min-width: 620px) {
  .fx-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    margin-top: 0;
  }
}
