/* ============================================
   STEVE McINTYRE — EDITORIAL / TYPE-DRIVEN
   ============================================ */

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

:root {
  --paper: #f2efe9;
  --ink: #171511;
  --muted: #8a8378;
  --line: #d9d4ca;
  --accent: #e8490f;

  --font-sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;

  --gutter: clamp(1.25rem, 4vw, 4rem);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ---------- Micro label ---------- */
.label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Header ---------- */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--line);
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.masthead .label {
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(4rem, 12vh, 9rem) var(--gutter) clamp(4rem, 10vh, 7rem);
}

.hero__title {
  font-family: var(--font-sans);
  font-size: clamp(2.5rem, 7.5vw, 6.5rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 18ch;
  text-wrap: balance;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.hero__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero__footnote {
  margin-top: clamp(2rem, 5vh, 3.5rem);
  max-width: 38ch;
  color: var(--muted);
  font-size: clamp(0.9375rem, 1.4vw, 1.0625rem);
  line-height: 1.6;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both;
}

/* ---------- Projects ---------- */
.projects {
  flex: 1;
}

.projects__label {
  display: flex;
  justify-content: space-between;
  padding: 0 var(--gutter) 0.75rem;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.26s both;
}

.project {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto 2.5rem;
  align-items: baseline;
  gap: 1rem;
  padding: clamp(1.5rem, 3.5vh, 2.5rem) var(--gutter);
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.25s ease, color 0.25s ease;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.project:nth-of-type(1) { animation-delay: 0.32s; }
.project:nth-of-type(2) { animation-delay: 0.38s; }
.project:nth-of-type(3) { animation-delay: 0.44s; }

.project:last-of-type {
  border-bottom: 1px solid var(--line);
}

.project__index {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
  transition: color 0.25s ease;
}

.project__title {
  font-size: clamp(1.75rem, 4.5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.project__meta {
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: color 0.25s ease;
}

.project__arrow {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  justify-self: end;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.project:hover,
.project:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.project:hover .project__index,
.project:hover .project__meta,
.project:focus-visible .project__index,
.project:focus-visible .project__meta {
  color: var(--accent);
}

.project:hover .project__title {
  transform: translateX(0.5rem);
}

.project:hover .project__arrow {
  transform: translate(0.25rem, -0.25rem);
}

/* ---------- Footer ---------- */
.footer {
  padding: clamp(4rem, 10vh, 7rem) var(--gutter) 1.5rem;
}

.footer__email {
  display: inline-block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.875rem, 6vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  margin-top: 0.75rem;
  transition: color 0.25s ease;
}

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

.footer__base {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(3rem, 8vh, 5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

/* ---------- Animation ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .project {
    grid-template-columns: 2.25rem 1fr 2rem;
    grid-template-areas:
      "index title arrow"
      ".     meta  .";
    row-gap: 0.375rem;
  }

  .project__index { grid-area: index; }
  .project__title { grid-area: title; }
  .project__meta  { grid-area: meta; }
  .project__arrow { grid-area: arrow; }

  .masthead .label--location {
    display: none;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
