/* ============================================
   Portage Creek Technologies
   ============================================ */

:root {
  /* Brand colors (constant across themes) */
  --navy: #0f4c81;
  --navy-dark: #0a3459;
  --navy-light: #1a6bb5;
  --sky: #38bdf8;
  --sky-light: #7dd3fc;

  /* Semantic tokens — LIGHT theme defaults */
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --text: #0f172a;
  --text-strong: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;

  --accent: var(--navy);
  --accent-hover: var(--navy-dark);
  --accent-soft: rgba(15, 76, 129, 0.1);
  --on-accent: #ffffff;

  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-bg-scrolled: rgba(255, 255, 255, 0.95);

  --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.08);
  --shadow-lg: 0 12px 32px rgba(15,23,42,0.1);

  /* Hero gradient stops */
  --hero-gradient-from: #f8fafc;
  --hero-gradient-to: #ffffff;

  /* Token-independent constants */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 12px;
  --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e1a;
    --bg-alt: #0f172a;
    --surface: #111827;
    --surface-alt: #1e293b;
    --text: #f1f5f9;
    --text-strong: #ffffff;
    --text-muted: #cbd5e1;
    --text-subtle: #64748b;
    --border: #1e293b;
    --border-subtle: #1e293b;

    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-soft: rgba(96, 165, 250, 0.15);
    --on-accent: #0a0e1a;

    --nav-bg: rgba(10, 14, 26, 0.85);
    --nav-bg-scrolled: rgba(10, 14, 26, 0.95);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);

    --hero-gradient-from: #0f172a;
    --hero-gradient-to: #0a0e1a;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  background: var(--bg);
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img, svg { display: block; }

a {
  color: inherit;
  text-decoration: none;
}

/* Container */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.nav--scrolled {
  border-bottom-color: var(--border);
  background: var(--nav-bg-scrolled);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-strong);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav__logo-img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
}

.nav__links {
  display: flex;
  gap: 32px;
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.2s;
}

.nav__links a:hover {
  color: var(--text-strong);
}

.nav__links a:hover::after {
  width: 100%;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: var(--font);
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 3px var(--accent-soft);
}

.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px var(--accent-soft);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--surface-alt);
}

.btn--full {
  width: 100%;
}

/* ---- Hero ---- */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(170deg, var(--hero-gradient-from) 0%, var(--hero-gradient-to) 50%);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero__eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.hero__title {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-strong);
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}

.hero__subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__graphic {
  width: 100%;
  max-width: 420px;
  animation: float 6s ease-in-out infinite;
}

.hero__graphic svg {
  width: 100%;
  height: auto;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ---- Section Headers ---- */
.section__eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.section__title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-strong);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section__subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 48px;
}

/* ---- Services ---- */
.services {
  padding: 100px 0;
  background: var(--bg);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: transparent;
  transform: translateY(-4px);
}

.card__icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: 20px;
}

.card__icon svg {
  width: 100%;
  height: 100%;
}

.card__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.card__text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ---- About ---- */
.about {
  padding: 100px 0;
  background: var(--bg-alt);
}

.about__inner {
  max-width: 680px;
}

.about__content p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.7;
}

.about__stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat__icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.stat__icon svg {
  width: 100%;
  height: 100%;
}

.stat__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

/* ---- Contact ---- */
.contact {
  padding: 100px 0;
  background: var(--bg);
}

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact__info p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}

.contact__details {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact__details li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text);
}

.contact__details li svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
}

.contact__details a {
  transition: color 0.2s;
}

.contact__details a:hover {
  color: var(--accent);
}

/* Contact CTA card (mailto) */
.contact__cta {
  background: var(--surface-alt);
  padding: 40px 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.contact__cta-eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact__cta-text {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.contact__cta .btn {
  margin-top: 4px;
}

.contact__cta-fallback {
  font-size: 0.85rem;
  color: var(--text-subtle);
  text-align: center;
  margin-top: 8px;
}

.contact__cta-fallback a {
  color: var(--accent);
  font-weight: 500;
  transition: opacity 0.2s;
}

.contact__cta-fallback a:hover {
  opacity: 0.7;
}

/* ---- Footer ---- */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.footer__brand p {
  font-size: 0.85rem;
  color: var(--text-subtle);
}

.footer__links {
  display: flex;
  gap: 24px;
}

.footer__links a {
  font-size: 0.85rem;
  color: var(--text-subtle);
  transition: color 0.2s;
}

.footer__links a:hover {
  color: var(--accent);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav__links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform 0.3s ease, visibility 0.3s;
    box-shadow: var(--shadow-md);
    visibility: hidden;
  }

  .nav__links--open {
    transform: translateY(0);
    visibility: visible;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__toggle--open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav__toggle--open span:nth-child(2) {
    opacity: 0;
  }

  .nav__toggle--open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero__visual {
    order: -1;
  }

  .hero__graphic {
    max-width: 280px;
  }

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

  .contact__inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about__stats {
    flex-direction: column;
    gap: 16px;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .card {
    padding: 24px;
  }

  .contact__form {
    padding: 24px;
  }
}

/* ---- Privacy Page ---- */
.privacy {
  padding: 140px 0 80px;
  min-height: 100vh;
  background: var(--bg);
}

.privacy__content {
  max-width: 680px;
}

.privacy__content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-top: 40px;
  margin-bottom: 12px;
}

.privacy__content p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

.privacy__content ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 12px;
}

.privacy__content li {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 4px;
}

.privacy__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 32px;
  transition: gap 0.2s;
}

.privacy__back:hover {
  gap: 10px;
}

/* Hero graphic colors adapt to theme via CSS variables on the SVG */
.hero__graphic--ring { stroke: rgba(56,189,248,0.15); }
.hero__graphic--ring-mid { stroke: rgba(56,189,248,0.2); }
.hero__graphic--ring-inner { stroke: rgba(56,189,248,0.25); }

@media (prefers-color-scheme: dark) {
  .hero__graphic--ring { stroke: rgba(96,165,250,0.2); }
  .hero__graphic--ring-mid { stroke: rgba(96,165,250,0.25); }
  .hero__graphic--ring-inner { stroke: rgba(96,165,250,0.3); }
}
