/* ============================================================
   Noah Livingston — noahlivingston.com
   Modern editorial system: paper ground, ink type, crimson accent
   ============================================================ */

:root {
  --paper: #f7f6f2;
  --paper-raised: #ffffff;
  --ink: #141416;
  --ink-soft: #2c2c30;
  --muted: #6d6d74;
  --line: #e2e0d7;
  --accent: #c0142f;
  --accent-dark: #9c0f26;

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

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

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

::selection { background: var(--accent); color: #fff; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ── Typography ─────────────────────────────── */

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

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

/* ── Header ─────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 246, 242, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.site-header.scrolled { border-bottom-color: var(--line); }

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.site-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.site-logo .mark {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--accent);
  border-radius: 50%;
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.site-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
  position: relative;
  padding: 0.25rem 0;
}

.site-nav a:hover { color: var(--ink); }

.site-nav a.active { color: var(--ink); }

.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
}

.site-nav .nav-cta {
  color: var(--paper);
  background: var(--ink);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  transition: background 0.2s;
}

.site-nav .nav-cta:hover { background: var(--accent); color: #fff; }
.site-nav .nav-cta.active::after { display: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 110;
}

.nav-toggle span {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}

@media (max-width: 760px) {
  /* backdrop-filter would make the header the containing block for the
     fixed-position nav overlay, trapping it inside the header bar */
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--paper);
  }

  .nav-toggle { display: block; }

  .site-nav {
    position: fixed;
    inset: 0;
    background: var(--paper);
    flex-direction: column;
    justify-content: center;
    gap: 2.25rem;
    transform: translateY(-100%);
    transition: transform 0.4s var(--ease);
  }

  .site-nav.open { transform: translateY(0); }

  .site-nav a { font-size: 1.5rem; font-family: var(--font-display); }

  body.nav-locked { overflow: hidden; }

  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ── Hero ───────────────────────────────────── */

.hero { padding: clamp(4rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 5.5rem); }

.hero__title {
  font-size: clamp(2.4rem, 6.2vw, 4.75rem);
  font-weight: 500;
  max-width: 18ch;
  margin-bottom: 1.75rem;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__subtitle {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.65;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  margin-top: 2.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero__meta span { display: flex; align-items: center; gap: 0.5rem; }

.hero__meta .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Stat band ──────────────────────────────── */

.stat-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2.25rem 0;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.stat-band .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.stat h3 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

@media (max-width: 760px) {
  .stat-band .container { grid-template-columns: repeat(2, 1fr); }
}

/* ── Section headings ───────────────────────── */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-head h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
}

.section-head .count {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--muted);
}

/* ── Project grid ───────────────────────────── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: clamp(4rem, 8vw, 6rem);
}

.project-card {
  text-decoration: none;
  display: block;
  group: card;
}

.project-card__frame {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 4 / 3;
  background: var(--ink);
}

.project-card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease), opacity 0.4s;
}

.project-card:hover .project-card__frame img {
  transform: scale(1.045);
}

.project-card__index {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: #fff;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(6px);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}

.project-card__body { padding-top: 1.15rem; }

.project-card__title {
  font-size: 1.375rem;
  display: inline;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.4s var(--ease);
}

.project-card:hover .project-card__title { background-size: 100% 2px; }

.project-card__meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

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

/* ── Dark CTA band ──────────────────────────── */

.cta-band {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(4rem, 9vw, 7rem) 0;
}

.cta-band .eyebrow { color: var(--accent); }

.cta-band h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  max-width: 20ch;
  margin-bottom: 1.5rem;
}

.cta-band p {
  color: #a8a8ad;
  max-width: 52ch;
  margin-bottom: 2.5rem;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; }

.btn {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }

.btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--paper);
}
.btn--ghost:hover { border-color: #fff; }

.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--accent); color: #fff; }

.btn--outline {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper-raised);
}
.btn--outline:hover { border-color: var(--ink); }

/* ── Footer ─────────────────────────────────── */

.site-footer {
  background: var(--ink);
  color: #a8a8ad;
  border-top: 1px solid #26262a;
  padding: 2rem 0;
  font-size: 0.9rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.footer-links a {
  text-decoration: none;
  color: #a8a8ad;
  transition: color 0.2s;
}

.footer-links a:hover { color: #fff; }

/* ── Case study pages ───────────────────────── */

.case-hero { padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color 0.2s;
}

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

.case-hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  max-width: 20ch;
  margin-bottom: 1.5rem;
}

.case-hero .lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 62ch;
  line-height: 1.65;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.75rem 0;
  margin: clamp(2rem, 5vw, 3.5rem) 0;
}

.case-meta dt {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.case-meta dd { font-size: 0.975rem; font-weight: 500; }

@media (max-width: 760px) {
  .case-meta { grid-template-columns: repeat(2, 1fr); }
}

.case-figure {
  margin: clamp(2rem, 5vw, 3.5rem) 0;
  border-radius: 4px;
  overflow: hidden;
}

.case-figure img { width: 100%; }

.case-body { max-width: 720px; padding-bottom: clamp(3rem, 6vw, 5rem); }

.case-body h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  margin: 2.75rem 0 1rem;
}

