/* ------------------------------------------------
   SYSCTL Website Styles
   ------------------------------------------------ */

/* --- Design Tokens --- */
:root {
  --color-bg: #010101;
  --color-fg: #f5f5f5;
  --color-muted: #7a7a7a;
  --color-accent: #555;
  --color-border: #161616;
  --font-sans: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Theme-aware surface colors */
  --surface-bg: rgba(0, 0, 0, 0.4);
  --surface-bg-subtle: rgba(0, 0, 0, 0.3);
  --surface-bg-card: rgba(0, 0, 0, 0.1);
  --surface-bg-card-hover: rgba(0, 0, 0, 0.2);
  --surface-border: rgba(255, 255, 255, 0.1);
  --surface-border-hover: rgba(255, 255, 255, 0.2);
  --surface-highlight: rgba(255, 255, 255, 0.03);
  --surface-icon-bg: rgba(255, 255, 255, 0.05);
  --surface-divider: rgba(22, 22, 22, 0.4);
  --footer-border: rgba(255, 255, 255, 0.05);
  --footer-text: rgba(122, 122, 122, 0.6);
  --badge-text: rgba(122, 122, 122, 0.8);
  --badge-bg: rgba(255, 255, 255, 0.08);
  --badge-fg: var(--color-fg);
  --badge-border: rgba(255, 255, 255, 0.1);
  --badge-accent: var(--color-accent);
  --logo-invert: invert(100%);
  --grid-line: oklch(.28 0 0);
  --radial-edge: oklch(.07 0 0);
}

/* Light theme via OS preference */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --color-bg: #f5f5f5;
    --color-fg: #111111;
    --color-muted: #666;
    --color-accent: #888;
    --color-border: #ddd;
    --surface-bg: rgba(255, 255, 255, 0.7);
    --surface-bg-subtle: rgba(255, 255, 255, 0.5);
    --surface-bg-card: rgba(255, 255, 255, 0.5);
    --surface-bg-card-hover: rgba(255, 255, 255, 0.7);
    --surface-border: rgba(0, 0, 0, 0.1);
    --surface-border-hover: rgba(0, 0, 0, 0.2);
    --surface-highlight: rgba(0, 0, 0, 0.03);
    --surface-icon-bg: rgba(0, 0, 0, 0.05);
    --surface-divider: rgba(0, 0, 0, 0.08);
    --footer-border: rgba(0, 0, 0, 0.08);
    --footer-text: rgba(100, 100, 100, 0.6);
    --badge-text: rgba(100, 100, 100, 0.8);
    --badge-bg: rgba(255, 255, 255, 0.7);
    --badge-fg: #111111;
    --badge-border: rgba(0, 0, 0, 0.1);
    --badge-accent: #888;
    --logo-invert: none;
    --grid-line: oklch(.88 0 0);
    --radial-edge: oklch(.92 0 0);
  }
}

/* Light theme via manual toggle */
[data-theme="light"] {
  --color-bg: #f5f5f5;
  --color-fg: #111111;
  --color-muted: #666;
  --color-accent: #888;
  --color-border: #ddd;
  --surface-bg: rgba(255, 255, 255, 0.7);
  --surface-bg-subtle: rgba(255, 255, 255, 0.5);
  --surface-bg-card: rgba(255, 255, 255, 0.5);
  --surface-bg-card-hover: rgba(255, 255, 255, 0.7);
  --surface-border: rgba(0, 0, 0, 0.1);
  --surface-border-hover: rgba(0, 0, 0, 0.2);
  --surface-highlight: rgba(0, 0, 0, 0.03);
  --surface-icon-bg: rgba(0, 0, 0, 0.05);
  --surface-divider: rgba(0, 0, 0, 0.08);
  --footer-border: rgba(0, 0, 0, 0.08);
  --footer-text: rgba(100, 100, 100, 0.6);
  --badge-text: rgba(100, 100, 100, 0.8);
  --badge-bg: rgba(255, 255, 255, 0.7);
  --badge-fg: #111111;
  --badge-border: rgba(0, 0, 0, 0.1);
  --badge-accent: #888;
  --logo-invert: none;
  --grid-line: oklch(.88 0 0);
  --radial-edge: oklch(.92 0 0);
}


/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  border: 0 solid #e5e7eb;
  margin: 0;
  padding: 0;
}

