/* ============================================================
   Harpeth Web Design — shared stylesheet
   Loaded by: index.html, 404.html, /portfolio/{slug}/index.html
   Contains design tokens, theme switching, nav, footer,
   buttons, base typography, and shared utilities.
   Page-specific styles live inline in each page.
   ============================================================ */

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

:root {
  --purple: #9b59f0;
  --blue: #3b82f6;
  --cyan: #06d6e0;
  --coral: #f76c6c;
  --orange: #f0a030;
  --magenta: #d946ef;
  --navy: #0a0e1a;
  --navy-light: #111827;
  --navy-mid: #1a2236;
  --surface: #1e2740;
  --text: #e2e8f0;
  --text-dim: #8896b0;
  --grad-primary: linear-gradient(135deg, var(--purple), var(--blue), var(--cyan));
  --grad-warm: linear-gradient(135deg, var(--orange), var(--coral), var(--magenta));
  --grad-full: linear-gradient(135deg, var(--orange), var(--coral), var(--magenta), var(--purple), var(--blue), var(--cyan));
}

/* LIGHT MODE — global elements only (page-specific overrides stay inline) */
[data-theme="light"] {
  --navy: #f0f4ff;
  --navy-light: #e4eaf8;
  --navy-mid: #d8e2f5;
  --surface: #c8d6f0;
  --text: #0f172a;
  --text-dim: #475569;
}
[data-theme="light"] body { background: var(--navy); }
[data-theme="light"] nav {
  background: rgba(240, 244, 255, 0.82);
  border-bottom-color: rgba(0,0,0,0.07);
}
[data-theme="light"] nav.scrolled { background: rgba(240, 244, 255, 0.96); }
[data-theme="light"] .nav-toggle span { background: var(--text); }
[data-theme="light"] .nav-links.open {
  background: rgba(240, 244, 255, 0.98);
  border-bottom-color: rgba(0,0,0,0.07);
}
[data-theme="light"] .btn-secondary {
  border-color: rgba(0,0,0,0.15);
  color: var(--text);
}
[data-theme="light"] .btn-secondary:hover {
  border-color: rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.04);
}
[data-theme="light"] .bg-orbs .orb { opacity: 0.05; }
[data-theme="light"] footer { border-top-color: rgba(0,0,0,0.08); }
[data-theme="light"] .section-label { color: var(--purple); }

/* THEME TOGGLE */
.theme-toggle {
  display: flex; align-items: center; gap: 0.4rem;
  background: none; border: none; cursor: pointer; padding: 0.2rem;
}
.toggle-icon { font-size: 0.85rem; line-height: 1; user-select: none; }
.toggle-track {
  width: 42px; height: 22px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s;
}
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="light"] .toggle-thumb { transform: translateX(20px); background: #0f172a; }
[data-theme="light"] .toggle-track {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.14);
}

/* BASE */
html { scroll-behavior: smooth; }

body {
  font-family: 'Sora', sans-serif;
  background: var(--navy);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.7;
}

/* UTILITY */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.gradient-text {
  background: var(--grad-full);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-cool {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.flow-gradient {
  background: linear-gradient(
    90deg,
    #F97316,
    #EC4899,
    #A855F7,
    #3B82F6,
    #06B6D4,
    #F97316
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: flow-gradient 18s linear infinite;
}
@keyframes flow-gradient {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-gradient { animation: none; }
}

/* ANIMATED BACKGROUND */
.bg-orbs {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
  overflow: hidden;
}
.bg-orbs .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  animation: orbFloat 20s ease-in-out infinite alternate;
}
.bg-orbs .orb:nth-child(1) { width: 600px; height: 600px; background: var(--purple); top: -10%; left: -5%; }
.bg-orbs .orb:nth-child(2) { width: 500px; height: 500px; background: var(--cyan); top: 30%; right: -10%; animation-delay: -7s; animation-duration: 25s; }
.bg-orbs .orb:nth-child(3) { width: 400px; height: 400px; background: var(--coral); bottom: 10%; left: 20%; animation-delay: -14s; animation-duration: 22s; }
.bg-orbs .orb:nth-child(4) { width: 350px; height: 350px; background: var(--orange); top: 60%; right: 25%; animation-delay: -3s; animation-duration: 28s; }

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 40px) scale(0.95); }
  100% { transform: translate(30px, 20px) scale(1.02); }
}

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.2rem 0;
  backdrop-filter: blur(20px);
  background: rgba(10, 14, 26, 0.7);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: padding 0.3s, background 0.3s;
}
nav.scrolled {
  padding: 0.8rem 0;
  background: rgba(10, 14, 26, 0.92);
}
nav .container {
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.8rem;
  text-decoration: none;
}
.nav-logo img { height: 110px; width: auto; }
.logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block; }
.nav-logo span {
  font-family: 'Outfit', sans-serif;
  font-weight: 700; font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-links { display: flex; align-items: center; gap: 2.2rem; list-style: none; }
.nav-links a {
  text-decoration: none; color: var(--text-dim);
  font-size: 0.9rem; font-weight: 500;
  transition: color 0.3s;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute;
  bottom: -4px; left: 0; width: 0; height: 2px;
  background: var(--grad-full);
  transition: width 0.3s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  background: var(--grad-primary) !important;
  color: #fff !important;
  padding: 1rem 2rem;
  border-radius: 0;
  font-weight: 600 !important;
  transition: transform 0.3s, box-shadow 0.3s !important;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.35) !important;
}

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--text); margin: 5px 0;
  transition: 0.3s;
}

