@import url('https://api.fontshare.com/v2/css?f[]=switzer@400,500,600,700&display=swap');

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Poppins:wght@700;800&display=swap');

:root {
  /* small titles and short phrases: monospace caps; big display words: heavy geometric sans */
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-display: 'Poppins', 'Switzer', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  --bg: #ffffff;
  --fg: #0f0e0e;
  --soft: #f0f0f0;
  --muted: #6b6b70;
  --muted-2: #808086;
  --line: rgba(15, 14, 14, 0.12);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: 'Switzer', -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
}

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

/* ---------- Entrance animation ---------- */

body.intro-lock { overflow: hidden; }

/* hidden until the animation starts (a failsafe reveals it if the script never runs) */
.intro-pending .page {
  opacity: 0;
  animation: intro-failsafe 0s 9s forwards;
}

@keyframes intro-failsafe { to { opacity: 1; } }

.intro-canvas {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 56px;
  padding-right: 56px;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 26px 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.site-header .brand {
  justify-self: start;
  color: var(--fg);
}

.site-header nav {
  display: flex;
  gap: 32px;
}

.site-header .brand,
.site-header nav a,
.site-header .year {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--fg);
}

.site-header nav a { transition: opacity 0.2s ease; }

.site-header nav a:hover { opacity: 0.5; }

.site-header .year {
  justify-self: end;
  color: var(--fg);
}

/* ---------- Hero ---------- */

.hero {
  /* the name spans the full screen width (minus the same side margins as the header) */
  --hfs: calc((100cqw - 64px) / 7.9);
  container-type: inline-size;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 84px 0 28px;
}

.hero h1 {
  margin: 16px 0 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 7.2vw, 112px);
  font-size: var(--hfs);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero p {
  margin: 18px 0 0;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  max-width: 900px;
}

.scroll-arrow {
  display: block;
  margin-top: 24px;
  width: 30px;
  color: var(--fg);
  opacity: 0.85;
  animation: arrow-nudge 2.2s ease-in-out infinite;
}

.scroll-arrow svg {
  display: block;
  width: 100%;
  height: auto;
}

@keyframes arrow-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-arrow { animation: none; }
}

/* ---------- Carousel (3D scale) ---------- */

.carousel {
  /* a flat, wide band rather than one tall centered image: every card is the
     same size (flat, not a 3D perspective falloff), just bigger than before */
  --cw: clamp(300px, min(38vw, 40vh, (100vh - 260px - var(--hfs)) / 0.75), 620px);
  --top: 20px;
  position: relative;
  width: 100%;
  height: calc(var(--cw) * 0.75 + 40px);
  margin-top: 0;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.c-item {
  position: absolute;
  left: 50%;
  top: calc(var(--top) + var(--cw) * 0.375);
  width: var(--cw);
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  overflow: hidden;
  z-index: var(--z, 1);
  opacity: var(--o, 1);
  transform: translate(calc(-50% + var(--x, 0) * var(--cw)), -50%) scale(var(--s, 1));
  background: var(--soft);
  transition: transform 0.65s cubic-bezier(0.45, 0.05, 0.2, 1), opacity 0.65s ease;
  will-change: transform;
}

.c-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(15, 14, 14, 0.1);
  pointer-events: none;
}

.c-item.no-anim { transition: none; }

.c-item img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
}

.c-item img.col {
  opacity: 0;
  transition: opacity 0.65s ease;
}

.c-item.is-center img.col { opacity: 1; }

.c-item.no-anim img.col { transition: none; }

.c-item:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .c-item, .c-item img.col { transition: none; }
}

/* ---------- Section shell ---------- */

.section {
  padding: 110px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 56px;
  gap: 24px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---------- Work grid ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px 32px;
}

.work-card { display: block; }

.work-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--soft);
  position: relative;
}

.work-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease, opacity 0.7s ease;
}

.work-card img.col { opacity: 0; }

.work-card:hover img { transform: scale(1.04); }

