:root {
  --white: #fff;
  --ink: #000;
  --grey: #8a8a8a;
  --hl: #7ff5f5;
  --sans: "Epilogue", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wordmark: "Sorts Mill Goudy", "Caslon 540 LT Std", Georgia, serif;
  --italic: "Libre Caslon Text", "Caslon 540 LT Std", Georgia, serif;
  --gutter: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 300 16px/1.3 var(--sans);
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
a { color: inherit; text-decoration: none; }

/* Top bar */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px var(--gutter);
  background: var(--white);
  font: 400 15px/1 var(--sans);
  letter-spacing: -0.02em;
}
.topbar nav { display: flex; gap: clamp(16px, 3vw, 48px); }
.topbar nav.right { justify-content: flex-end; }
.topbar a:hover, .topbar a:focus-visible, .topbar a[aria-current] { color: #1a1aff; }
.brand { font: 400 26px/1 var(--wordmark); letter-spacing: 0; text-transform: none; }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 100px var(--gutter) 60px;
}
.hero .wordmark { margin: 0; font: 400 clamp(56px, 11vw, 150px)/0.95 var(--wordmark); letter-spacing: -0.05em; }
.hero .tagline { margin: 6px 0 0; font: 400 clamp(36px, 8vw, 110px)/0.95 var(--sans); letter-spacing: -0.06em; }
.hero .sub { max-width: 680px; margin: 32px 0 0; font: 400 clamp(20px, 2.2vw, 28px)/1.35 var(--sans); letter-spacing: -0.02em; }
.hero .btn { margin-top: 32px; }

/* Project blocks */
.project { padding: 90px var(--gutter) 40px; }
.project-head { text-align: center; }
.project-head h2 { margin: 0; font: 400 clamp(40px, 8vw, 110px)/1 var(--sans); letter-spacing: -0.05em; }
.hl {
  display: inline-block;
  margin-top: 4px;
  font: italic 400 clamp(24px, 3.4vw, 48px)/1.15 var(--italic);
  letter-spacing: -0.02em;
}
/* Image cards: squircle corners (true superellipse where supported, rounded elsewhere). */
.card {
  display: block;
  width: min(100%, 560px);
  margin: 24px auto 0;
  aspect-ratio: 4 / 3;
  border-radius: 40px;
  overflow: hidden;
}
@supports (corner-shape: squircle) {
  .card { border-radius: 80px; corner-shape: squircle; }
}
.card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-photo img { object-position: center 28%; }
/* The MT82 logo is square with its own border: show it whole on black rather than crop it. */
.card-logo { background: #000; }
.card-logo img { object-fit: contain; }
.project-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  width: min(100%, 560px);
  margin: 14px auto 0;
  font-weight: 300;
}
.project-foot p { margin: 0; max-width: 380px; }
.btn {
  display: inline-block;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  font: 400 15px/1 var(--sans);
  white-space: nowrap;
}
.btn:hover, .btn:focus-visible { background: #1a1aff; }

/* Squircle buttons: true superellipse corners where supported (Chrome/Edge 139+),
   plain rounded corners elsewhere. */
.btn, .dialog-x { border-radius: 14px; }
@supports (corner-shape: squircle) {
  .btn, .dialog-x { border-radius: 24px; corner-shape: squircle; }
}

/* Contact */
.contact { padding: 120px var(--gutter) 80px; text-align: center; }
.contact h2 { margin: 0 0 20px; font: 400 clamp(40px, 8vw, 110px)/1 var(--sans); letter-spacing: -0.05em; }
.contact-lead { max-width: 520px; margin: 0 auto 20px; font-size: 16px; }
.footer { padding: 30px var(--gutter) 40px; font-size: 13px; color: var(--grey); }

/* Contact dialog */
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: var(--ink); color: var(--white); }
:focus-visible { outline: 3px solid #1a1aff; outline-offset: 3px; }
.contact-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 40px 32px 32px;
  border: 0;
  border-radius: 24px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.contact-dialog::backdrop { background: rgba(255, 255, 255, 0.55); backdrop-filter: blur(6px); }

/* Soft-focus dissolve in: fades up from blurred to sharp. */
.contact-dialog[open] { animation: dissolve-in 0.7s ease-out both; }
.contact-dialog[open]::backdrop { animation: backdrop-in 0.7s ease-out both; }
@keyframes dissolve-in {
  from { opacity: 0; filter: blur(14px); transform: scale(0.97); }
  to   { opacity: 1; filter: blur(0);    transform: none; }
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.contact-dialog h2 { margin: 0 0 12px; font: 400 clamp(32px, 5vw, 48px)/1 var(--sans); letter-spacing: -0.05em; }
.contact-dialog p { margin: 0 0 24px; font-size: 16px; }
.dialog-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.dialog-x { position: absolute; top: 10px; right: 14px; padding: 4px 10px; border: 0; background: none; font: 300 32px/1 var(--sans); cursor: pointer; }

/* Scroll reveal (only when JS has run) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 800px) {
  .topbar { grid-template-columns: auto 1fr auto; font-size: 13px; }
  .topbar nav.left a:not(:first-child) { display: none; }
  .brand { font-size: 20px; }
  .project-foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .contact-dialog[open], .contact-dialog[open]::backdrop { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}
