/* ===============================
   TediousTech Solutions — UI
   Light-first, responsive, subtle “Tron” accents
   NOTE: Dark mode is disabled for parity across devices.
================================== */

/* ---------- 0) Design Tokens ---------- */
:root {
  color-scheme: light;               /* static light; no auto dark */

  /* Palette */
  --bg: #ffffff;            /* page background (locked to white) */
  --surface: #ffffff;       /* cards, panels */
  --text: #1a1a1a;          /* primary text */
  --muted: #6b7280;         /* secondary text */
  --primary: #0b1d36;       /* NAVY */
  --accent: #00e0e7;        /* TEAL (muted neon) */
  --accent-strong: #00f7ff; /* brighter for glows/lines */
  --link: #0a84ff;          /* electric blue for body links */
  --border: #e5e7eb;        /* light borders */

  /* Filter active visuals */
  --filter-active-bg: color-mix(in srgb, var(--accent) 18%, #ffffff 82%);
  --filter-active-border: var(--accent);
  --filter-active-text: var(--primary);

  /* Layout widths */
  --container-max: 72rem;   /* ~1152px readable width */
  --container-wide: 88rem;

  /* Type scale (fluid) */
  --step--1: clamp(0.9rem, 0.86rem + 0.2vw, 1rem);
  --step-0:  clamp(1rem, 0.95rem + 0.35vw, 1.125rem);
  --step-1:  clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem);
  --step-2:  clamp(1.6rem, 1.3rem + 1.3vw, 2.1rem);
  --step-3:  clamp(2.0rem, 1.5rem + 2.0vw, 2.8rem);
  --step-4:  clamp(2.6rem, 1.8rem + 3.2vw, 3.6rem);

  /* Spacing (fluid) */
  --space-s:   clamp(0.75rem, 0.5rem + 0.6vw, 1rem);
  --space-m:   clamp(1rem, 0.8rem + 0.8vw, 1.5rem);
  --space-l:   clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  --space-xl:  clamp(2rem, 1.2rem + 2.4vw, 3rem);
  --space-2xl: clamp(3rem, 2rem + 3.5vw, 4.5rem);

  /* Radius + effects */
  --radius: 14px;
  --shadow-1: 0 8px 24px rgba(10, 29, 54, 0.08);
  --shadow-2: 0 16px 50px rgba(10, 29, 54, 0.12);
  --glow: 0 0 0px rgba(0, 247, 255, 0), 0 0 16px rgba(0, 231, 239, 0.25);
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 1) Base / Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img, svg, video, canvas, iframe { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a, button {
  -webkit-tap-highlight-color: transparent;
}

h1 { font-size: var(--step-4); line-height: 1.15; margin: 0 0 var(--space-m); color: var(--primary); }
h2 { font-size: var(--step-3); line-height: 1.20; margin: var(--space-xl) 0 var(--space-s); color: var(--primary); }
h3 { font-size: var(--step-2); line-height: 1.25; margin: var(--space-l) 0 var(--space-s); color: var(--primary); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; border: 0; padding: 0; clip: rect(0 0 0 0); overflow: hidden;
}

/* ---------- 2) Layout Utilities ---------- */
.container { width: min(100% - 2rem, var(--container-max)); margin-inline: auto; }
.container--wide { width: min(100% - 2rem, var(--container-wide)); margin-inline: auto; }

.section { padding-block: var(--space-xl); }
.section--tight { padding-block: var(--space-l); }

.stack { display: grid; gap: var(--space-m); }
.stack--s { gap: var(--space-s); }
.stack--l { gap: var(--space-l); }

.grid {
  display: grid;
  gap: var(--space-m);
    /* Mobile-first: 1 column: we'll scale up later */
  grid-template-columns: 1fr
}

/* Cap columns responsively: 2 → 3 → 4 max */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1280px){
    .services-grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr);}
    .services-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr);}
}

/* Section dividers & rhythm */
.section + .section {
  border-top: 1px solid var(--border);
  position: relative;
}
.section + .section::before {
  content: "";
  position: absolute; top: -1px; left: 1rem;
  width: 96px; height: 1px;
  background: linear-gradient(90deg, var(--accent-strong), transparent);
  opacity: 0.45; pointer-events: none;
}

