/* ============================================
   HelpDeskPro — Infrastructure & AI Systems Consulting
   Design: dark technical / infrastructure dashboard aesthetic
   Fonts: JetBrains Mono (OFL), Inter (OFL) via Google Fonts
   ============================================ */

/* ============================================
   CUSTOM PROPERTIES
   ============================================ */
:root {
  /* Background layers */
  --bg:          #1a1d23;
  --bg-surface:  #20242d;
  --bg-raised:   #252a35;
  --bg-border:   #2d3142;

  /* Accents */
  --green:       #00ff88;
  --green-dim:   #00cc6a;
  --amber:       #ff9f43;
  --amber-dim:   #e8882a;

  /* Text */
  --text:        #c8cdd8;
  --text-dim:    #7a8099;
  --text-dimmer: #4a5068;

  /* Typography */
  --font-mono: 'JetBrains Mono', 'Fira Mono', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;

  /* Spacing */
  --sp-xs:  0.25rem;
  --sp-sm:  0.5rem;
  --sp-md:  1rem;
  --sp-lg:  1.5rem;
  --sp-xl:  2rem;
  --sp-2xl: 3rem;
  --sp-3xl: 5rem;

  /* Layout */
  --max-w: 1100px;
  --nav-h: 60px;

  /* Radius */
  --r-sm: 3px;
  --r-md: 6px;

  /* Transitions */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
}

ul {
  list-style: none;
}

a {
  color: var(--green);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--green-dim);
}

img, svg {
  display: block;
  max-width: 100%;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-md);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--green);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: var(--r-sm);
  z-index: 9999;
  transition: top var(--t-fast);
}

.skip-link:focus {
  top: var(--sp-md);
  color: var(--bg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-xl);
}

.section {
  padding: var(--sp-3xl) 0;
}

.section-alt {
  background-color: var(--bg-surface);
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--bg-border);
  z-index: 1000;
  transition: border-color var(--t-base);
}

.nav.scrolled {
  border-bottom-color: var(--bg-raised);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.4);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-xl);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: color var(--t-fast);
}

.nav-brand:hover {
  color: var(--green);
}

.nav-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color var(--t-fast);
  padding: var(--sp-xs) 0;
}

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

.nav-link-email {
  color: var(--green);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 5px 12px;
  border: 1px solid var(--green);
  border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
}

.nav-link-email:hover {
  background: var(--green);
  color: var(--bg);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--sp-sm);
  border-radius: var(--r-sm);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-dim);
  border-radius: 1px;
  transition: transform var(--t-base), opacity var(--t-base);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  padding-bottom: var(--sp-3xl);
  /* Subtle grid background */
  background-image:
    linear-gradient(var(--bg-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-border) 1px, transparent 1px);
  background-size: 40px 40px;
  background-color: var(--bg);
}

.hero .container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.terminal {
  width: 100%;
  max-width: 740px;
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 10px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--bg-border);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-red    { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #27c93f; }

.terminal-url {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dimmer);
  margin: 0 auto;
}

.terminal-body {
  padding: var(--sp-xl) var(--sp-xl) var(--sp-2xl);
}

.t-prompt {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  margin-bottom: var(--sp-xs);
}

.t-prompt-char {
  color: var(--green);
  margin-right: var(--sp-sm);
  user-select: none;
}

.t-title {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: var(--sp-lg);
  letter-spacing: -0.03em;
}

.t-desc {
  font-size: 1.0625rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: var(--sp-xl);
  max-width: 540px;
}

.t-cmd-line {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.t-link {
  color: var(--green);
  font-family: var(--font-mono);
}

.t-link:hover {
  color: var(--green-dim);
  text-decoration: underline;
}

.cursor {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
}

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

/* ============================================
   SECTION HEADINGS
   ============================================ */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--green);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--sp-sm);
}

.section-label::before {
  content: '# ';
  opacity: 0.6;
}

.section-title {
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 3vw, 1.625rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: var(--sp-2xl);
  letter-spacing: -0.02em;
}

/* ============================================
   SERVICES
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-lg);
}

.service-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--r-md);
  padding: var(--sp-xl);
  transition: border-color var(--t-base);
}

.service-card:hover {
  border-color: var(--bg-raised);
}

.service-icon {
  width: 44px;
  height: 44px;
  color: var(--green);
  margin-bottom: var(--sp-lg);
  opacity: 0.9;
}

.service-card h3 {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-md);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.service-card p {
  font-size: 0.9375rem;
  color: var(--text-dim);
  line-height: 1.7;
}

/* Wide card spanning both columns */
.service-card--wide {
  grid-column: 1 / -1;
}

/* ============================================
   STACK
   ============================================ */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-xl) var(--sp-2xl);
}

.stack-category h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--bg-border);
}

.stack-category ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.stack-category li {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  padding: var(--sp-xs) 0;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.stack-category li::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--bg-border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background var(--t-fast);
}

.stack-category:hover li::before {
  background: var(--green-dim);
}

/* ============================================
   PROJECTS
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-lg);
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-border);
  border-radius: var(--r-md);
  padding: var(--sp-xl);
  display: flex;
  flex-direction: column;
  transition: border-color var(--t-base);
}

.project-card:hover {
  border-color: var(--amber);
}

.project-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
  flex-wrap: wrap;
}

.project-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: -0.01em;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dimmer);
  white-space: nowrap;
  transition: color var(--t-fast);
}

.project-link:hover {
  color: var(--green);
}

.project-desc {
  font-size: 0.9375rem;
  color: var(--text-dim);
  line-height: 1.7;
  flex: 1;
  margin-bottom: var(--sp-lg);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs);
  margin-top: auto;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-dimmer);
  background: var(--bg-raised);
  border: 1px solid var(--bg-border);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}

/* ============================================
   CONTACT
   ============================================ */
.contact-block {
  max-width: 560px;
}

.contact-desc {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: var(--sp-xl);
}

.contact-email {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.375rem);
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.01em;
  transition: color var(--t-fast);
}

.contact-email:hover {
  color: var(--green-dim);
  text-decoration: underline;
}

.contact-meta {
  margin-top: var(--sp-lg);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dimmer);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: var(--sp-xl) 0;
  border-top: 1px solid var(--bg-border);
  background: var(--bg);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-md);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dimmer);
}

.footer-links {
  display: flex;
  gap: var(--sp-lg);
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dimmer);
  transition: color var(--t-fast);
}

.footer-link:hover {
  color: var(--text-dim);
}

/* ============================================
   DIVIDER
   ============================================ */
.section-divider {
  height: 1px;
  background: var(--bg-border);
  margin: 0;
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card--wide {
    grid-column: auto;
  }

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

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

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 640px) {
  :root {
    --sp-3xl: 3.5rem;
  }

  .container {
    padding: 0 var(--sp-md);
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-top: 1px solid var(--bg-border);
    padding: var(--sp-lg) var(--sp-xl);
    overflow-y: auto;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-link, .nav-link-email {
    font-size: 0.9375rem;
    padding: var(--sp-md) 0;
    width: 100%;
    border-bottom: 1px solid var(--bg-border);
    border-radius: 0;
  }

  .nav-link-email {
    border: none;
    border-bottom: 1px solid var(--bg-border);
    background: transparent;
    color: var(--green);
  }

  .nav-link-email:hover {
    background: transparent;
    text-decoration: underline;
  }

  .nav-toggle {
    display: flex;
  }

  .terminal-body {
    padding: var(--sp-lg);
  }

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

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

  .footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .stack-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cursor {
    animation: none;
    opacity: 1;
  }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
