/* Venerable Grain — light gallery restyle */

:root {
  --ink: #1a1917;
  --ground: #f6f5f2;
  --panel: #ffffff;
  --hull: #e4e1db;
  --wood: #7a6548;
  --type: #1a1917;
  --type-muted: #6a6560;
  --rule: rgba(26, 25, 23, 0.1);
  --overlay: rgba(18, 16, 14, 0.42);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Outfit", system-ui, sans-serif;

  --space: clamp(1.25rem, 3vw, 2.5rem);
  --measure: 36rem;
  --wide: 68rem;
  --header-h: 4.25rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--type);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

a:hover {
  color: var(--wood);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 0.65rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--type-muted);
}

/* ——— Header ——— */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
  padding: 0 var(--space);
  background: rgba(246, 245, 242, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.wordmark:hover {
  color: var(--wood);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.35rem;
}

.site-nav a {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--type-muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 1.1rem;
  height: 1px;
  margin: 0 auto;
  background: var(--ink);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--space) 1rem;
    background: var(--panel);
    border-bottom: 1px solid var(--rule);
  }

  .site-nav.is-open { display: flex; }

  .site-nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
  }
}

/* ——— Hero (photo-first) ——— */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: var(--space);
  padding-bottom: clamp(3rem, 10vh, 5.5rem);
  overflow: hidden;
  color: #f6f5f2;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  animation: hero- ken 18s var(--ease) both;
}

@keyframes hero-ken {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(18, 16, 14, 0.35) 0%, transparent 35%),
    linear-gradient(0deg, rgba(18, 16, 14, 0.72) 0%, rgba(18, 16, 14, 0.15) 48%, transparent 70%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 38rem;
  animation: rise 1.1s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #f6f5f2;
}

.hero__line {
  margin: 0 0 1.75rem;
  max-width: 26rem;
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 300;
  color: rgba(246, 245, 242, 0.82);
}

.text-link {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.2rem;
  transition: opacity 0.25s var(--ease), border-color 0.25s var(--ease);
}

.text-link:hover {
  opacity: 0.7;
  color: inherit;
}

.hero .text-link {
  color: #f6f5f2;
}

.btn {
  display: inline-block;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.2rem;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), opacity 0.25s var(--ease);
}

.btn:hover {
  color: var(--wood);
  border-bottom-color: var(--wood);
}

/* ——— Page shell ——— */

.page {
  width: min(100% - 2 * var(--space), var(--wide));
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}

.page__header {
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
  max-width: var(--measure);
  animation: rise 0.8s var(--ease) both;
}

.page__title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.1rem);
}

.page__lede {
  margin: 0;
  color: var(--type-muted);
  font-size: 1.05rem;
}

.prose {
  max-width: var(--measure);
}

.prose p {
  margin: 0 0 1.25rem;
  color: var(--type-muted);
}

.prose p:last-child {
  margin-bottom: 0;
}

/* ——— Collection gallery (airy) ——— */

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(3.5rem, 8vw, 6rem);
}

@media (min-width: 900px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
    gap: clamp(3rem, 5vw, 5rem) clamp(2rem, 4vw, 3.5rem);
  }

  .gallery__item:first-child {
    grid-column: 1 / -1;
  }

  .gallery__item:first-child .gallery__media {
    aspect-ratio: 16 / 9;
    max-height: 70vh;
  }
}

.gallery__item {
  animation: rise 0.9s var(--ease) both;
}

.gallery__item:nth-child(2) { animation-delay: 0.08s; }
.gallery__item:nth-child(3) { animation-delay: 0.14s; }
.gallery__item:nth-child(4) { animation-delay: 0.2s; }

.gallery__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.gallery__link:hover .gallery__img {
  transform: scale(1.02);
}

.gallery__link:hover .gallery__name {
  color: var(--wood);
}

.gallery__media {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--hull);
  margin-bottom: 1.15rem;
}

.gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

.gallery__name {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 500;
  transition: color 0.25s var(--ease);
}

.gallery__meta {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--type-muted);
}

/* ——— Stories list ——— */

.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}

.story-list__item {
  border-bottom: 1px solid var(--rule);
  animation: rise 0.8s var(--ease) both;
}

.story-list__link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.75rem 0;
  color: inherit;
  text-decoration: none;
}

.story-list__link:hover .story-list__title {
  color: var(--wood);
}

.story-list__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 500;
  transition: color 0.25s var(--ease);
}

.story-list__sub {
  margin: 0.35rem 0 0;
  color: var(--type-muted);
  font-size: 0.95rem;
}