/* ---------- 3) Header / Navigation ---------- */
header.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, white 8%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.2) blur(6px);
}

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-s) 0;
}

.nav__brand { font-weight: 800; letter-spacing: 0.2px; color: var(--primary); }

/* Desktop nav links */
.nav__links { display: flex; gap: var(--space-s); flex-wrap: wrap; }
.nav__links a {
  position: relative;
  padding: 0.25rem 0.15rem;
  color: #0b1d36; /* unified menu color */
}

/* Neon underline tint = var(--accent) */
.nav__links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0; transform: translateY(2px);
  transition: opacity .2s ease, transform .2s ease;
}
.nav__links a:hover::after,
.nav__links a[aria-current="page"]::after { opacity: 1; transform: translateY(0); }

/* Disable default text underline on nav hover; rely on neon underline */
.nav__links a:hover { text-decoration: none; }
.mobile-nav a:hover  { text-decoration: none; }

/* Dropdown menus */
.nav__links summary:hover::after,
.nav__links summary[aria-current="page"]::after { opacity: 1; transform: translateY(0); }
.nav__links summary::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0; transform: translateY(2px);
  transition: opacity .2s ease, transform .2s ease;
}

.nav__links .dropdown { position: relative; }
.nav__links .dropdown .dropdown-toggle { display: block; }
.nav__links .dropdown-menu {
  position: absolute;
  top: 100%;
  margin-top: 0.1rem;
  left: 0;
  display: none;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0.5rem;
  min-width: 10rem;
  z-index: 10;
}
.nav__links .dropdown:hover .dropdown-menu,
.nav__links .dropdown:focus-within .dropdown-menu { display: flex; }
.nav__links .dropdown-menu a {
  padding: 0.25rem 0;
  white-space: nowrap;
  color: #0b1d36;
}

.nav__links .dropdown-menu a:hover,
.nav__links .dropdown-menu a:focus {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Mobile dropdown */
.mobile-nav details { width: 100%; }
.mobile-nav summary {
  list-style: none;
  padding: 0.75rem 0;
  cursor: pointer;
  display  : flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::after {
  content: "\25BE"; /* downwards caret */
  transition: transform 0.2s;
}
.mobile-nav details .dropdown-menu {
  display: none;
  flex-direction: column;
  padding-left: 1rem;
}
.mobile-nav details[open] .dropdown-menu { display: flex; }
.mobile-nav details[open] summary::after {
  transform: rotate(180deg);
}
.mobile-nav details .dropdown-menu a { padding: 0.5rem 0; }

.mobile-nav a[aria-current="page"],
.mobile-nav summary[aria-current="page"] {
  background: color-mix(in srgb, var(--primary) 5%, transparent);
  border-radius: 6px;
}

/* Keyboard focus */
.nav__links a:focus-visible,
.mobile-nav a:focus-visible,
a:focus-visible {
  outline: 2px solid #7c7488;
  outline-offset: 3px;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: var(--glow);
}

/* ---------- 4) Hero (with optional background video) ---------- */
.hero {
  padding-block: var(--space-2xl);
  background:
    radial-gradient(800px 300px at 85% 5%, rgba(0, 224, 231, 0.10), transparent 60%) no-repeat,
    radial-gradient(1000px 400px at 10% 0%, rgba(11, 29, 54, 0.06), transparent 60%) no-repeat,
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.hero .container--wide { display: grid; gap: var(--space-m); }
.hero p { color: var(--muted); max-width: 65ch; }

/* Headline accent bar */
.hero h1 { position: relative; }
.hero h1::after {
  content: "";
  display: block;
  width: 72px; height: 3px; margin-top: 0.5rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-strong), transparent);
}

/* Rotating word — fix width to avoid layout shift (longest word: "months" = ~6ch) */
.word-rotator {
  display: inline-block;
  min-width: 6ch;
  will-change: contents, opacity;
  transition: opacity .35s ease;
  color: var(--accent);
}

/* Background video */
.hero--video { position: relative; overflow: clip; }
.hero--video .container--wide { position: relative; z-index: 2; }
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; pointer-events: none; filter: saturate(1.05);
}
/* Scrim overlay for readability */
.hero--video::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(800px 300px at 85% 5%, rgba(0, 224, 231, 0.10), transparent 60%) no-repeat,
    linear-gradient(180deg, rgba(11, 29, 54, 0.72), rgba(11, 29, 54, 0.58));
  pointer-events: none;
}
/* Respect reduced motion: hide video (poster remains) */
@media (prefers-reduced-motion: reduce) { .hero__video { display: none; } }

