/* ==========================================================================
   Bill Whitney — BHW Portfolio
   Shared stylesheet for index, about, and project pages
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;1,400;1,500&family=Inter:wght@600;700;800&display=swap');

:root {
  --bg: #0a0a0a;
  --fg: #f5f5f3;
  --fg-dim: #b8b8b5;
  --fg-faint: #7a7a77;
  --tile-bg: #f5f5f3;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --gap: clamp(10px, 2vw, 18px);
  --edge: clamp(24px, 6vw, 96px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

img {
  display: block;
  max-width: 100%;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--edge) var(--edge) 0;
}

.logo {
  display: inline-block;
  flex-shrink: 0;
}

.logo img {
  display: block;
  width: 34px;
  height: 34px;
}

@media (min-width: 720px) {
  .logo img {
    width: 48px;
    height: 48px;
  }
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.15rem;
}

.site-nav a {
  opacity: 0.92;
  transition: opacity 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  opacity: 1;
  border-bottom: 1px solid var(--fg);
}

/* ---------- Main / layout wrapper ---------- */

main {
  flex: 1;
  padding: clamp(40px, 6vw, 72px) var(--edge) 0;
}

/* ---------- About page ---------- */

.about-layout {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: clamp(32px, 6vw, 80px);
  max-width: 1400px;
}

.about-photo img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.about-content h2 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 1.4rem;
}

.about-content h2 + h2 {
  margin-top: 3rem;
}

.about-copy p {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--fg);
  margin: 0 0 1.4rem;
  max-width: 62ch;
}

.testimonials {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #1a1a18;
}

.social-links a {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: var(--fg);
}

.testimonial-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
  color: var(--fg);
}

.testimonial-quote {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0;
  color: var(--fg);
  max-width: 62ch;
}

@media (max-width: 720px) {
  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-photo {
    max-width: 280px;
  }
}

/* ---------- Project page ---------- */

.project-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 24px;
  max-width: 1000px;
  margin: 0 auto clamp(28px, 5vw, 44px);
}

.back-btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.back-btn:hover {
  color: var(--fg);
}

.project-title {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  letter-spacing: -0.01em;
  margin: 0;
}

.slideshow {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.slides-track {
  position: relative;
  background: #0c0c0c;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide {
  display: none;
  width: 100%;
  min-height: 420px;
}

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

.slide img {
  display: block;
  max-width: 100%;
  max-height: 640px;
  width: auto;
  height: auto;
  margin: 0 auto;
}

.slide .embed-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.slide .embed-wrap iframe,
.slide .embed-wrap video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.slide-intro {
  max-width: 620px;
  padding: clamp(24px, 5vw, 48px) 24px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--fg);
  text-align: center;
  margin: 0 auto;
}

.slide-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 0;
  max-width: 1000px;
  margin: 0 auto;
}

.slide-arrow {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 22px;
  background: transparent;
  border: 1px solid #2a2a28;
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.slide-arrow:hover:not(:disabled) {
  border-color: var(--fg);
}

.slide-arrow:disabled {
  opacity: 0.2;
  cursor: default;
}

.slide-counter {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
}

/* Footer */

.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  padding: 0 var(--edge) var(--edge);
}

.site-footer p {
  margin: 0;
  text-align: center;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.site-footer a {
  color: var(--fg-dim);
}

.site-footer a:hover {
  color: var(--fg);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---------- Work grid v2 (real thumbnails w/ hover reveal) ---------- */

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  max-width: 1400px;
}

.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: block;
  background: var(--tile-bg);
}

.thumb-img {
  position: absolute;
  inset: 0;
}

.thumb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.thumb:hover .thumb-img img {
  transform: scale(1.05);
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 16px 18px;
}

.thumb:hover .thumb-overlay,
.thumb:focus-visible .thumb-overlay {
  opacity: 1;
}

.thumb-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg);
}

@media (max-width: 720px) {
  .thumb-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .thumb-grid {
    grid-template-columns: 1fr;
  }
}