.work-card:hover img.col { opacity: 1; }

.work-card .meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.work-card .meta h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.work-card .meta span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  margin-left: 16px;
}

/* ---------- About ---------- */

/* the heading fills the full width of the text block below it */

.about-text { container-type: inline-size; }

.about-text h2 {
  margin: 0 0 28px;
  font-family: var(--font-display);
  font-size: clamp(32px, 11vw, 150px);
  font-size: 13.6cqw;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.about-text p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--fg);
}

.about-text p.about-lead {
  margin-bottom: 26px;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 400;
  line-height: 1.5;
}

/* ---------- Services ---------- */

.services { margin-top: 110px; }

.services-title {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.services-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.services-list li {
  padding: 0.14em 0 0.12em;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 8vw, 104px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.services-list:hover li { color: rgba(15, 14, 14, 0.22); }

.services-list:hover li:hover { color: var(--fg); }

.services-list li:last-child { border-bottom: 1px solid var(--line); }

/* ---------- Contact / footer ---------- */

.contact-section {
  text-align: center;
}

.contact-section h2 {
  margin: 0 auto 32px;
  font-family: var(--font-mono);
  font-size: clamp(26px, 3.6vw, 46px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
  max-width: 720px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 30px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover { background: var(--muted); }

::selection { background: var(--fg); color: var(--bg); }

footer {
  padding: 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.footer-mail {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 12px;
  color: var(--muted-2);
}

.footer-social {
  display: block;
  width: 18px;
  height: 18px;
  color: var(--muted-2);
}

.footer-social svg {
  display: block;
  width: 100%;
  height: 100%;
}

.footer-mail,
.footer-social { transition: color 0.2s ease; }

.footer-mail:hover,
.footer-social:hover { color: var(--fg); }

/* ---------- Project pages ---------- */

.back-link {
  display: inline-block;
  margin: 120px 0 40px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.back-link:hover { color: var(--fg); }

.project-header { margin-bottom: 48px; }

.project-header .section-tag { margin-bottom: 16px; display: block; }

.project-header h1 {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: uppercase;
}

.project-header p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  max-width: 640px;
}

/* collage: rows of 1-3 works with equal height and widths proportional to each image */

.project-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 100px;
}

.project-images .row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.project-images .row > * {
  flex: var(--ar, 1) 1 0;
  min-width: 0;
}

.project-images img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar);
  object-fit: cover;
  border-radius: 2px;
}

/* generative "video" (canvas) that sits in the collage like one more image */

.project-images .loop {
  aspect-ratio: var(--ar);
  border-radius: 2px;
  overflow: hidden;
  background: var(--soft);
}

.project-images .loop canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* a column of stacked images (used next to a big one) */

.project-images .stack {
  display: grid;
  gap: 8px;
  align-content: start;
}

/* big work next to a 2 x 3 grid of small ones */

.project-images .collage > img {
  height: 100%;
  aspect-ratio: auto;
}

.project-images .mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
}

.project-images .mini-grid img { aspect-ratio: 4 / 5; }

@media (max-width: 600px) {
  .project-images .row { flex-direction: column; }
  .project-images .row > * { flex: none; width: 100%; }
  .project-images .collage > img { height: auto; aspect-ratio: var(--ar); }
}

/* ---------- Scroll reveal ---------- */

/* elements fade up into place as they enter the viewport (see js/reveal.js);
   --rd staggers items inside a .reveal-group, set per item by the script */

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.16, 0.8, 0.24, 1), transform 0.8s cubic-bezier(0.16, 0.8, 0.24, 1);
  transition-delay: var(--rd, 0s);
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
  .site-header { display: flex; justify-content: space-between; padding: 20px; }
  .site-header nav { display: none; }
  .work-grid { grid-template-columns: 1fr; }
  .services { margin-top: 72px; }
  .section { padding: 80px 0; }
  footer { flex-direction: column; gap: 10px; text-align: center; }
}
