/* ============================================================
   Michael Haythornthwaite — Design
   Light, warm, editorial. One clean grotesque (Inter).
   ============================================================ */

:root {
  --bg: #ece9e2;
  --bg-soft: #e4e0d7;
  --fg: #17150f;
  --muted: #767165;
  --line: rgba(23, 21, 15, 0.14);
  --accent: #b4541f; /* warm rust, used sparingly */

  --maxw: 100%;
  --pad: clamp(1.5rem, 5vw, 4.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Shows through the iPhone safe areas / overscroll as black */
  background: #0d0d0c;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

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

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* Masked text reveal — transform only; overflow clip does the masking */
.reveal-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.reveal-word > * {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--ease);
}
.reveal-word.in > * {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-word > * {
    opacity: 1 !important;
    transform: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: calc(1.1rem + env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right))
    1.1rem max(var(--pad), env(safe-area-inset-left));
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
    color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
  color: #fff; /* sits over the hero imagery by default */
}
.nav.scrolled {
  background: rgba(236, 233, 226, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}
.nav__brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.nav__name {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}
.nav__sub {
  font-size: 0.72rem;
  opacity: 0.7;
}
.nav__links {
  display: flex;
  gap: 2.25rem;
}
.nav__links a {
  position: relative;
  font-size: 0.9rem;
  color: inherit;
  opacity: 0.85;
  transition: opacity 0.25s;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 1px;
  width: 0;
  background: currentColor;
  transition: width 0.3s var(--ease);
}
.nav__links a:hover {
  opacity: 1;
}
.nav__links a:hover::after {
  width: 100%;
}
.nav__time {
  font-size: 0.78rem;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

/* ---------- Hero (full-bleed) ---------- */
.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
}
.hero__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.6s var(--ease);
}
.hero__bg img.is-active {
  opacity: 1;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 13, 9, 0.5) 0%,
    rgba(15, 13, 9, 0.25) 20%,
    rgba(15, 13, 9, 0.32) 45%,
    rgba(15, 13, 9, 0.88) 100%
  );
}
.hero__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 7rem var(--pad)
    calc(clamp(2rem, 4vh, 3.25rem) + env(safe-area-inset-bottom));
  color: #f5f2ec;
}
.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.9rem;
  color: rgba(245, 242, 236, 0.85);
  margin-bottom: 1.25rem;
}
.line {
  display: inline-block;
  width: 2.5rem;
  height: 1px;
  background: var(--accent);
}
.hero__title {
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.9;
  font-size: clamp(2.6rem, 9vw, 10rem);
  color: rgba(245, 242, 236, 0.6);
}
.hero__title .reveal-word {
  display: block;
}

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  align-items: flex-end;
  justify-content: space-between;
  border-top: 1px solid rgba(245, 242, 236, 0.28);
  padding-top: 1.75rem;
  margin-top: clamp(2rem, 5vh, 3.5rem);
}
.hero__intro {
  max-width: 32rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  color: rgba(245, 242, 236, 0.92);
}
.hero__meta {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.9rem;
  color: rgba(245, 242, 236, 0.75);
}
.hero__cue {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #f5f2ec;
  transition: color 0.25s;
}
.hero__cue span {
  transition: transform 0.3s var(--ease);
}
.hero__cue:hover {
  color: var(--accent);
}
.hero__cue:hover span {
  transform: translateY(4px);
}

/* ---------- Generic section ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 10rem) var(--pad);
}
.section--about {
  background: var(--bg-soft);
  max-width: none;
}
.section--about > * {
  max-width: var(--maxw);
  margin-inline: auto;
}
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.75rem;
  margin-bottom: 3.5rem;
}
.section__head h2 {
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  font-size: clamp(2rem, 5vw, 4.5rem);
}
.section__label {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Work list ---------- */
.work {
  list-style: none;
}
.work__item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 1.5rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.45s var(--ease);
}
.work__item:hover {
  padding-left: 1rem;
  padding-right: 1rem;
}
.work__no {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.work__brand {
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: color 0.3s;
}
.work__item:hover .work__brand {
  color: var(--accent);
}
.work__role {
  font-size: 0.9rem;
  color: var(--fg);
  opacity: 0.8;
}
.work__era {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
  min-width: 7rem;
}
.work__note {
  max-width: 42rem;
  margin-top: 3rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
}
.about__body p {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 1.4rem;
}
.about__lead {
  font-size: clamp(1.25rem, 2vw, 1.6rem) !important;
  line-height: 1.5 !important;
  color: var(--fg) !important;
  margin-bottom: 2rem !important;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2.25rem;
}
.stat__value {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.stat__label {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}
.about__exp-title {
  margin: 2.5rem 0 1.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 500;
}
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.tags li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--fg);
  opacity: 0.85;
  transition: border-color 0.25s, color 0.25s;
}
.tags li:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

/* ---------- Contact ---------- */
.contact {
  padding: clamp(4rem, 9vw, 7rem) var(--pad)
    calc(2rem + env(safe-area-inset-bottom));
  overflow: hidden;
}
.contact__marquee {
  overflow: hidden;
  white-space: nowrap;
  margin-bottom: clamp(3rem, 8vw, 6rem);
  user-select: none;
}
.contact__track {
  display: inline-flex;
  animation: marquee 28s linear infinite;
}
.contact__track span {
  font-size: clamp(3rem, 11vw, 11rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: rgba(23, 21, 15, 0.08);
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}
.contact__grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: start;
}
.contact__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.contact__email {
  display: inline-block;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
}
.contact__email::after {
  content: "";
  display: block;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.5s var(--ease);
}
.contact__email:hover::after {
  width: 100%;
}
.contact__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.contact__details h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
}
.contact__details a:hover {
  color: var(--accent);
}
.contact__bar {
  max-width: var(--maxw);
  margin: clamp(4rem, 8vw, 6rem) auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.contact__top {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.contact__top span {
  transition: transform 0.3s var(--ease);
}
.contact__top:hover {
  color: var(--accent);
}
.contact__top:hover span {
  transform: translateY(-4px);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about {
    grid-template-columns: 1fr;
  }
  .contact__grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .nav__links {
    display: none;
  }
  .work__item {
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
  }
  .work__no {
    grid-row: 1;
  }
  .work__role,
  .work__era {
    grid-column: 2;
    text-align: left;
    min-width: 0;
  }
}
