/* =============================================
   Andy Helms Portfolio — Global Styles
   Palette: #362c15 · #c59e3e · #f2e4d1
   Grid: 8px base
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,600;1,9..144,300;1,9..144,400;1,9..144,600&family=Inter:wght@400;500;600&family=Syne:wght@400;500;600;700;800&display=swap');

/* ─── Tokens ─────────────────────────────────── */
:root {
  --dark:  #362c15;
  --gold:  #c59e3e;
  --cream: #f2e4d1;

  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans:  'Syne', Helvetica, sans-serif;
  --font-body:  'Inter', Helvetica, sans-serif;

  /* Spacing — 8px base */
  --s1:  8px;
  --s2:  16px;
  --s3:  24px;
  --s4:  32px;
  --s5:  40px;
  --s6:  48px;
  --s8:  64px;
  --s10: 80px;
  --s12: 96px;
  --s16: 128px;

  /* Type scale — 8px base */
  --t8:  8px;
  --t16: 16px;
  --t24: 24px;
  --t32: 32px;
  --t40: 40px;
  --t48: 48px;
  --t64: 64px;

  /* Layout */
  --max-w: 1200px;
  --pad:   var(--s8);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--cream);
  color: var(--dark);
  font-family: var(--font-body);
  font-size: var(--t16);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }

/* ─── Container ──────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ─── Navigation ─────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(240, 230, 215, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dark);
}

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: var(--s8);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-sans);
  font-size: var(--t16);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--dark);
  transition: opacity 0.15s ease;
}
.nav__logo:hover { opacity: 0.6; }

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

.nav__link {
  font-family: var(--font-sans);
  font-size: var(--t16);
  font-weight: 500;
  color: var(--dark);
  opacity: 0.4;
  position: relative;
  transition: opacity 0.15s ease;
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.2s ease;
}

.nav__link:hover,
.nav__link--active {
  opacity: 1;
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

/* Mobile hamburger */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 16px;
  position: relative;
  flex-shrink: 0;
}

.nav__toggle span {
  display: block;
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--dark);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav__toggle span:nth-child(1) { top: 0; }
.nav__toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav__toggle span:nth-child(3) { bottom: 0; }

.nav__toggle.is-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── Shared hero background ─────────────────── */
.hero,
.page-hero,
.contact-hero {
  background-image: url('images/Background.jpg');
  background-size: cover;
  background-position: center;
  color: var(--cream);
}

.hero         { border-bottom-color: rgba(242, 228, 209, 0.2); }
.page-hero    { border-bottom-color: rgba(242, 228, 209, 0.2); }

/* ─── Hero (Home) ────────────────────────────── */
.hero {
  padding: var(--s16) 0 var(--s10);
  border-bottom: 1px solid rgba(242, 228, 209, 0.2);
}

.hero__eyebrow {
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.6;
  margin-bottom: var(--s3);
  animation: fadeUp 0.5s ease 0.05s both;
}

.hero__name {
  font-family: var(--font-serif);
  font-size: var(--t64);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--gold);
  margin-bottom: var(--s4);
  animation: fadeUp 0.5s ease 0.15s both;
}

.hero__bio {
  font-size: var(--t24);
  font-weight: 400;
  line-height: 1.45;
  max-width: 680px;
  color: var(--cream);
  opacity: 0.85;
  animation: fadeUp 0.5s ease 0.25s both;
}

.hero__bio a {
  color: var(--cream);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 1px;
  transition: opacity 0.15s ease;
}

.hero__bio a:hover { opacity: 0.7; }

/* ─── Section Label ──────────────────────────── */
.section-label {
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.45;
}

/* ─── Work Section ───────────────────────────── */
.work {
  padding: var(--s8) 0 var(--s16);
}

.work__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s6);
}

.work__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s4);
}

/* ─── Work Card ──────────────────────────────── */
.work-card {
  display: block;
  border: 1px solid var(--dark);
  color: var(--dark);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease;
  animation: fadeUp 0.5s ease both;
}

.work-card:nth-child(1) { animation-delay: 0.3s; }
.work-card:nth-child(2) { animation-delay: 0.4s; }
.work-card:nth-child(3) { animation-delay: 0.5s; }
.work-card:nth-child(4) { animation-delay: 0.6s; }
.work-card:nth-child(5) { animation-delay: 0.7s; }
.work-card:nth-child(6) { animation-delay: 0.8s; }

/* Odd last card spans full width */
.work-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.work-card:hover { border-color: var(--gold); }

/* Thumbnail */
.work-card__thumb {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--dark);
}

.work-card:hover .work-card__thumb { border-bottom-color: var(--gold); }

