/* ============================================================
   CHET YEARY II — Shared Site Styles
   Unified styles for homepage, work, about, photography, and case studies
   ============================================================ */

/* ------------------------------
   TOKENS
--------------------------------- */
:root {
  --bg: #f3ede3;
  --bg-alt: #ede7dc;
  --surface: #f8f4ed;
  --text: #1a1918;
  --text-muted: #6a6158;
  --text-faint: #a89f96;
  --rule: #d4cbbe;
  --border: #c8c0b4;

  --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.82rem + 0.25vw, 0.95rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.55vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.1vw, 2.1rem);
  --text-2xl: clamp(2rem, 1.35rem + 2vw, 3.2rem);
  --text-hero: clamp(2.75rem, 0.8rem + 5vw, 6rem);

  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Switzer', 'Helvetica Neue', sans-serif;

  --ease: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-slow: 480ms cubic-bezier(0.16, 1, 0.3, 1);

  --max-w: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

[data-theme='dark'] {
  --bg: #111009;
  --bg-alt: #181610;
  --surface: #1c1a14;
  --text: #e6e1d8;
  --text-muted: #9e988f;
  --text-faint: #5a5650;
  --rule: #2a2720;
  --border: #333028;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #111009;
    --bg-alt: #181610;
    --surface: #1c1a14;
    --text: #e6e1d8;
    --text-muted: #9e988f;
    --text-faint: #5a5650;
    --rule: #2a2720;
    --border: #333028;
  }
}

/* ------------------------------
   RESET / BASE
--------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--ease);
}

a:hover {
  color: var(--text-muted);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  line-height: 1.1;
}

p,
li {
  text-wrap: pretty;
}

::selection {
  background: color-mix(in srgb, var(--text) 15%, transparent);
  color: var(--text);
}

:focus-visible {
  outline: 1.5px solid var(--text-muted);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------
   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-width: 0;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ------------------------------
   NAVIGATION
--------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--space-8);
}

.nav__logo {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--text);
}

.nav__logo span {
  font-style: italic;
  font-weight: 400;
  font-size: 0.95em;
  color: var(--text-muted);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav__links a {
  padding-block: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav__links a:hover,
.nav__links a[aria-current='page'] {
  color: var(--text);
}

.nav__links a[aria-current='page'] {
  border-bottom: 1px solid currentColor;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav__toggle,
.nav__mobile-btn {
  display: flex;
  align-items: center;
  padding: var(--space-2);
  color: var(--text-muted);
}

.nav__toggle:hover,
.nav__mobile-btn:hover {
  color: var(--text);
}

.nav__mobile-btn {
  display: none;
}

.nav__mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-10);
  background: var(--bg);
}

.nav__mobile-menu.is-open {
  display: flex;
}

.nav__mobile-menu a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--text);
}

.nav__mobile-close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  color: var(--text-muted);
  font-size: 1.5rem;
}

@media (max-width: 700px) {
  .nav__links {
    display: none;
  }

  .nav__mobile-btn {
    display: flex;
  }
}

/* ------------------------------
   SECTION WRAPPERS
--------------------------------- */
.section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
}

.section__link {
  white-space: nowrap;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ------------------------------
   PAGE HEADERS
--------------------------------- */
.work-header,
.photo-header,
.page-intro {
  margin-bottom: var(--space-16);
  padding-block: clamp(var(--space-12), 5vw, var(--space-24));
  border-bottom: 1px solid var(--rule);
}

.work-header__title,
.photo-header__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  color: var(--text);
}

.work-header__sub {
  max-width: 48ch;
  margin-top: var(--space-6);
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--text-muted);
}

.photo-header__label {
  margin-bottom: var(--space-5);
}

.photo-header__title {
  margin-bottom: var(--space-8);
}

.photo-header__body {
  max-width: 52ch;
}

.photo-header__body p {
  margin-bottom: var(--space-5);
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--text-muted);
}

/* ------------------------------
   WORK GRID / CARDS
--------------------------------- */
.work-section {
  padding-bottom: clamp(var(--space-16), 6vw, var(--space-24));
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(var(--space-10), 3vw, var(--space-16));
  align-items: start;
}

.work-grid--2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .work-grid,
  .work-grid--2col {
    grid-template-columns: 1fr;
  }
}

.work-card,
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.work-card__link,
.card a {
  display: block;
}

.work-card__img-wrap,
.card__image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
}

.work-card__img,
.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--ease-slow);
}

.work-card:hover .work-card__img,
.card:hover .card__image img {
  transform: scale(1.015);
}

.work-card__body,
.card__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.work-card__tags,
.card__tags {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  line-height: 1.6;
}

.work-card__title,
.card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.08;
  color: var(--text);
  transition: color var(--ease);
}

.work-card__desc,
.card__desc {
  max-width: 44ch;
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--text-muted);
}

.work-card:hover .work-card__title,
.card:hover .card__title {
  color: var(--text);
}

/* ------------------------------
   FOOTER
--------------------------------- */
.footer {
  padding-block: var(--space-12);
  border-top: 1px solid var(--rule);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.footer__left {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: 600;
  color: var(--text);
}

.footer__tagline {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
}

.footer__links a {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer__copy {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--rule);
  font-size: var(--text-xs);
  color: var(--text-faint);
}

/* ------------------------------
   ABOUT PAGE
--------------------------------- */
.about-page {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.about-page__header {
  margin-bottom: var(--space-16);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--rule);
}

.about-page__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  color: var(--text);
}

