/* ==========================================================================
   Graham Clark Stecklein — Scribing Portfolio
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400&family=Luckiest+Guy&display=swap');

:root {
  --bg-top: #F1EDE2;
  --bg-bottom: #FAF8F2;
  --ink: #201F1C;
  --ink-soft: #55524A;
  --red: #D8432E;
  --blue: #2C5C8A;
  --line: #DCD6C6;

  --sans: Futura, 'Century Gothic', 'Avenir Next', 'Avenir', sans-serif;
  --serif: 'EB Garamond', Garamond, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%) fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 3s ease, color 2s ease;
}

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}

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

/* ---------- layout shell ---------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- header / hero ---------- */

.site-header {
  padding: 28px 0;
}

.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.name-mark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.header-contact {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
}

.header-contact a { text-decoration: none; border-bottom: 1px solid var(--line); }

.hero { padding: 0; }

.hero-banner {
  position: relative;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch; 
}

.hero-text {
  position: relative;
  width: 100%;
  padding: 40px 32px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-text h1 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(36px, 8vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  max-width: 14ch;
  color: var(--ink);
}

.hero-text h1 em { font-style: normal; color: var(--red); }

.hero-text p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0;
}

.hero-location {
  font-family: var(--sans) !important;
  font-style: normal !important;
  font-size: 14px !important;
  margin-top: 14px !important;
  color: var(--ink-soft) !important;
}

.hero-video {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 424;
  height: auto;
  min-height: auto;
  overflow: hidden;
  background: #0c0b09;
}

.hero-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

@media (min-width: 760px) {
  .hero-banner {
    flex-direction: row;
    min-height: 560px;
  }
  .hero-text {
    flex: 0 0 45%;
    padding-left: clamp(32px, 8vw, 120px);
    position: relative;
    z-index: 2;
  }
  .hero-text p { font-size: 21px; }
  .hero-video {
    flex: 1;
    height: auto;
    aspect-ratio: auto; /* Let flex control height on desktop */
    margin-left: -8%; 
    -webkit-mask-image: linear-gradient(to left, black 75%, transparent 100%);
    mask-image: linear-gradient(to left, black 75%, transparent 100%);
  }
  .hero-video video {
    object-position: right center;
  }
}

/* ---------- Content Sections ---------- */

.tier { padding: 56px 0; }
.tier-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; }
.tier-head h2 { font-family: var(--sans); font-weight: 700; font-size: clamp(26px, 3.4vw, 36px); margin: 0; letter-spacing: -0.01em; }
.tier-head p { font-family: var(--serif); color: var(--ink-soft); margin: 6px 0 0; max-width: 52ch; font-size: 18px; }
.tier-index { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); white-space: nowrap; padding-bottom: 4px; }

