/* EVANOUR — Fourth pass: typography containment, scale, contrast, layout */

:root {
  --type-hero: clamp(2rem, 4.8vw, 3.85rem);
  --type-section: clamp(1.45rem, 3.2vw, 2.45rem);
  --type-project: clamp(1.05rem, 2vw, 1.35rem);
  --type-meta: clamp(0.58rem, 1.4vw, 0.68rem);
  --type-body: clamp(0.95rem, 1.05vw, 1.05rem);
  --read-max: 42rem;
  --text-dark: #0a1612;
  --text-dark-soft: rgba(10, 22, 18, 0.78);
  --text-dark-muted: rgba(10, 22, 18, 0.58);
}

/* ─── Global: never clip text ─── */
h1, h2, h3, h4, h5, h6, p, a, span, li, label, blockquote, .label {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: manual;
  min-width: 0;
}

/* Override restrictive ch-based widths from earlier passes */
.display {
  max-width: none;
  width: 100%;
  font-size: var(--type-section);
  line-height: 1.08;
  letter-spacing: 0.025em;
  overflow: visible;
}

.display span {
  display: block;
  white-space: normal;
}

.display--light { color: var(--color-cream); }

.section-head .display,
#projects-title,
#about-title,
#services-title,
#values-title,
#legacy-title,
#partners-title,
#cta-title,
#founder-title {
  max-width: 14em;
}

/* ─── Hero final polish ─── */
.hero {
  overflow: visible;
}

.hero--refined {
  min-height: min(88svh, 780px);
}

.hero--refined .hero__shade {
  background:
    linear-gradient(108deg, rgba(6, 20, 17, 0.68) 0%, rgba(6, 20, 17, 0.22) 46%, rgba(6, 20, 17, 0.06) 72%),
    linear-gradient(0deg, rgba(6, 20, 17, 0.78) 0%, transparent 42%);
}

.hero--refined .hero__media img {
  transform: scale(1.02);
}

.hero--refined .hero__content {
  max-width: 34rem;
  width: 100%;
}

.hero--refined .hero__title {
  font-size: var(--type-hero);
  line-height: 1.06;
  letter-spacing: 0.02em;
  max-width: 11em;
  width: 100%;
  margin: 0.45rem 0 0.85rem;
}

.hero--refined .hero__title span {
  display: block;
}

.hero--refined .hero__sub {
  color: var(--color-gold-soft);
  max-width: 22em;
  line-height: 1.5;
}

body[data-page="home"]:not(.intro-complete) .hero--refined .hero__content {
  opacity: 0;
}

body[data-page="home"].intro-complete .hero--refined .hero__content {
  opacity: 1;
  transition: opacity 0.7s ease 0.15s;
}

@media (max-width: 767px) {
  .hero--refined .hero__media {
    max-height: 44vh;
    aspect-ratio: 16 / 10;
  }

  .hero--refined .hero__title {
    font-size: clamp(1.85rem, 8.5vw, 2.35rem);
    max-width: 100%;
  }

  .hero--refined .hero__content {
    padding: clamp(1.5rem, 5vw, 2rem) clamp(1.15rem, 4vw, 1.75rem);
  }
}

/* ─── Vision / Mission ─── */
.vision-grid {
  align-items: start;
}

.vision-block .display {
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1.1;
  max-width: 13em;
}

.vision-block .lede {
  max-width: var(--read-max);
  color: var(--text-dark-soft);
  font-size: var(--type-body);
}

.section--cream .label,
.section--stone .label,
.section--stone-warm .label,
.section--stone-muted .label {
  color: var(--text-dark-muted);
}

.section--cream .lede,
.section--stone .lede,
.section--stone-warm .lede {
  color: var(--text-dark-soft);
}

.section--charcoal .label:not(.label--gold):not(.label--light),
.section--charcoal-soft .label:not(.label--gold):not(.label--light),
.section--dark .label:not(.label--gold):not(.label--light),
.section--green-deep .label:not(.label--gold):not(.label--light),
.section--accent-green .label:not(.label--gold):not(.label--light) {
  color: var(--champagne, var(--color-gold));
}

/* ─── Timeline — full visibility ─── */
.section--stone .timeline__label,
.section--stone-warm .timeline__label {
  color: var(--text-dark-soft);
  max-width: none;
  hyphens: none;
  white-space: normal;
  font-size: var(--type-meta);
  letter-spacing: 0.14em;
}

.section--stone .timeline__year,
.section--stone-warm .timeline__year {
  color: var(--color-green);
}