.work-card__thumb--dark  { background: var(--dark); }
.work-card__thumb--gold  { background: var(--gold); }
.work-card__thumb--cream {
  background: var(--cream);
  border-bottom: 1px solid var(--dark);
}

/* Faint project number */
.work-card__num {
  position: absolute;
  bottom: var(--s2);
  left: var(--s3);
  font-family: var(--font-serif);
  font-size: 120px;
  font-weight: 300;
  line-height: 1;
  color: white;
  opacity: 0.08;
  user-select: none;
  pointer-events: none;
  letter-spacing: -0.04em;
}

.work-card__thumb--gold  .work-card__num,
.work-card__thumb--cream .work-card__num {
  color: var(--dark);
  opacity: 0.1;
}

/* Thumbnail decoration */
.work-card__deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Hover image crossfade */
.work-card__thumb--img {
  background-image: var(--img);
  background-size: cover;
  background-position: center;
}

.work-card__thumb--img::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--img-on);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.work-card:hover .work-card__thumb--img::after {
  opacity: 1;
}

/* "VIEW →" hover tag */
.work-card__view {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  background: var(--gold);
  color: var(--dark);
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px var(--s1);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 3;
}

.work-card:hover .work-card__view {
  opacity: 1;
  transform: translateY(0);
}

/* Card info */
.work-card__info {
  padding: var(--s3);
}

.work-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s1);
}

.work-card__company {
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.45;
}

.work-card__year {
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 400;
  opacity: 0.35;
  letter-spacing: 0.05em;
}

.work-card__title {
  font-family: var(--font-serif);
  font-size: var(--t24);
  font-weight: 500;
  font-style: italic;
  line-height: 1.25;
  margin-bottom: 4px;
}

.work-card__desc {
  font-size: var(--t16);
  font-weight: 400;
  opacity: 0.55;
}

/* ─── Page Hero (inner pages) ────────────────── */
.page-hero {
  padding: var(--s8) 0;
  border-bottom: 1px solid rgba(242, 228, 209, 0.2);
}

.page-hero__back {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.5;
  margin-bottom: var(--s4);
  transition: opacity 0.15s ease;
}

.page-hero__back:hover { opacity: 1; }

.page-hero__meta {
  display: flex;
  gap: var(--s3);
  align-items: center;
  margin-bottom: var(--s3);
  flex-wrap: wrap;
}

.page-hero__tag {
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.55;
}

.page-hero__dot {
  width: 4px;
  height: 4px;
  background: var(--cream);
  opacity: 0.3;
  flex-shrink: 0;
}

.page-hero__title {
  font-family: var(--font-serif);
  font-size: var(--t48);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 720px;
  color: var(--gold);
  margin-bottom: var(--s3);
}

.page-hero__summary {
  font-size: var(--t24);
  font-weight: 400;
  line-height: 1.45;
  max-width: 600px;
  color: var(--cream);
  opacity: 0.8;
}

/* ─── Case Study Body ────────────────────────── */
.case-section {
  padding: var(--s10) 0;
  border-bottom: 1px solid rgba(54, 44, 21, 0.15);
}

.case-section:last-of-type { border-bottom: none; }

.case-section__label {
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-bottom: var(--s4);
}

.case-section__heading {
  font-family: var(--font-serif);
  font-size: var(--t32);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: var(--s3);
}

.case-section__body {
  font-size: var(--t16);
  line-height: 1.8;
  max-width: 680px;
  opacity: 0.8;
}

.case-section__body + .case-section__body {
  margin-top: var(--s2);
}

/* 3-col breakdown grid */
.case-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
  border-top: 1px solid rgba(54, 44, 21, 0.15);
}

.case-col {
  padding-top: var(--s4);
}

.case-col__label {
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-bottom: var(--s2);
}

.case-col__body {
  font-size: var(--t16);
  line-height: 1.75;
  opacity: 0.8;
}

/* Image placeholder */
.img-placeholder {
  width: 100%;
  background: rgba(54, 44, 21, 0.08);
  border: 1px solid rgba(54, 44, 21, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-placeholder--wide  { aspect-ratio: 16 / 7; }
.img-placeholder--std   { aspect-ratio: 16 / 9; }
.img-placeholder--tall  { aspect-ratio: 4 / 3; }

.img-placeholder--dark {
  background: var(--dark);
  border-color: var(--dark);
}

.img-placeholder__label {
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dark);
  opacity: 0.3;
}

.img-placeholder--dark .img-placeholder__label {
  color: var(--cream);
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s3);
  margin-top: var(--s5);
}

/* Next project link */
.case-next {
  padding: var(--s10) 0;
  border-top: 1px solid var(--dark);
}

.case-next__label {
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-bottom: var(--s2);
}

.case-next__link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-serif);
  font-size: var(--t32);
  font-weight: 500;
  font-style: italic;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}

