:root {
  color-scheme: light;
  --paper: #e9e5de;
  --ink: #171714;
  --muted: #6c6963;
  --line: rgba(23, 23, 20, 0.22);
  --accent: #b33a27;
  --white: #f8f6f1;
  font-family: "Helvetica Neue", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  min-width: 320px;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 26px clamp(22px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  flex-direction: column;
  width: min-content;
  font-size: clamp(1.1rem, 2vw, 1.7rem);
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.07em;
  text-transform: uppercase;
  text-decoration: none;
}

.owner {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
}

.intro {
  min-height: min(710px, calc(100svh - 90px));
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: clamp(38px, 7vw, 100px) clamp(22px, 4vw, 64px) 36px;
}

.eyebrow {
  grid-column: 1 / -1;
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.69rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(179, 58, 39, 0.12);
}

h1 {
  grid-column: 1 / 10;
  align-self: center;
  margin: 0;
  max-width: 1100px;
  font-size: clamp(3.2rem, 8.8vw, 9.6rem);
  font-weight: 500;
  line-height: 0.86;
  letter-spacing: -0.075em;
}

h1 em {
  color: var(--accent);
  font-family: Iowan Old Style, Baskerville, "Times New Roman", serif;
  font-weight: 400;
}

.lede {
  grid-column: 9 / -1;
  align-self: end;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.82rem, 1.2vw, 1rem);
  line-height: 1.7;
}

.scroll-cue {
  grid-column: 1 / 3;
  align-self: end;
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-decoration: none;
  text-transform: uppercase;
}

.gallery-section {
  padding: 28px clamp(22px, 4vw, 64px) clamp(70px, 10vw, 150px);
  background: var(--ink);
  color: var(--white);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(248, 246, 241, 0.24);
}

.section-heading h2,
.section-heading p {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading p {
  color: rgba(248, 246, 241, 0.55);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 34px 20px;
  padding-top: clamp(36px, 5vw, 72px);
}

.project-card {
  grid-column: span 8;
  display: block;
  text-decoration: none;
}

.project-card:nth-child(even) {
  grid-column: 5 / span 8;
}

.project-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #2b2a27;
}

.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.project-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.2, 0.75, 0.25, 1), filter 700ms ease;
}

.project-index,
.view-label {
  position: absolute;
  z-index: 1;
  bottom: 18px;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-index {
  left: 20px;
}

.view-label {
  right: 20px;
  display: flex;
  gap: 9px;
  align-items: center;
}

.view-label::after {
  content: "↗";
  font-size: 0.9rem;
}

.project-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
  padding: 17px 0 0;
}

.project-meta h3,
.project-meta p {
  margin: 0;
}

.project-meta h3 {
  font-family: Iowan Old Style, Baskerville, "Songti SC", serif;
  font-size: clamp(1.45rem, 3vw, 2.8rem);
  font-weight: 400;
  line-height: 1;
}

.project-meta p {
  color: rgba(248, 246, 241, 0.52);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

.project-card:hover img,
.project-card:focus-visible img {
  transform: scale(1.025);
  filter: saturate(1.08);
}

.project-card:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 7px;
}

.loading-card,
.error-message,
.empty-message {
  grid-column: 1 / -1;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(248, 246, 241, 0.58);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.loading-line {
  width: 30px;
  height: 1px;
  background: currentColor;
  animation: breathe 1.3s ease-in-out infinite;
}

footer {
  min-height: 210px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 32px clamp(22px, 4vw, 64px);
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

@keyframes breathe {
  50% { opacity: 0.25; transform: scaleX(0.6); }
}

@media (max-width: 760px) {
  .intro {
    min-height: 700px;
    grid-template-columns: repeat(6, 1fr);
  }

  h1 {
    grid-column: 1 / -1;
    font-size: clamp(3.4rem, 17vw, 6rem);
  }

  .lede {
    grid-column: 2 / -1;
  }

  .scroll-cue {
    grid-column: 1 / 4;
  }

  .project-grid {
    display: block;
  }

  .project-card + .project-card {
    margin-top: 42px;
  }

  .project-meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .project-meta p {
    text-align: left;
  }
}

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