/* ==========================================================
   DESIGN TOKENS
   Change these variables to re-theme the entire site.
========================================================== */
:root {
  --color-bg: #faf9f6;
  --color-text: #14161a;
  --color-text-muted: #5c5f66;
  --color-dark: #14161a;      /* used for header/nav overlay/footer */
  --color-accent: #3d4ef0;    /* used for links, hover states, CTA */
  --color-border: #e4e2dc;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  --max-width: 1200px;
  --gutter: 24px;
}

/* ==========================================================
   RESET / BASE
========================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
}

/* Respect users who've asked for reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Visible keyboard focus outline everywhere */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Shared section width + padding */
section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 50px var(--gutter);
}

.section-heading {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 48px;
}

/* ==========================================================
   HEADER
========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
}

/* Hamburger button — three lines that animate into an X when open */
.menu-toggle {
  width: 32px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 210;
}

.menu-toggle span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 10px; }
.menu-toggle span:nth-child(3) { top: 20px; }

/* When menu is open (JS toggles this class on <body>) turn the icon into an X */
body.nav-open .menu-toggle span {
  background: #fff;
}
body.nav-open .menu-toggle span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
body.nav-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}
body.nav-open .menu-toggle span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* ==========================================================
   FULL-SCREEN NAV OVERLAY
========================================================== */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-dark);
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 120px var(--gutter) 60px;

  /* hidden by default */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

body.nav-open .nav-overlay {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-link {
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 500;
  width: fit-content;
  transition: color 0.2s ease;
}

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

.nav-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #fff;
  font-size: 18px;
}

.nav-contact a {
  transition: color 0.2s ease;
}

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

.nav-socials {
  display: flex;
  gap: 20px;
}

/* Lock page scroll while the overlay is open */
body.nav-open {
  overflow: hidden;
}

/* ==========================================================
   HERO
========================================================== */
.hero {
  padding-top: 120px;
  padding-bottom: 80px;
}

.hero h1 {
  font-size: clamp(32px, 4.5vw, 45px);
  max-width: 16ch;
}

.hero-sub {
  margin-top: 24px;
  max-width: 60ch;
  font-size: 18px;
  color: var(--color-text-muted);
}

/* ==========================================================
   PROJECT GRID (masonry-style — no row-height mismatch)
========================================================== */
.project-grid {
  column-count: 3;
  column-gap: 32px;
}

.project-card {
  display: block;
  break-inside: avoid;   /* stops a card from splitting across columns */
  margin-bottom: 32px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--color-border);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.project-card:hover {
  box-shadow: 0 16px 32px rgba(20, 22, 26, 0.08);
  transform: translateY(-2px);
}

/* Featured project now spans the FULL width as a banner,
   instead of trying to share a row with shorter cards */
.project-card--large {
  column-span: all;
}

.project-card img {
  width: 100%;
  height: auto;
  display: block;
  background: #f1f0ec;
}

.project-info {
  padding: 20px 20px 24px;
  background: #fff;
}

.project-info h3 {
  font-size: 20px;
  margin-bottom: 6px;
  color: var(--color-text);
}

.project-info p {
  font-size: 14px;
  color: var(--color-text-muted);
  max-width: 46ch;
}

/* Shows 3 newsletters as a filmstrip — each one cropped to its
   top portion instead of squished small, so nothing looks blurry
   even though newsletters themselves are very long/tall. */
.newsletter-preview {
  display: flex;
  gap: 2px;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f1f0ec;
}

.newsletter-preview__item {
  flex: 1;
  overflow: hidden;
}

.newsletter-preview__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;  /* shows the header/hero of the newsletter, not a squished full view */
  transition: transform 0.5s ease;
}

.project-card:hover .newsletter-preview__item img {
  transform: scale(1.05);
}

/* Shows 3 newsletters as a filmstrip — each one cropped to its
   top portion instead of squished small, so nothing looks blurry
   even though newsletters themselves are very long/tall. */
.newsletter-preview {
  display: flex;
  gap: 2px;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f1f0ec;
}

.newsletter-preview__item {
  flex: 1;
  overflow: hidden;
}

.newsletter-preview__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;  /* shows the header/hero of the newsletter, not a squished full view */
  transition: transform 0.5s ease;
}

.project-card:hover .newsletter-preview__item img {
  transform: scale(1.05);
}


/* ==========================================================
   ABOUT
========================================================== */
.about-content p {
  max-width: 65ch;
  font-size: 18px;
  color: var(--color-text-muted);
}

.skills-list {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skills-list li {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
}

/* ==========================================================
   CTA BAND
========================================================== */
.cta {
  max-width: none;
  background: var(--color-dark);
  color: #fff;
  text-align: left;
  padding: 100px var(--gutter);
}

.cta-inner,
.cta h2 {
  max-width: var(--max-width);
  margin: 0 auto;
}

.cta h2 {
  font-size: clamp(28px, 5vw, 48px);
  max-width: 18ch;
  margin-bottom: 32px;
}

.cta-link {
  display: inline-block;
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 20px;
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-accent);
  padding-bottom: 4px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.cta-link:hover {
  color: #fff;
  border-color: #fff;
}

/* ==========================================================
   FOOTER
========================================================== */
.site-footer {
  background: var(--color-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 40px var(--gutter);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  font-size: 14px;
}

.footer-socials {
  display: flex;
  gap: 20px;
}

.footer-socials a:hover,
.footer-inner a:hover {
  color: #fff;
}

/* ==========================================================
   PROJECT / CASE STUDY PAGE
========================================================== */
.project-hero img {
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
}

.project-intro {
  padding-bottom: 48px;
}

.project-intro h1 {
  font-size: clamp(28px, 5vw, 48px);
  max-width: 20ch;
  margin-bottom: 40px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding: 24px 0;
  margin-bottom: 32px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.project-meta span {
  display: block;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.project-meta p {
  font-size: 16px;
}

.project-body p {
  max-width: 65ch;
  font-size: 18px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

/* Gallery grid — click any item to open it in the lightbox */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
}

.gallery-item {
  border: none;
  padding: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

/* Writing samples section */
.project-docs {
  padding-top: 0;
}

.doc-link {
  display: inline-block;
  font-size: 18px;
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-accent);
  padding-bottom: 4px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.doc-link:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* Used only if you switch to the embedded Google Doc option */
.doc-embed {
  width: 100%;
  height: 800px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.project-next {
  padding-top: 0;
}

.project-next a {
  font-size: 16px;
  color: var(--color-text-muted);
}

.project-next a:hover {
  color: var(--color-text);
}

/* ==========================================================
   LIGHTBOX (full-size image viewer for the gallery)
========================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 300;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

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

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}



/* ==========================================================
   RESPONSIVE
========================================================== */
@media (max-width: 900px) {
  .project-grid {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .project-grid {
    column-count: 1;
  }
}

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .cta {
    padding: 64px var(--gutter);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