.about-page__bio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: clamp(var(--space-12), 6vw, var(--space-24));
  align-items: start;
  margin-bottom: var(--space-20);
}

.about-page__bio-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.about-page__bio-text p {
  max-width: 60ch;
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--text-muted);
}

.about-page__bio-text p em {
  font-family: var(--font-display);
  font-size: 1.1em;
  font-style: italic;
  color: var(--text);
}

.about-page__portrait {
  position: sticky;
  top: 84px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--bg-alt);
}

.about-page__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.about-page__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  transition: color var(--ease), gap var(--ease);
}

.about-page__cta:hover {
  gap: var(--space-5);
  color: var(--text-muted);
}

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

  .about-page__portrait {
    position: static;
    aspect-ratio: auto;
    overflow: visible;
  }

  .about-page__portrait img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center top;
  }
}

/* ------------------------------
   CAPABILITIES
--------------------------------- */
.capabilities {
  margin-block: var(--space-20);
  padding-block: var(--space-20);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.capabilities__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-10) var(--space-12);
  margin-top: var(--space-12);
}

.capability__label {
  margin-bottom: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
}

.capability__text {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-muted);
}

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

/* ------------------------------
   TIMELINE
--------------------------------- */
.timeline {
  margin-block: var(--space-20);
}

.timeline__item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-8);
  padding-block: var(--space-8);
  border-bottom: 1px solid var(--rule);
}

.timeline__years {
  padding-top: 4px;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.timeline__role {
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
}

.timeline__company {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.timeline__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.timeline__tag {
  padding: 3px var(--space-3);
  background: var(--bg-alt);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

@media (max-width: 600px) {
  .timeline__item {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

/* ------------------------------
   CASE STUDY
--------------------------------- */
.case-study__hero {
  height: clamp(300px, 50vw, 560px);
  overflow: hidden;
  background: var(--bg-alt);
}

.case-study__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.case-study__header {
  padding-block: var(--space-16);
  border-bottom: 1px solid var(--rule);
}

.case-study__title {
  margin-bottom: var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text);
}

.case-study__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin-top: var(--space-8);
}

.case-study__meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.case-study__meta-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.case-study__meta-value {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.case-study__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  max-width: 720px;
  margin-inline: auto;
  padding-block: var(--space-20);
}

.case-study__section-title {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.case-study__section-title::before {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 24px;
  height: 1px;
  background: var(--rule);
}

.case-study__text p {
  margin-bottom: var(--space-6);
  font-size: var(--text-base);
  line-height: 1.85;
  color: var(--text-muted);
}

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

.case-study__text strong {
  color: var(--text);
  font-weight: 600;
}

.case-study__sub-section {
  margin-top: var(--space-8);
}

.case-study__sub-title {
  margin-bottom: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
}

.case-study__outcomes {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-10);
  border: 1px solid var(--rule);
  background: var(--bg-alt);
}

.case-study__outcome-item {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-muted);
}

.case-study__outcome-item::before {
  content: '—';
  flex-shrink: 0;
  color: var(--text-faint);
}

.case-study__takeaways {
  padding-top: var(--space-10);
  border-top: 1px solid var(--rule);
}

.case-study__takeaway {
  display: flex;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-muted);
}

.case-study__takeaway::before {
  content: '→';
  flex-shrink: 0;
  color: var(--text-faint);
}

.case-study__nav {
  padding-block: var(--space-10);
  border-top: 1px solid var(--rule);
}

.case-study__nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.case-study__nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--ease), gap var(--ease);
}

.case-study__nav a:hover {
  color: var(--text);
}

/* ------------------------------
   PHOTOGRAPHY GRID
--------------------------------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(var(--space-5), 2vw, var(--space-8));
  margin-bottom: var(--space-20);
}

.photo-grid__item {
  overflow: hidden;
  background: var(--bg-alt);
}

.photo-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--ease-slow);
}

.photo-grid__item:hover img {
  transform: scale(1.02);
}

.photo-grid__item--tall { aspect-ratio: 3 / 4; }
.photo-grid__item--wide { aspect-ratio: 4 / 3; }
.photo-grid__item--sq { aspect-ratio: 1 / 1; }
.photo-grid__item--span2 { grid-column: span 2; aspect-ratio: 16 / 9; }

@media (max-width: 768px) {
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-grid__item--span2 {
    grid-column: span 1;
  }
}

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

.photo-instagram {
  padding-block: var(--space-12);
  border-top: 1px solid var(--rule);
  text-align: center;
}

.photo-instagram a {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ------------------------------
   CONTACT
--------------------------------- */
.contact-section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
  border-top: 1px solid var(--rule);
  background: var(--surface);
}

.contact-section__inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(var(--space-12), 6vw, var(--space-24));
  align-items: start;
}

.contact-section__headline {
  margin-bottom: var(--space-8);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

.contact-section__body {
  margin-bottom: var(--space-8);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-muted);
}

.contact-section__email {
  display: inline-block;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--text);
}

.contact-section__socials {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.contact-section__social-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.contact-section__social-name {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

@media (max-width: 700px) {
  .contact-section__inner {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------
   FADE-UP
--------------------------------- */
.fade-up {
  transition:
    opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.js-loaded .fade-up {
  opacity: 0;
  transform: translateY(24px);
}

.js-loaded .fade-up.is-visible {
  opacity: 1;
  transform: none;
}
