/* ============================================================
   Stuart Allen — base styles
   Quiet, centered, image-forward. Type: Inter (approximating
   the spaced, light treatment of the reference).
   ============================================================ */

/* ---------- Fonts: Inter (self-hosted, SIL OFL) ----------
   Variable fonts: every weight 100–900, upright + true italic.
   Files in /css/fonts/. Browsers download only the files a page needs. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/css/fonts/inter-latin-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/css/fonts/inter-latin-ext-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/css/fonts/inter-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/css/fonts/inter-latin-ext-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #444444;          /* site copy: dark grey */
  --ink-soft: #5c5c5c;     /* one step lighter: testimonials */
  --paper: #ffffff;
  --muted: #7a7a7a;
  --hairline: #e6e6e6;
  --measure: 59.375rem;    /* reading column width (950px) */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --nav-h: 4.5rem;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }


/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}

/* Inner row shares the Work grid's width, so logo and nav line up with its edges */
.header-inner {
  position: relative;
  max-width: calc(950px + 2 * var(--gutter));
  min-height: var(--nav-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav {
  display: flex;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.site-nav a {
  text-decoration: none;
  font-weight: 300;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: var(--ink);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a.is-current {
  border-bottom-color: var(--ink);
}

/* Logo — text wordmark; left on desktop, centered on mobile.
   Caps via text-transform so the template text stays "Stuart Allen". */
.site-logo {
  display: block;
  text-decoration: none;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  position: absolute;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--ink);
  margin: 4px 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* ---------- Work grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter);
  max-width: calc(950px + 2 * var(--gutter));
  margin: 0 auto;
}

.grid-item {
  position: relative;
  text-decoration: none;
  display: block;
}

.grid-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f2f2f2;
}
.grid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.grid-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(45deg, #eee, #eee 10px, #e4e4e4 10px, #e4e4e4 20px);
}

/* Title revealed on hover (desktop) */
.grid-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.grid-place { display: block; color: var(--muted); }
.grid-place::before { content: "("; }
.grid-place::after { content: ")"; }

.grid-item:hover .grid-label,
.grid-item:focus .grid-label {
  opacity: 1;
}

/* ---------- Project page ---------- */
.project,
.text-page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--gutter) 6rem;
  text-align: center;
}
.project { max-width: calc(950px + 2 * var(--gutter)); }
.text-page .project-close { display: none; }  /* no X on About/Contact */

.project-close {
  position: fixed;
  top: calc(var(--nav-h) + 1.25rem);
  right: max(var(--gutter), calc((100% - 950px) / 2));   /* matches grid right edge */
  z-index: 90;
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  color: var(--muted);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.project-close:hover,
.project-close:focus {
  background: rgba(255, 255, 255, 0.9);
}

.project-header { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }

.project-title {
  font-weight: 400;
  font-size: clamp(0.85rem, 1.8vw, 1.15rem);
  letter-spacing: 0.02em;
}
.project-place { color: var(--muted); font-weight: 300; }
.project-place::before { content: "| "; }

.project-image { margin: clamp(1.5rem, 4vw, 2.5rem) 0; }

/* Text below the first image spans the full image width, left-aligned */
.project-meta,
.project-description,
.project-credits {
  text-align: left;
  font-size: 0.85rem;
  color: var(--ink);
}

.project-meta { margin-top: clamp(1.5rem, 4vw, 2.5rem); }
.project-meta div { display: flex; gap: 1rem; }
.project-meta div + div { margin-top: 0.2rem; }
.project-meta dt { flex: 0 0 6.5rem; color: var(--muted); }

.project-description { margin: 1.5rem 0 clamp(1.5rem, 4vw, 2.5rem); }
.project-description p + p { margin-top: 1em; }
.description-title { font-weight: 600; color: var(--ink); }

.project-credits { margin-top: 1.5rem; }
.project-credits h2 {
  font-size: inherit;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.project-credits ul { list-style: none; }
.project-credits li + li { margin-top: 0.2rem; }
.credit-role { color: var(--muted); }
.project-credits a {
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}
.project-credits a:hover { border-bottom-color: var(--ink); }

/* ---------- Text pages (About / Contact) ---------- */
.text-body {
  max-width: 38rem;
  margin: 0 auto;
  text-align: left;
  font-size: 0.85rem;   /* matches .project-description */
}
.text-body p + p { margin-top: 1.25rem; }

/* About: photo above the copy, centered */
.about-photo {
  width: 325px;
  max-width: 100%;
  margin: 0 auto clamp(2rem, 6vw, 4rem);   /* centered; bottom = .text-page top padding */
}

/* About: small grey separator, then testimonials (one blank line = 1.5em) */
.text-rule {
  width: 80px;
  margin: 1.5em auto;
  border: 0;
  border-top: 1px solid var(--muted);
}
.testimonial { color: var(--ink-soft); }
.testimonial + .testimonial { margin-top: 1.5em; }
.testimonial p + p { margin-top: 0; }   /* credit sits directly under the quote */
.testimonial-quote { font-style: italic; }

.contact-services ul { list-style: none; margin-top: 1.5rem; }
.contact-services li + li { margin-top: 1em; }
.service-name { font-weight: 500; }

.contact-body { text-align: center; }
.contact-body p + p { margin-top: 0; }               /* phone lines: single-spaced */
.contact-body p:first-child + p { margin-top: 1.5em; }   /* one blank line after email */
.contact-body a {
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}
.contact-body a:hover { border-bottom-color: var(--ink); }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .header-inner { justify-content: center; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--hairline);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s;
  }
  body.nav-open .site-nav { visibility: visible; opacity: 1; }

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

  /* On touch devices there is no hover — show titles beneath thumbnails */
  .grid-label {
    position: static;
    opacity: 1;
    background: none;
    padding: 0.5rem 0 0;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    font-size: 0.8rem;
  }
  .grid-place {
    font-size: 0.75rem;
  }
  .grid-place::before, .grid-place::after { content: ""; }   /* no parens on mobile */
  .grid-thumb { aspect-ratio: 1 / 1; }

  /* Individual project pages: Place drops to its own line, no pipe */
  .project-place {
    display: block;
    margin-top: 0.25rem;
  }
  .project-place::before { content: ""; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