.timeline--experience .timeline__item {
  min-width: 0;
  height: auto;
}

.timeline__label span {
  display: block;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .timeline--experience {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Project rows — smaller images, balanced layout ─── */
.project-row {
  min-width: 0;
}

.project-row__info {
  min-width: 0;
}

.project-row__info h3 {
  font-size: var(--type-project);
  max-width: none;
  line-height: 1.2;
  overflow: visible;
}

.project-row__num {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.project-row__media {
  max-height: clamp(180px, 28vw, 260px);
  aspect-ratio: 16 / 10;
}

@media (min-width: 768px) {
  .project-row {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 0.85fr);
  }

  .project-row:nth-child(even) {
    grid-template-columns: auto minmax(0, 0.85fr) minmax(0, 1fr);
  }
}

/* ─── Founder / editorial split ─── */
.founder {
  align-items: center;
}

@media (min-width: 900px) {
  .founder {
    grid-template-columns: minmax(0, 0.4fr) minmax(0, 0.6fr);
    gap: clamp(2.5rem, 6vw, 5.5rem);
  }

  .founder__portrait {
    aspect-ratio: 3 / 4;
  }
}

.section--cream .founder__name,
.section--cream .founder__role {
  color: var(--text-dark);
}

.section--cream .founder__role {
  color: var(--color-gold);
}

/* ─── Gallery — reduced scale ─── */
.gallery-grid__item .aspect-16-9 {
  aspect-ratio: 16 / 9;
  max-height: min(42vh, 420px);
}

.gallery-grid__item .aspect-4-3,
.gallery-grid__item .aspect-3-2 {
  max-height: min(36vh, 340px);
}

.gallery-grid__item .aspect-1-1 {
  max-height: min(32vh, 300px);
}

.gallery-grid__item .aspect-3-4 {
  max-height: min(38vh, 360px);
}

@media (max-width: 767px) {
  .gallery-grid__item .aspect-16-9,
  .gallery-grid__item .aspect-4-3,
  .gallery-grid__item .aspect-3-2,
  .gallery-grid__item .aspect-1-1,
  .gallery-grid__item .aspect-3-4 {
    max-height: 220px;
  }
}

/* ─── Blog — compact editorial cards ─── */
.blog-card__media {
  max-height: 200px;
  aspect-ratio: 16 / 10;
}

.blog-card__title {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  line-height: 1.25;
  overflow: visible;
}

.blog-card .lede {
  font-size: var(--type-body);
  color: var(--text-dark-soft);
}

.article-body {
  max-width: min(var(--read-max), 100%);
  font-size: var(--type-body);
  color: var(--text-dark-soft);
}

.page-hero__content .display {
  max-width: 14em;
  font-size: clamp(1.65rem, 4vw, 2.65rem);
}

/* ─── Partners — compact cards ─── */
.partner-slide {
  width: clamp(9rem, 18vw, 11.5rem);
}

.partners-marquee {
  max-width: 100%;
}

/* ─── Related projects ─── */
.related-stories {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .related-stories { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .related-stories { grid-template-columns: repeat(3, 1fr); }
}

.related-card__media {
  max-height: 160px;
  aspect-ratio: 16 / 10;
}

.related-card__title {
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  line-height: 1.3;
  overflow: visible;
}

/* ─── Menu — no text clipping ─── */
.menu-nav__item {
  overflow: visible;
}

.menu-nav__text {
  font-size: clamp(1.25rem, 4.5vw, 2.15rem);
  line-height: 1.1;
  overflow: visible;
  white-space: normal;
}

/* ─── Value pillars — show text always ─── */
.value-pillar p {
  max-height: none;
  opacity: 1;
  color: var(--text-dark-soft);
}

.value-pillar:hover p {
  max-height: none;
  opacity: 1;
}

/* ─── Contact form ─── */
.contact-form__field input,
.contact-form__field select,
.contact-form__field textarea {
  min-height: 2.75rem;
  font-size: 0.92rem;
}

.contact-page__statement .display {
  max-width: 12em;
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
}

/* ─── CTA & footer contrast ─── */
.cta-block__contact a,
.cta-block__contact span {
  color: rgba(245, 240, 232, 0.88);
}

.site-footer__tagline {
  color: rgba(245, 240, 232, 0.65);
  line-height: 1.55;
}

.site-footer__nav a {
  color: rgba(245, 240, 232, 0.72);
}

.site-footer__nav a:hover {
  color: var(--color-gold-soft);
}

/* ─── Project metadata on light/dark ─── */
.page-hero .project-meta span {
  color: rgba(245, 240, 232, 0.82);
}

.section--charcoal .project-row__meta,
.section--charcoal-soft .project-row__meta {
  color: rgba(245, 240, 232, 0.65);
}

/* Body / lede / desc on dark surfaces — cream, not ink */
.section--charcoal .lede,
.section--charcoal .lede p,
.section--charcoal .lede--light,
.section--charcoal-soft .lede,
.section--charcoal-soft .lede p,
.section--dark .lede,
.section--dark .lede p,
.section--green-deep .lede,
.section--green-deep .lede p,
.section--accent-green .lede,
.section--accent-green .lede p,
.section--charcoal .vision-block .lede,
.section--charcoal-soft .vision-block .lede,
.section--dark .vision-block .lede {
  color: var(--champagne-soft, var(--color-light-soft));
}

.section--charcoal .project-row__desc,
.section--charcoal-soft .project-row__desc,
.section--dark .project-row__desc,
.section--green-deep .project-row__desc,
.section--accent-green .project-row__desc {
  color: var(--champagne-soft, var(--color-light-soft));
}

.section--charcoal .project-row__info h3,
.section--charcoal-soft .project-row__info h3,
.section--dark .project-row__info h3,
.section--green-deep .project-row__info h3,
.section--accent-green .project-row__info h3 {
  color: var(--color-cream);
}

/* ─── Services list ─── */
.service-item__title {
  line-height: 1.35;
}

/* ─── No fixed height traps ─── */
.section,
.vision-block,
.timeline__item,
.blog-card,
.project-card,
.contact-form {
  height: auto;
  min-height: 0;
}

/* ─── Page hero images ─── */
.page-hero__media {
  position: absolute;
  inset: 0;
  max-height: none;
  height: 100%;
  width: 100%;
}

.page-hero--short .page-hero__media {
  max-height: none;
}

.page-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

/* ─── Intro → Hero handoff (video intro owns exit timing in intro.css) ─── */
.evanour-intro.is-exiting {
  pointer-events: none;
}

/* ─── Unified radius (frames / chrome — not full-bleed hero stage) ─── */
button:not(.lightbox__close):not(.lightbox__prev):not(.lightbox__next),
.nav-btn,
.btn,
.btn--hero,
.leadership-cta,
.partner-slide,
.partner-item,
.carousel__btn,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
textarea,
select,
.gallery img,
.gallery figure,
.img-reveal:not(.hero-stage__media),
.page-hero__media,
.founder__portrait,
.contact-form input,
.contact-form textarea,
.contact-form select {
  border-radius: var(--radius, 14px);
}

.hero--stage,
.hero--stage .hero-stage__media,
.hero--stage .hero-stage__media img,
.evanour-intro,
.evanour-intro__video {
  border-radius: 0;
}

.gallery img,
.img-reveal,
.page-hero__media {
  overflow: hidden;
}

/* ─── Floating contact FAB ─── */
.contact-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: var(--z-fab, 900);
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.55rem;
}

.contact-fab__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--color-gold);
  border-radius: var(--radius, 14px);
  background: var(--color-green);
  color: var(--color-cream);
  font-family: var(--font-body, "Manrope", sans-serif);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(6, 20, 17, 0.35);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.contact-fab__toggle:hover,
.contact-fab__toggle[aria-expanded="true"] {
  background: var(--color-gold);
  color: var(--color-green-dark);
}

.contact-fab__icon {
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.3s var(--ease, ease);
}

.contact-fab__toggle[aria-expanded="true"] .contact-fab__icon {
  transform: rotate(45deg);
}

.contact-fab__panel {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 9.5rem;
}

.contact-fab__panel[hidden] {
  display: none;
}

.contact-fab__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius, 14px);
  border: 1px solid rgba(196, 165, 116, 0.55);
  background: var(--color-green-dark);
  color: var(--color-cream);
  font-family: var(--font-body, "Manrope", sans-serif);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.contact-fab__action:hover {
  background: var(--color-gold);
  color: var(--color-green-dark);
  border-color: var(--color-gold);
}

.contact-fab__action .contact-icon {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--color-cream);
}

.contact-fab__action:hover .contact-icon {
  color: var(--color-green-dark);
}

body.intro-active .contact-fab,
html.intro-active .contact-fab {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 480px) {
  .display { font-size: clamp(1.35rem, 6.5vw, 1.85rem); }
  .section-head .display { max-width: 100%; }

  .contact-fab__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .contact-fab__toggle {
    width: 3rem;
    height: 3rem;
    padding: 0;
    justify-content: center;
  }
}
