/* =========================================================
   Tegan Brace — minimal portfolio styles
   ========================================================= */

:root {
  --color-bg: #ffffff;
  --color-fg: #111111;
  --color-muted: #6b6b6b;
  --color-border: #e5e5e5;
  --color-accent: #111111;
  --max-width: 1400px;
  --gutter: clamp(1rem, 3vw, 2.5rem);
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-fg);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
a:hover { opacity: 0.55; }

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

/* =========================================================
   Header
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0;
}

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--color-fg);
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

@media (max-width: 720px) {
  .menu-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    display: none;
  }
  .site-nav.open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--gutter);
  }
  .site-nav li { border-top: 1px solid var(--color-border); }
  .site-nav li:first-child { border-top: none; }
  .site-nav a {
    display: block;
    padding: 0.85rem 0;
  }
}

/* =========================================================
   Main layout
   ========================================================= */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 4rem;
}

.page-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  margin: 0 0 2rem;
  letter-spacing: 0.01em;
}

/* =========================================================
   Home — hero slideshow
   ========================================================= */

.hero {
  position: relative;
  width: 100%;
  height: calc(100vh - 80px);
  min-height: 500px;
  overflow: hidden;
}

.hero-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slide.active { opacity: 1; }

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f7f7f7;
}

.hero-controls {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
  z-index: 2;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--color-fg);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hero-dot.active { background: var(--color-fg); }

.hero-arrows button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--color-border);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease;
}

.hero-arrows button:hover { background: #fff; }
.hero-arrows .prev { left: 1rem; }
.hero-arrows .next { right: 1rem; }

.hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f7f7f7;
  color: var(--color-muted);
  text-align: center;
  padding: 2rem;
}

.hero-placeholder p { margin: 0.25rem 0; font-size: 0.95rem; }
.hero-placeholder code {
  font-size: 0.85rem;
  background: #ececec;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

/* =========================================================
   Gallery grid
   ========================================================= */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.gallery-item {
  position: relative;
  cursor: zoom-in;
  background: #f7f7f7;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img { transform: scale(1.02); }

.gallery-caption {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
}

.gallery-empty {
  border: 1px dashed var(--color-border);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--color-muted);
  border-radius: 4px;
  grid-column: 1 / -1;
}

.gallery-empty code {
  background: #f0f0f0;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  font-size: 0.9em;
}

/* =========================================================
   Lightbox
   ========================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255, 255, 255, 0.25); }

.lightbox-close { top: 1.25rem; right: 1.25rem; }
.lightbox-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }

.lightbox-counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* =========================================================
   About page
   ========================================================= */

.about {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  max-width: 900px;
  margin: 0 auto;
}

@media (min-width: 720px) {
  .about {
    grid-template-columns: 1fr 1.4fr;
    align-items: start;
  }
}

.about-image {
  background: #f7f7f7;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

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

.about-text h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.75rem;
  margin: 0 0 1rem;
}

.about-text p {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.about-text .credits {
  font-size: 0.95rem;
  color: var(--color-muted);
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem var(--gutter);
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.footer-social {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-social a {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* =========================================================
   Utilities
   ========================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  background: var(--color-fg);
  color: var(--color-bg);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 40;
}

.back-to-top.visible {
  opacity: 0.9;
  pointer-events: auto;
}