/* BUTTONS */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 1rem 2.2rem;
  background: var(--grad-primary);
  color: #fff; border: none; border-radius: 0;
  font-family: 'Sora', sans-serif;
  font-size: 1rem; font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.4);
}
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 1rem 2.2rem;
  background: transparent;
  color: var(--text); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 0;
  font-family: 'Sora', sans-serif;
  font-size: 1rem; font-weight: 500;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
  text-decoration: none;
}
.btn-secondary:hover {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.04);
}

/* SECTION HEADERS */
section { position: relative; z-index: 1; }
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}
.section-label {
  display: inline-block;
  font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--cyan);
  margin-bottom: 1rem;
}
.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.section-sub {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 1rem auto 0;
}

/* FOOTER */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 3rem 0;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer-copy { color: var(--text-dim); font-size: 0.85rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  color: var(--text-dim); font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.3s;
}
.footer-links a:hover { color: var(--text); }

/* SCROLL ANIMATIONS */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* PORTFOLIO — shared between homepage and /portfolio/ index */
.portfolio { padding: 7rem 0; }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.portfolio-card {
  position: relative;
  display: block;
  border-radius: 0;
  overflow: hidden;
  background: var(--navy-mid);
  border: 1px solid rgba(255,255,255,0.06);
  color: inherit;
  text-decoration: none;
  transition: transform 0.4s, box-shadow 0.4s;
}
.portfolio-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.portfolio-thumb {
  width: 100%; aspect-ratio: 16/10;
  position: relative; overflow: hidden;
}
.portfolio-thumb-bg {
  width: 100%; height: 100%;
  transition: transform 0.6s;
}
.portfolio-card:hover .portfolio-thumb-bg { transform: scale(1.05); }
.portfolio-card--nolink { cursor: default; }
.portfolio-card--nolink:hover { transform: none; box-shadow: none; }
.portfolio-card--nolink:hover .portfolio-thumb-bg { transform: none; }
[data-theme="light"] .portfolio-card--nolink:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.portfolio-info { padding: 1.8rem 2rem; }
.portfolio-tag {
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}
.portfolio-info h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700; font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.portfolio-info p { color: var(--text-dim); font-size: 0.9rem; }
.portfolio-tech {
  display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap;
}
.portfolio-tech span {
  font-size: 0.72rem; font-weight: 500;
  padding: 0.3rem 0.8rem;
  border-radius: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-dim);
}
.portfolio-cta { text-align: center; margin-top: 3rem; }
[data-theme="light"] .portfolio-card {
  border-color: rgba(0,0,0,0.07);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
[data-theme="light"] .portfolio-tech span {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .portfolio-tag { color: var(--purple); }

/* SHARED RESPONSIVE — page-specific breakpoints stay inline */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-orbs .orb { animation: none !important; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .btn-primary:hover,
  .btn-secondary:hover,
  .nav-cta:hover,
  .portfolio-card:hover { transform: none !important; }
  .portfolio-card:hover .portfolio-thumb-bg { transform: none !important; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-logo img { height: 50px; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(10, 14, 26, 0.97);
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    gap: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .container { padding: 0 1.25rem; }
  .section-header { margin-bottom: 3rem; }
  .portfolio-grid { grid-template-columns: 1fr; }
}