.story-list__mark {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--type-muted);
}

/* ——— Piece / story detail ——— */

.piece,
.story {
  width: min(100% - 2 * var(--space), 52rem);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.piece__title,
.story__title {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 2.85rem);
}

.piece__meta,
.story__subtitle {
  margin: 0 0 2rem;
  color: var(--type-muted);
}

.piece__figure,
.story__figure {
  margin: 0 0 2rem;
  background: var(--hull);
  overflow: hidden;
}

.piece__figure img,
.story__figure img {
  width: 100%;
  height: auto;
  display: block;
  animation: reveal 1.1s var(--ease) both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: scale(1.03);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.piece__story-link,
.story__piece-link,
.back-link {
  margin-top: 2.5rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.back-link a {
  color: var(--type-muted);
  text-decoration: none;
}

.back-link a:hover {
  color: var(--wood);
}

/* ——— About / Materials ——— */

.about-block + .about-block {
  margin-top: 2.75rem;
  padding-top: 2.75rem;
  border-top: 1px solid var(--rule);
}

.about-block h2 {
  margin: 0 0 0.75rem;
  font-size: 1.3rem;
}

.service-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 22rem;
}

.service-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--type-muted);
}

.service-list li:first-child {
  border-top: 1px solid var(--rule);
}

.materials-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
  max-width: 28rem;
}

.materials-list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}

.materials-list li:first-child {
  border-top: 1px solid var(--rule);
}

.materials-list strong {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.materials-list span {
  color: var(--type-muted);
  font-size: 0.95rem;
}

/* ——— Contact ——— */

.contact-action {
  margin-top: 2rem;
}

.contact-note {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--type-muted);
}

/* ——— Imagine (Mad Libs) ——— */

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

.page--imagine {
  width: min(100% - 2 * var(--space), 42rem);
}

.madlib {
  margin: 0 0 2rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 1.75rem);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.madlib__field {
  display: inline;
}

.madlib select {
  display: inline;
  max-width: 100%;
  margin: 0 0.05em;
  padding: 0 0.15em 0.05em;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: var(--wood);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  appearance: none;
  cursor: pointer;
}

.madlib select:hover,
.madlib select:focus {
  border-bottom-color: var(--wood);
  outline: none;
}

.imagine-note {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1.5rem;
  max-width: var(--measure);
}

.imagine-note__label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--type-muted);
}

.imagine-note input {
  width: 100%;
  padding: 0.55rem 0;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
}

.imagine-note input:focus {
  outline: none;
  border-bottom-color: var(--wood);
}

.imagine-preview {
  margin: 0 0 1.75rem;
  max-width: var(--measure);
  color: var(--type-muted);
  font-size: 0.95rem;
}

.imagine-actions {
  margin-top: 0.5rem;
}

button.btn {
  cursor: pointer;
  font: inherit;
}

button.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.imagine-status {
  min-height: 1.4rem;
  margin: 1rem 0 0;
  color: var(--type-muted);
  font-size: 0.9rem;
}

.imagine-result {
  margin: 2.75rem 0 0;
  padding: 0;
}

.imagine-result img {
  width: 100%;
  background: var(--hull);
}

.imagine-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

/* ——— Footer ——— */

.site-footer {
  padding: 2.75rem var(--space);
  border-top: 1px solid var(--rule);
  text-align: center;
}

.site-footer__brand {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
}

.site-footer__tag {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--type-muted);
}

/* Home: header over photo hero */
.layout-home .site-header {
  position: absolute;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

.layout-home .wordmark,
.layout-home .site-nav a {
  color: rgba(246, 245, 242, 0.88);
}

.layout-home .wordmark:hover,
.layout-home .site-nav a:hover,
.layout-home .site-nav a[aria-current="page"] {
  color: #f6f5f2;
}

.layout-home .nav-toggle {
  border-color: rgba(246, 245, 242, 0.35);
}

.layout-home .nav-toggle span,
.layout-home .nav-toggle span::before,
.layout-home .nav-toggle span::after {
  background: #f6f5f2;
}

.layout-home .site-nav {
  background: transparent;
}

@media (max-width: 820px) {
  .layout-home .site-nav.is-open {
    background: rgba(18, 16, 14, 0.94);
    border-bottom-color: rgba(246, 245, 242, 0.12);
  }

  .layout-home .site-nav a {
    border-bottom-color: rgba(246, 245, 242, 0.12);
  }
}

.layout-home .site-footer {
  display: none;
}

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