.case-next__link:hover { border-color: var(--gold); }

/* ─── About Page ─────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--s8);
  padding: var(--s10) 0;
}

.about__body {
  font-size: var(--t16);
  line-height: 1.8;
  opacity: 0.85;
}

.about__body p + p { margin-top: var(--s3); }

.about__body strong {
  font-weight: 700;
  opacity: 1;
  color: var(--dark);
}

.about-sidebar__section {
  padding: var(--s4) 0;
  border-top: 1px solid rgba(54, 44, 21, 0.2);
}

.about-sidebar__section:first-child {
  border-top: none;
  padding-top: 0;
}

.about-sidebar__label {
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-bottom: var(--s2);
}

.about-sidebar__list {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.about-sidebar__item {
  font-size: var(--t16);
  line-height: 1.4;
}

.about-sidebar__item-sub {
  font-size: var(--t8);
  opacity: 0.45;
  margin-top: 2px;
  letter-spacing: 0.04em;
}

/* ─── Contact Page ───────────────────────────── */
.contact-hero {
  padding: var(--s16) 0 var(--s10);
  border-bottom: 1px solid rgba(242, 228, 209, 0.2);
}

.contact-hero__heading {
  font-family: var(--font-serif);
  font-size: var(--t64);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--gold);
  margin-bottom: var(--s4);
}

.contact-hero__intro {
  font-size: var(--t24);
  font-weight: 400;
  line-height: 1.45;
  max-width: 540px;
  color: var(--cream);
  opacity: 0.8;
  margin-bottom: var(--s8);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  max-width: 540px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: var(--s3);
  border: 1px solid var(--dark);
  padding: var(--s3) var(--s4);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.contact-link:hover {
  border-color: var(--gold);
  background: rgba(197, 158, 62, 0.05);
}

.contact-link__label {
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.4;
  min-width: 64px;
}

.contact-link__value {
  flex: 1;
  font-size: var(--t16);
  font-weight: 500;
}

.contact-link__arrow {
  font-size: var(--t16);
  opacity: 0.3;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.contact-link:hover .contact-link__arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* ─── Video Embed ────────────────────────────── */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(54, 44, 21, 0.15);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ─── Footer ─────────────────────────────────── */
.footer {
  border-top: 1px solid var(--dark);
  padding: var(--s6) 0;
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__copy {
  font-family: var(--font-sans);
  font-size: var(--t8);
  opacity: 0.35;
  letter-spacing: 0.06em;
}

.footer__links {
  display: flex;
  gap: var(--s4);
}

.footer__link {
  font-family: var(--font-sans);
  font-size: var(--t8);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

.footer__link:hover { opacity: 1; }

/* ─── Animations ─────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 1024px) {
  :root { --pad: var(--s5); }

  .about-grid {
    grid-template-columns: 1fr 300px;
    gap: var(--s6);
  }
}

@media (max-width: 768px) {
  :root { --pad: var(--s3); }

  /* Nav */
  .nav__links {
    display: none;
    position: absolute;
    top: var(--s8);
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--dark);
    flex-direction: column;
    padding: var(--s3);
    gap: var(--s3);
    z-index: 99;
  }

  .nav__links.is-open { display: flex; }
  .nav__toggle { display: flex; flex-direction: column; justify-content: space-between; }

  /* Hero */
  .hero { padding: var(--s8) 0; }
  .hero__name { font-size: var(--t48); }
  .hero__bio { font-size: var(--t16); }

  /* Work grid */
  .work__grid { grid-template-columns: 1fr; }

  /* Page hero */
  .page-hero__title { font-size: var(--t40); }
  .page-hero__summary { font-size: var(--t16); }

  /* Case study */
  .case-cols { grid-template-columns: 1fr; }
  .img-grid { grid-template-columns: 1fr; }
  .img-pair { flex-direction: column; align-items: center; }
  .img-pair > div { max-width: 100% !important; }
  .three-col { flex-wrap: wrap; }
  .three-col > .three-col__text { flex: 0 0 100% !important; }
  .three-col > .three-col__img { flex: 1 1 calc(50% - var(--s5)); }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--s5);
    padding: var(--s8) 0;
  }

  /* Contact */
  .contact-hero { padding: var(--s8) 0; }
  .contact-hero__heading { font-size: var(--t48); }
  .contact-hero__intro { font-size: var(--t16); }

  /* Footer */
  .footer__inner {
    flex-direction: column;
    gap: var(--s3);
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  :root { --pad: var(--s2); }

  .hero__name { font-size: var(--t40); }
  .page-hero__title { font-size: var(--t32); }
  .contact-hero__heading { font-size: var(--t40); }
  .work-card__title { font-size: var(--t16); }
  .case-next__link { font-size: var(--t24); }
}