/* Hero color overrides for dark video background */
.hero h1, .hero h2, .hero h3 { color: #ffffff; }
.hero p { color: #ffffff; }

/* Buttons in hero: white labels; soft hover tint */
.hero .btn, .hero .btn--ghost { color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.hero .btn:hover,
.hero .btn:active,
.hero .btn:focus-visible,
.hero .btn--ghost:hover,
.hero .btn--ghost:active,
.hero .btn--ghost:focus-visible { color: #9eb7d1; }

/* Ghost button legibility on dark video */
.hero .btn--ghost {
  border-color: rgba(255,255,255,0.55);
  background-color: rgba(255,255,255,0.05);
}
.hero .btn--ghost:hover { background-color: rgba(255,255,255,0.10); }

/* ---------- 5) Cards / Surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-m);
  box-shadow: var(--shadow-1);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2), var(--glow);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

/* Project cards */
.project-card .thumb {
  border-radius: calc(var(--radius) - 6px);
  overflow: hidden;
  border: 1px solid var(--border);
}
.project-card h3 { margin: var(--space-s) 0 var(--space-s); }
.project-card p { color: var(--muted); }

/* Gentle image micro-zoom */
.project-card .thumb img { transition: transform .3s ease; }
.project-card:hover .thumb img { transform: scale(1.03); }

/* KPI badges */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-s); }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-s);
  text-align: center;
  box-shadow: var(--shadow-1);
}
.kpi .value { font: 800 var(--step-2)/1.1 Inter, system-ui; color: var(--primary); }
.kpi .label { color: var(--muted); }

/* Results section (alt backdrop) */
#proof {
  background:
    radial-gradient(600px 180px at 95% -10%, rgba(0, 224, 231, 0.08), transparent 60%),
    var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ---------- 6) Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.1rem;
  border-radius: calc(var(--radius) - 6px);
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--primary) 70%);
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 40%, var(--primary) 60%));
  color: var(--bg); /* readable on teal */
  text-align: center;
  box-shadow: 0 10px 20px rgba(0, 224, 231, 0.25), var(--glow);
  transition: transform .06s ease, filter .15s ease, box-shadow .15s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent), var(--glow);
}

.btn--ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn--ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--glow);
}
.btn--ghost:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  box-shadow: var(--glow);
}

/* Persistent active style for filter buttons (All/Automation/Dashboards/Controls) */
.btn[data-filter][aria-pressed="true"],
.btn[data-filter].is-active,
.btn.btn--ghost[data-filter][aria-pressed="true"],
.btn.btn--ghost[data-filter].is-active {
  background: var(--filter-active-bg) !important;
  border-color: var(--filter-active-border) !important;
  color: var(--filter-active-text) !important;
  text-decoration: none;
  box-shadow: var(--glow);
}
.btn[data-filter][aria-pressed="true"]:hover,
.btn[data-filter].is-active:hover,
.btn.btn--ghost[data-filter][aria-pressed="true"]:hover,
.btn.btn--ghost[data-filter].is-active:hover {
  filter: none !important;
  transform: none !important;
}

/* Hidden project cards (grid compacts cleanly) */
.project-card.is-hidden,
[data-tags].is-hidden { display: none !important; }

/* ---------- 7) Forms (future) ---------- */
.input, .textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: calc(var(--radius) - 6px);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.textarea { min-height: 8rem; resize: vertical; }

/* ---------- 8) Helpers ---------- */
.muted { color: var(--muted); }
details.card summary { cursor: pointer; }
details.card + details.card { margin-top: var(--space-s); }