.carousel-shell { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
.carousel { display: flex; align-items: center; gap: 3px; overflow-x: auto; overflow-y: hidden; padding: 12px 0; background: #fff; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel figure { flex: 0 0 auto; height: 420px; margin: 0; line-height: 0; }
.carousel img { height: 100%; width: auto; max-width: none; object-fit: contain; background: #fff; display: block; cursor: pointer; }

.single-work { display: flex; justify-content: flex-start; }
.single-work figure { margin: 0; }
.single-work img { max-width: min(100%, 640px); height: auto; display: block; cursor: pointer; }

.faq { padding: 40px 0 56px; }
.faq h2 { font-family: var(--sans); font-weight: 700; font-size: clamp(24px, 3.2vw, 32px); margin: 0 0 28px; }
.faq-item { max-width: 68ch; padding: 14px 0; }
.faq-item h3 { font-family: var(--sans); font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.faq-item p { margin: 0; color: var(--ink-soft); }
.faq-layout { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.faq-main { width: 100%; }
.faq-side { flex: 0 0 auto; max-width: 180px; }
.faq-side img { width: 100%; height: auto; display: block; }
@media (min-width: 860px) {
  .faq-layout { flex-direction: row; align-items: stretch; gap: 48px; }
  .faq-side { max-width: none; width: min(34%, 360px); align-self: stretch; display: flex; align-items: center; margin-top: 0; }
  .faq-side img { width: auto; height: 100%; max-width: 100%; object-fit: contain; }
}

.site-footer { padding-top: 56px; }
.footer-intro { padding: 0 0 40px; }
.footer-intro .wrap { display: flex; justify-content: flex-end; }
.footer-intro h2 { font-family: var(--sans); font-weight: 700; font-size: clamp(28px, 4vw, 44px); margin: 0; max-width: 14ch; }
.footer-contact { font-family: var(--sans); font-size: 16px; line-height: 1.9; }
.footer-contact a { text-decoration: none; border-bottom: 1px solid var(--line); }
.footer-photo { position: relative; overflow: hidden; }
.footer-photo img { width: 100%; height: 62vw; max-height: 680px; object-fit: cover; display: block; }
.footer-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: clamp(16px, 7vw, 90px); pointer-events: none; }
.footer-splash-badge { position: relative; background: #FAA613; padding: clamp(22px, 4.5vw, 44px) clamp(34px, 7vw, 68px); clip-path: polygon(9% 2%, 34% 0%, 58% 3%, 84% 0%, 97% 12%, 100% 38%, 96% 60%, 100% 84%, 88% 99%, 63% 96%, 40% 100%, 15% 97%, 2% 86%, 0% 60%, 4% 36%, 0% 15%); opacity: 0; transform: rotate(-5deg) translateY(160px); will-change: transform, opacity; }
.footer-splash-text { font-family: 'Luckiest Guy', var(--sans); color: #fff; -webkit-text-stroke: 2px #000; paint-order: stroke fill; text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; font-size: clamp(30px, 5.6vw, 72px); line-height: 1.05; text-align: center; }
.footer-copyright { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font-family: var(--sans); font-size: 12px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }

/* ---------- splash: polaroid above title (no overlap with work strip) ---------- */

.tier-splash {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0 34px;
}

.polaroid {
  flex: 0 0 auto;
  background: #fff;
  padding: 10px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.30), 0 6px 14px rgba(0,0,0,0.18);
}

.polaroid-frame { width: clamp(160px, 34vw, 340px); }
.polaroid-frame img { display: block; width: 100%; height: auto; }

.tier-splash .polaroid {
  opacity: 0;
  transform: translateX(90px) rotate(5deg);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.tier-splash.is-visible .polaroid {
  opacity: 1;
  transform: translateX(0) rotate(5deg);
}

/* ---------- splash: stacked-photo vignette ---------- */

.tier-splash-stack {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 34px;
}

.stack-wrap {
  position: relative;
  display: inline-block;
}

/* the wide "pano" photo: sticks out to the left, swoops in from the left */
.stack-back {
  position: relative;
  opacity: 0;
  transform: translateX(-110px) rotate(-14deg);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.stack-back .polaroid-frame { width: clamp(220px, 46vw, 480px); }
.tier-splash-stack.is-visible .stack-back { opacity: 1; transform: rotate(-6deg); }

.stack-front {
  position: absolute;
  top: clamp(90px, 20vw, 170px);
  right: clamp(-90px, -20vw, -60px);
  z-index: 2;
  opacity: 0;
  transform: translateX(110px) rotate(16deg);
  transition: opacity 0.9s ease 0.15s, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}
.stack-front .polaroid-frame { width: clamp(200px, 40vw, 420px); }

.tier-splash-stack.is-visible .stack-front { opacity: 1; transform: rotate(5deg); }

@media (max-width: 619px) {
  .tier-splash { margin: 8px 0 -10px; }
  .tier-splash-stack { margin: 4px 0 -16px; }
  .stack-back .polaroid-frame { width: clamp(170px, 56vw, 230px); }
  .stack-front { top: clamp(56px, 17vw, 82px); right: clamp(-18px, -5vw, -6px); }
  .stack-front .polaroid-frame { width: clamp(140px, 46vw, 190px); }
}

@media (prefers-reduced-motion: reduce) {
  .tier-splash .polaroid,
  .stack-back,
  .stack-front {
    opacity: 1 !important;
    transition: none !important;
  }
  .tier-splash .polaroid { transform: rotate(5deg) !important; }
  .stack-back { transform: rotate(-6deg) !important; }
  .stack-front { transform: rotate(5deg) !important; }
}

/* ---------- LIGHTBOX ---------- */

#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.96);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(8px);
}

#lightbox[aria-hidden="false"] {
  visibility: visible;
  opacity: 1;
}

#lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: #fff;
  font-size: 48px;
  cursor: pointer;
  z-index: 10010;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #fff;
  font-size: 32px;
  padding: 20px 15px;
  cursor: pointer;
  z-index: 10010;
}

#lightbox-prev { left: 0; }
#lightbox-next { right: 0; }

.lightbox-figure {
  margin: 0;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

.lightbox-video {
  width: 80vw;
  aspect-ratio: 16 / 9;
  max-height: 75vh;
}

.lightbox-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

#lightbox-caption {
  color: #fff;
  margin-top: 16px;
  font-family: var(--serif);
  font-style: italic;
}
/* ---------- contact form ---------- */

.contact { padding: 20px 0 56px; }
.contact h2 { font-family: var(--sans); font-weight: 700; font-size: clamp(26px, 3.4vw, 36px); margin: 0 0 22px; }
.contact-form { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-family: var(--sans); font-size: 14px; color: var(--ink-soft); }
.contact-form input, .contact-form textarea { font-family: var(--serif); font-size: 16px; color: var(--ink); background: transparent; border: 1px solid var(--line); padding: 10px 12px; border-radius: 2px; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--ink); }
.contact-form button { align-self: flex-start; font-family: var(--sans); font-weight: 700; font-size: 15px; background: var(--red); color: #fff; border: none; padding: 12px 28px; cursor: pointer; }
.contact-form button:hover { opacity: 0.9; }
.contact-form button[disabled] { opacity: 0.5; cursor: default; }
.contact-form input[aria-invalid="true"], .contact-form textarea[aria-invalid="true"] { border-color: var(--red); }

.contact-success, .contact-error {
  font-family: var(--sans);
  font-size: 14px;
  max-width: 520px;
  margin-bottom: 14px;
  display: none;
}
.contact-success:not(:empty), .contact-error:not(:empty) { display: block; padding: 10px 14px; }
.contact-success:not(:empty) { background: #EAF3EA; color: #2C5C3A; border: 1px solid #BFE0C4; }
.contact-error:not(:empty) { background: #FBEAE7; color: #8A2E20; border: 1px solid #F0C4BC; }

.contact-field-error {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--red);
  margin-top: -10px;
}