.case-body h3 {
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
}

.case-body p + p { margin-top: 1.1rem; }

.case-body ul { padding-left: 1.25rem; margin-top: 1rem; }
.case-body li + li { margin-top: 0.5rem; }

.pull-quote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2.5rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* Typographic specimen panel (stands in for artifact imagery) */
.spec-panel {
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  padding: clamp(2rem, 5vw, 3.5rem);
  margin: 2.5rem 0;
}

.spec-panel .eyebrow { margin-bottom: 1rem; }

.spec-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.spec-panel__grid h4 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.spec-panel__grid p { font-size: 0.85rem; color: #a8a8ad; line-height: 1.55; }

.spec-panel > p { color: #cfcfd3; max-width: 58ch; }

/* Case study artifact galleries */
.case-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 2.5rem 0;
  align-items: start;
}

.case-gallery figure {
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper-raised);
  border: 1px solid var(--line);
}

.case-gallery img { width: 100%; }

.case-gallery figure.tall img {
  max-height: 600px;
  width: auto;
  margin: 0 auto;
}

.case-gallery figcaption,
.case-figure figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
}

.case-figure figcaption { border-top: 0; padding: 0.7rem 0 0; }

.case-gallery .span-2 { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .case-gallery { grid-template-columns: 1fr; }
}

/* Video request panel */
.video-panel {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  margin: 2.5rem 0;
  background: var(--ink);
  color: var(--paper);
}

.video-panel img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  opacity: 0.45;
}

.video-panel__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.85rem;
  padding: 1.5rem;
}

.video-panel__play {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-panel__play::after {
  content: "";
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}

.video-panel__overlay h3 { font-size: 1.2rem; }
.video-panel__overlay p { font-size: 0.9rem; color: #cfcfd3; max-width: 40ch; }

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  margin: 2.5rem 0;
}

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

/* Next-project footer nav */
.case-next {
  border-top: 1px solid var(--line);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.case-next a {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.case-next .label {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.case-next h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  transition: color 0.2s;
}

.case-next a:hover h2 { color: var(--accent); }

.case-next .arrow {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  color: var(--accent);
  transition: transform 0.3s var(--ease);
}

.case-next a:hover .arrow { transform: translateX(8px); }

/* ── Photography ────────────────────────────── */

.photo-intro { padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(1.5rem, 3vw, 2.5rem); }

.photo-intro h1 {
  font-size: clamp(2.4rem, 6vw, 4.25rem);
  margin-bottom: 1.25rem;
}

.photo-intro p { color: var(--muted); max-width: 52ch; }

.photo-grid {
  columns: 3;
  column-gap: 1.25rem;
  padding-bottom: clamp(4rem, 8vw, 6rem);
}

.photo-grid figure {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}

.photo-grid img {
  width: 100%;
  transition: transform 0.7s var(--ease);
}

.photo-grid figure:hover img { transform: scale(1.03); }

@media (max-width: 900px) { .photo-grid { columns: 2; } }
@media (max-width: 560px) { .photo-grid { columns: 1; } }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 12, 14, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lightbox.active { opacity: 1; pointer-events: auto; }

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 4px;
}

.lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox__close:hover { opacity: 1; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 1rem;
}

.lightbox__nav:hover { opacity: 1; }
.lightbox__nav--prev { left: 0.5rem; }
.lightbox__nav--next { right: 0.5rem; }

/* ── About ──────────────────────────────────── */

.about-layout {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  align-items: start;
}

.about-side { position: sticky; top: 6.5rem; }

.about-side img {
  border-radius: 4px;
  filter: grayscale(1);
}

.about-side .contact-card {
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: 4px;
  padding: 1.5rem;
}

.contact-card h3 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.contact-card p {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.contact-card a {
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.contact-card a:hover { color: var(--accent); }

.contact-card .btn { margin-top: 1rem; width: 100%; justify-content: center; }

.about-content h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  margin-bottom: 1.75rem;
  max-width: 22ch;
}

.about-content > p {
  margin-bottom: 1.2rem;
  max-width: 66ch;
}

.about-content h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  margin: 3rem 0 1.25rem;
}

@media (max-width: 860px) {
  .about-layout { grid-template-columns: 1fr; }
  .about-side { position: static; max-width: 380px; }
}

/* Experience timeline */
.timeline { border-top: 1px solid var(--line); }

.timeline__item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline__years {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.timeline__body h3 { font-size: 1.15rem; margin-bottom: 0.2rem; }

.timeline__body .org {
  font-size: 0.925rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.timeline__body p { font-size: 0.975rem; color: var(--ink-soft); max-width: 60ch; }

@media (max-width: 560px) {
  .timeline__item { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.skill-block {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: 4px;
  padding: 1.5rem;
}

.skill-block h3 { font-size: 1rem; margin-bottom: 0.6rem; }

.skill-block p { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

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

/* ── Reveal animations ──────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.in { opacity: 1; transform: none; }

.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .project-card__frame img,
  .photo-grid img { transition: none; }
}
