/* Ultira — initial visual system */

.portfolio-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(5, auto);
  gap: 1.5rem 1rem;
  width: 100%;
}

@media (max-width: 760px) {
  .portfolio-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .portfolio-preview { grid-template-columns: 1fr; }
}

.portfolio-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--line);
}

:root {
  --bg: #f4f4f0;
  --fg: #111111;
  --muted: #77776f;
  --line: #c9c9c0;
  --max: 1600px;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: clamp(4rem, 8vw, 9rem);
  --space-xl: clamp(7rem, 13vw, 15rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

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

.site-header,
main,
.site-footer {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
}

.wordmark-logo {
  display: block;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

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

.site-nav a,
.text-link {
  position: relative;
}

.site-nav a::after,
.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -0.18rem;
  height: 1px;
  background: currentColor;
  transition: right 180ms ease;
}

.site-nav a:hover::after,
.text-link:hover::after {
  right: 0;
}

.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 2rem 0;
}

.hero-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero h1 {
  align-self: center;
  margin: 0;
  max-width: 12ch;
  font-size: clamp(4rem, 11vw, 11rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.85;
}

.hero h1 span {
  display: block;
}

.hero-footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
}

.hero-footer p {
  width: min(36rem, 55vw);
  margin: 0;
  font-size: clamp(1rem, 1.4vw, 1.35rem);
}

.text-link {
  white-space: nowrap;
}

.work-section,
.about-section,
.contact-section {
  padding: var(--space-xl) 0 0;
}

.section-heading {
  display: grid;
  grid-template-columns: 4rem 1fr;
  align-items: baseline;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.section-heading span {
  color: var(--muted);
  font-size: 0.78rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 5rem) 1rem;
  padding-top: 1rem;
}

.project-card--large {
  grid-column: 1 / -1;
}

.project-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.project-card--large .project-media {
  aspect-ratio: 16 / 8.5;
}

.film-carousel {
  position: relative;
  background: var(--line);
}

.film-carousel__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 900ms ease;
}

.film-carousel__image.is-active {
  opacity: 1;
}

.film-carousel__status {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.media-placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(0,0,0,0.025), rgba(0,0,0,0.09));
  border: 1px solid rgba(0,0,0,0.06);
  color: var(--muted);
  font-size: 0.8rem;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  padding-top: 0.8rem;
}

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

.project-meta h3 {
  font-size: 1.15rem;
  font-weight: 500;
}

.project-meta p,
.project-meta > span {
  color: var(--muted);
  font-size: 0.85rem;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.6fr);
  gap: 4rem;
  padding-top: 2rem;
}

.about-lead {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 6.5rem);
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.about-copy {
  max-width: 32rem;
  font-size: 1rem;
}

.about-copy p {
  margin-top: 0;
  margin-bottom: 1rem;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(3rem, 8vw, 10rem);
  padding-bottom: var(--space-lg);
}

.contact-intro > p {
  max-width: 36rem;
  color: var(--muted);
}

.contact-form {
  position: relative;
  display: grid;
  gap: 2rem;
}

.contact-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
}

.form-field {
  display: grid;
  gap: 0.55rem;
}

.form-field label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.15rem 0 0.75rem;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 1.05rem;
}

.form-field select {
  cursor: pointer;
}

.form-field textarea {
  min-height: 10rem;
  resize: vertical;
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  border-bottom-color: var(--fg);
  outline: 0;
}

.form-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.contact-form__actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
}

.submit-button {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  min-width: min(100%, 15rem);
  border: 0;
  border-bottom: 1px solid var(--fg);
  padding: 0 0 0.45rem;
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.submit-button:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 0.4rem;
}

.submit-button:disabled {
  color: var(--muted);
  cursor: wait;
}

.form-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.form-status.is-error {
  color: #8a2f24;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .site-header {
    min-height: 64px;
  }

  .site-nav {
    gap: 1rem;
    font-size: 0.85rem;
  }

  .hero {
    min-height: calc(100svh - 64px);
  }

  .hero h1 {
    font-size: clamp(3.8rem, 18vw, 7rem);
  }

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

  .hero-footer p {
    width: 100%;
  }

  .project-grid,
  .about-grid,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .project-card--large {
    grid-column: auto;
  }

  .project-card--large .project-media,
  .project-media {
    aspect-ratio: 4 / 3;
  }

  .section-heading {
    grid-template-columns: 2.5rem 1fr;
  }

  .about-grid {
    gap: 2rem;
  }

  .contact-form {
    margin-top: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: auto;
    padding: 2rem 0 3rem;
    gap: 3rem;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 16vw, 5rem);
    line-height: 0.9;
  }

  .hero-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .hero-footer p {
    width: 100%;
  }

  .contact-form__row,
  .contact-form__actions {
    grid-template-columns: 1fr;
  }

  .contact-form__actions {
    gap: 1rem;
  }

  .submit-button {
    width: 100%;
  }
}

@media (max-height: 600px) {
  .hero {
    min-height: auto;
    gap: 2.5rem;
  }

  .hero h1 {
    margin: 2rem 0;
  }
}
