/* =========================
   assets/css/styles.css
   ========================= */

:root {
  /* Core palette (keeps your theme) */
  --bg: #0b0c10;
  --panel: #11131a;

  --text: #eef0f6;
  --muted: #a7adc0;

  /* One primary accent + one secondary glow (used sparingly) */
  --accent: #5f7cff;   /* your existing blue */
  --accent2: #00d4ff;  /* your existing cyan */

  /* Consistent surfaces + borders */
  --surface-1: rgba(17, 19, 26, 0.86);
  --surface-2: rgba(17, 19, 26, 0.72);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* Shadows and rounding */
  --shadow: 0 10px 26px rgba(0, 0, 0, 0.40);
  --radius: 16px;

  /* Layout */
  --max: 1080px;

  /* Motion */
  --t: 160ms;
  --ease: cubic-bezier(.2,.8,.2,1);

  /* Focus ring */
  --ring: 0 0 0 4px rgba(95, 124, 255, 0.22);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);

  /* Continuous, smoother background */
  background:
    /* soft highlight top-left */
    radial-gradient(farthest-corner at 18% 0%,
      rgba(95, 124, 255, 0.18) 0%,
      rgba(95, 124, 255, 0.10) 22%,
      rgba(95, 124, 255, 0.00) 60%
    ),

    /* soft highlight top-right */
    radial-gradient(farthest-corner at 82% 0%,
      rgba(0, 212, 255, 0.12) 0%,
      rgba(0, 212, 255, 0.06) 26%,
      rgba(0, 212, 255, 0.00) 62%
    ),

    /* subtle wash to blend everything */
    radial-gradient(farthest-corner at 50% 30%,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.00) 55%
    ),

    /* base gradient (prevents “flat” banding) */
    linear-gradient(180deg,
      #0b0c10 0%,
      #090a0f 45%,
      #07080d 100%
    );

  background-attachment: fixed; /* keeps it continuous on scroll */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Optional: ultra-subtle dithering layer to reduce banding on dark gradients */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.025'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Links: professional default + subtle accent on hover */
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Accessible skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  background: #fff;
  color: #000;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 1000;
}
.skip-link:focus { left: 10px; }

/* Layout container */
.container { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 12, 16, 0.72);
  backdrop-filter: blur(12px);
}

.nav {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand {
  font-weight: 750;
  letter-spacing: .2px;
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}

.nav-links a.active,
.nav-links a:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  text-decoration: none;
}

/* Typography */
h1, h2, h3 { letter-spacing: -0.015em; }
h1 {
  font-size: clamp(36px, 5vw, 56px);
  margin: 0 0 10px;
  line-height: 1.05;
}
.section-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
}
.card h3 { margin: 0 0 10px; font-size: 16px; }

.hero { padding: 72px 0 30px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: .6px;
  text-transform: uppercase;
  font-size: 12px;
}
.lede { color: var(--muted); font-size: 18px; max-width: 60ch; }

/* =========================
   Home hero: headshot left, text right
   ========================= */
.hero-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: center;
}

.hero-left {
  display: flex;
  justify-content: flex-start;
}

.headshot {
  width: 140px;
  height: 140px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: rgba(255,255,255,0.02);
}

/* Sections */
.section { padding: 34px 0; }
.section-header p { margin: 0; color: var(--muted); }

/* Buttons: consistent and cleaner */
.cta-row { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  transition:
    background var(--t) var(--ease),
    border-color var(--t) var(--ease),
    transform var(--t) var(--ease);
  will-change: transform;
}
.button:hover {
  text-decoration: none;
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}
.button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.button.primary {
  background: rgba(95,124,255,0.22);
  border-color: rgba(95,124,255,0.42);
}
.button.primary:hover {
  background: rgba(95,124,255,0.28);
  border-color: rgba(95,124,255,0.55);
}

/* Quick facts pills */
.quick-facts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.035);
  color: var(--muted);
  font-size: 13px;
}

/* Grid + cards: unified surfaces */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.card {
  grid-column: span 6;
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card p { margin: 0; color: var(--muted); }

.project-card { cursor: pointer; }
.project-card:hover { border-color: var(--border-strong); }

/* Two column block */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

/* Toolbar fields */
.toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  margin: 16px 0 6px;
}
.field { display: grid; gap: 6px; }
.label { color: var(--muted); font-size: 13px; }

/* Inputs: consistent surface + clear focus */
input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
  color: var(--text);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
input:focus, select:focus { outline: none; }
input:focus-visible, select:focus-visible {
  border-color: rgba(95,124,255,0.60);
  box-shadow: var(--ring);
}

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
  padding: 6px 8px;
  border-radius: 999px;
}

/* Chip-links (Watch) should feel clickable */
a.chip { cursor: pointer; }
a.chip:hover { text-decoration: none; outline: 1px solid rgba(255,255,255,0.18); }

/* Lists */
.list { margin: 10px 0 0; padding-left: 18px; color: var(--muted); }
.list li { margin: 6px 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.back-link { display: inline-block; margin-bottom: 10px; color: var(--muted); }

/* Contact */
.contact-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
}
.link-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  margin-top: 26px;
  background: rgba(11,12,16,0.56);
}
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* =========================
   Project page: spacing + photos
   ========================= */

.project-header { margin-bottom: 22px; }

.project > .card,
.project > .two-col { margin-top: 22px; }

.project .two-col { margin-top: 22px; }

.back-link { margin-bottom: 14px; }

#pPhotosCard h2 { margin-bottom: 12px; }

/* UPDATED: flex wrap so images line up horizontally first, then wrap */
.project-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  max-width: 780px;
  margin: 0 auto;
  justify-content: flex-start; /* change to center if you prefer centered rows */
  align-items: flex-start;
}

/* UPDATED: flex item sizing for clean wrapping */
.project-photo {
  margin: 0;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);

  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* UPDATED: equal height, preserve aspect ratio, no cropping */
.project-photo-img {
  height: 180px;       /* same height for every image */
  width: auto;         /* keep original aspect ratio */
  max-width: 320px;    /* prevents ultra-wide images from dominating a row */
  object-fit: contain; /* no cropping */

  display: block;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.project-photo-cap {
  margin-top: 10px;
  width: 100%;
}

/* Featured cards with thumbnails */
.featured-grid .project-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: start;
}

.featured-grid .project-thumb {
  width: 78px;
  height: 78px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.featured-grid .project-card h3 { margin-top: 0; }
.featured-grid .project-card .chips { margin-top: 10px; }

/* Responsive */
@media (max-width: 900px) {
  .card { grid-column: span 12; }
  .two-col { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .contact-row { grid-template-columns: 1fr; }

  /* Make hero stack on smaller screens */
  .hero-row { grid-template-columns: 1fr; align-items: start; }
  .headshot { width: 120px; height: 120px; }
}

@media (max-width: 600px) {
  .project-gallery {
    max-width: 100%;
    justify-content: center; /* optional: center on mobile */
  }

  .project-photo-img {
    height: 210px;
    max-width: 100%;
  }

  .featured-grid .project-card { grid-template-columns: 1fr; }
  .featured-grid .project-thumb {
    width: 100%;
    height: 140px;
  }
}