html {
  line-height: 1.5;
  tab-size: 4;
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; height: auto; }
ol, ul { list-style: none; }
button, [role="button"] { cursor: pointer; }
code, kbd, pre { font-family: var(--font-mono); }


/* --- Animations --- */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes bounce-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@keyframes scroll-wheel {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(6px); }
}


/* --- Noise Overlay --- */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}


/* --- Grid & Radial Backgrounds --- */
.bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-radial {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 0%, var(--radial-edge) 100%);
}


/* --- Floating Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 1rem 1.5rem;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--surface-border);
  border-radius: 1rem;
  background: var(--surface-bg);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 0 var(--surface-highlight);
}

.header-logo {
  width: 64px;
  filter: var(--logo-invert);
}

.header-slogan {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--color-muted);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.025em;
  color: var(--color-muted);
  transition: color 0.15s ease;
}

.header-nav a:hover {
  color: var(--color-fg);
}

@media (min-width: 768px) {
  .header-slogan {
    display: block;
  }
}


/* --- Page Wrapper --- */
.page-wrapper {
  position: relative;
  z-index: 10;
}


/* --- Hero Section --- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  padding: 5rem 1.5rem;
}

.hero-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-fg);
}

.terminal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--badge-border);
  border-radius: 9999px;
  background: var(--badge-bg);
  backdrop-filter: blur(3px);
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 2vw, 1.25rem);
  font-weight: 500;
  white-space: nowrap;
  color: var(--badge-fg);
}

.terminal-badge .prompt {
  color: var(--badge-accent);
}

.hero-logo {
  margin-top: 1rem;
  width: 200px;
  filter: var(--logo-invert);
}


.typewriter-cursor {
  color: var(--badge-accent);
  animation: blink 1s step-end infinite;
}

.scroll-hint {
  display: inline-flex;
  align-items: center;
  margin-top: 2rem;
  color: var(--color-muted);
  transition: color 0.15s ease;
}

.scroll-hint:hover {
  color: var(--color-fg);
}

.scroll-hint svg {
  width: 1.5rem;
  height: 2.25rem;
}

.scroll-hint .scroll-wheel {
  animation: scroll-wheel 1.5s ease-out infinite;
}

@media (min-width: 768px) {
  .hero-logo { width: 260px; }
}


/* --- Section Common --- */
.section {
  position: relative;
  padding: 6rem 1.5rem;
}

.section-inner {
  position: relative;
  z-index: 10;
  max-width: 72rem;
  margin: 0 auto;
}

.section-label {
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--color-accent);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.section-header {
  margin-bottom: 4rem;
  text-align: center;
}

@media (min-width: 768px) {
  .section { padding: 8rem 1.5rem; }
  .section-title { font-size: 1.875rem; }
}


/* --- Service Cards --- */
.services-grid {
  display: grid;
  gap: 1.5rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  border: 1px solid var(--surface-border);
  border-radius: 1rem;
  background: var(--surface-bg-card);
  backdrop-filter: blur(2px);
  box-shadow: inset 0 1px 0 0 var(--surface-highlight);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

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

.service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--surface-border);
  border-radius: 0.75rem;
  background: var(--surface-icon-bg);
}

.service-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-accent);
}

.service-card h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.service-card p {
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--color-muted);
}

@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .service-card h3 {
    font-size: 1.125rem;
  }
}


/* --- Contact Cards --- */
.contact-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 48rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem;
  border: 1px solid var(--surface-border);
  border-radius: 1rem;
  background: var(--surface-bg-card);
  backdrop-filter: blur(2px);
  box-shadow: inset 0 1px 0 0 var(--surface-highlight);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
}

.contact-divider {
  height: 1px;
  width: 100%;
  background: var(--surface-divider);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--color-muted);
  transition: color 0.15s ease;
}

.contact-link:hover {
  color: var(--color-fg);
}

.contact-link svg,
.contact-row svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--color-accent);
  transition: color 0.15s ease;
}

.contact-link:hover svg {
  color: var(--color-fg);
}


/* --- Footer --- */
.site-footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--footer-border);
  padding: 2rem 1.5rem;
  text-align: center;
}

.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--footer-text);
}


/* --- Theme Toggle --- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--color-muted);
  transition: color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--color-fg);
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
}

[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