/* ---------- Software Slider ---------- */
.tech-slider {
  display: flex;
  align-items: center;
  gap: var(--space-s);
}
.tech-slider__viewport {
  overflow: hidden;
  flex: 1;
}
.tech-slider__track {
  display: flex;
  transition: transform 0.4s ease;
}
.tech-slide {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-m) 0;
}
@media (min-width: 768px) {
  .tech-slide { flex: 0 0 33.3333%; }
}
.tech-slide img {
  width: 64px;
  height: 64px;
}
.tech-slider__btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 2rem;
  cursor: pointer;
}

/* ---------- 9) Mobile Menu (structure & animation) ---------- */
/* touch targets */
#mobileMenu a { padding: 0.5rem 0; display: block; }

/* Hamburger button */
.mobile-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hamburger lines — match brand navy */
.hamburger, .hamburger::before, .hamburger::after {
  content: ""; display: block; width: 24px; height: 3px;
  background-color: #0b1d36; /* brand navy */
  border-radius: 2px; transition: all 0.3s ease-in-out; position: relative;
}
.hamburger::before, .hamburger::after { position: absolute; }
.hamburger::before { transform: translateY(-8px); }
.hamburger::after  { transform: translateY(8px); }

/* Morph to “X” when open */
body.menu-open .hamburger { background-color: transparent; }
body.menu-open .hamburger::before { transform: rotate(45deg); }
body.menu-open .hamburger::after  { transform: rotate(-45deg); }

/* Default desktop state */
.mobile-toggle { display: none; }
.mobile-nav { display: none; }
.mobile-nav a { display: block; padding: 0.5rem 0; color: #0b1d36; } /* match desktop menu color */

/* ---------- 10) Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-l);
  color: var(--bg);
  background: var(--primary);
}

/* Foot links should be white */
.footer a, .footer .nav__links a {
    color: var(--bg);
}

/* ---------- 11) Responsiveness ---------- */
/* ≥480px */
@media (min-width: 480px) { .nav__links { gap: var(--space-m); } }

/* ≥768px (tablets) */
@media (min-width: 768px) {
  :root { --container-max: 78rem; }
  .hero { padding-block: var(--space-2xl); }
  .grid { gap: var(--space-l); }
}

/* Desktop: ALWAYS hide mobile menu */
@media (min-width: 769px) {
  .mobile-toggle { display: none !important; }
  .mobile-nav { display: none !important; }
}

/* ≥1024px (laptops) */
@media (min-width: 1024px) {
  .nav { padding-block: var(--space-s); }
  .section { padding-block: var(--space-l); }
  .section--tight { padding-block: var(--space-m); }
}

/* ≥1280px (desktops) */
@media (min-width: 1280px) { :root { --container-max: 82rem; } }
/* ≥1536px (large desktops) */

@media (min-width: 1536px) { :root { --container-max: 90rem; } }
/* ≥1920px (2K–4K) */
@media (min-width: 1920px) {
  body { font-size: calc(var(--step-0) * 1.05); }
  .hero { padding-block: calc(var(--space-2xl) + 0.5rem); }
}
/* ≥2560px (ultrawide) */  @media (min-width: 2560px) { :root { --container-max: 96rem; } }

/* ≤768px (mobile) */
@media (max-width: 768px) {
  /* Hide desktop links; show toggle */
  .nav__links { display: none !important; }
  .mobile-toggle { display: inline-flex !important; align-items: center; justify-content: center; }

  /* Mobile menu animated reveal (no display toggling so transitions work) */
  .mobile-nav {
    display: block !important;
    overflow: hidden;
    max-height: 0;         /* collapsed by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition:
      max-height 0.3s ease,
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0s linear 0.25s;  /* delay hiding so it won’t trap focus */
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0,0,0,0.06);
    padding: 0 var(--space-s);
  }
  body.menu-open .mobile-nav {
    visibility: visible;
    max-height: 70vh;      /* enough space for links */
    opacity: 1;
    transform: translateY(0);
    transition:
      max-height 0.35s ease,
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0s;
  }
  body.menu-open { overflow: hidden; }
}
