:root {
  --bg: #12151c;
  --panel: #1b2030;
  --line: #2a3142;
  --line-strong: #3a4152;
  --fg: #f3f4f8;
  --muted: #a9afbd;
  --accent: #7c8cff;
  --on-accent: #12151c;
  --max: 1280px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  /* Short pages: the footer sits at the bottom of the window */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }

a { color: var(--muted); text-decoration: none; }
a:hover { color: var(--fg); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 3.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.25rem); }
p { margin: 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 64px; }
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.lead { color: var(--muted); font-size: 1.15rem; max-width: 60ch; }
/* Name, a small circle and the tagline, side by side in the top bar */
.brandline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.brandline .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; align-self: center; }
.tagline { color: var(--muted); font-size: 0.95rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  border: 1px solid var(--accent);
}
.btn:hover { color: var(--on-accent); opacity: 0.9; }
.btn.secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn.secondary:hover { color: var(--fg); border-color: var(--muted); opacity: 1; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }

/* ---------- Home: banner ---------- */
.banner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.banner-img {
  position: relative;
  border-bottom: 1px solid var(--line);   /* thin line under the banner, like the one under the header */
  width: 100%;
  height: 600px;
  /* Put your illustration at images/banner.png (about 1920 x 600). */
  background: #243049;
}
.banner-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bar {
  position: relative;
  order: -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px 40px;
  background: var(--bg);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--fg); }
.bar nav, header.site nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 0.95rem; }
nav a[aria-current="page"] { color: var(--fg); }
nav .nav-mail { color: var(--accent); }
nav .nav-mail:hover { color: var(--fg); }

.intro {
  position: relative;
  align-self: flex-start;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 32px 40px 28px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
}
.intro p { color: var(--muted); font-size: 1.1rem; }

/* ---------- Sections ---------- */
section.block { padding-top: 80px; }
section.block:first-of-type { padding-top: 64px; }
.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

/* ---------- Gallery ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font: inherit;
  font-size: 0.9rem;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.gallery {
  column-width: 280px;
  column-gap: 20px;
}
.gallery figure { margin: 0 0 24px; break-inside: avoid; }
.gallery figure[hidden] { display: none; }
.art {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--tone, #3a4766);
  aspect-ratio: var(--ratio, 1 / 1);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Shows only while the image file is missing */
.art::after {
  content: attr(data-label);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}
.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
/* Once a real image has loaded, the tile takes the image's own proportions */
.art.loaded { aspect-ratio: auto; background: transparent; }
.art.loaded::after { content: none; }
.art.loaded img { position: static; height: auto; display: block; }

.gallery figcaption { margin-top: 10px; font-size: 0.9rem; color: var(--muted); }
.gallery figcaption strong { color: var(--fg); font-weight: 500; }

/* ---------- Cards ---------- */
.cards, .features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.card h3 { font-size: 1.6rem; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .tag {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.card .tag.paid { color: var(--accent); }
.card .btn { margin-top: 4px; min-height: 44px; padding: 0 22px; }
.step { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--accent); }

.prose { max-width: 70ch; }
.prose p + p { margin-top: 1em; }
.about { color: var(--muted); font-size: 1.05rem; line-height: 1.7; max-width: 62ch; }

/* ---------- Sub pages ---------- */
/* Same bar as the home page: same height, background and line underneath */
header.site { padding: 14px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
main.page { padding: 48px 0 24px; }
main.page > .wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
main.page section.block { width: 100%; }
.video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 520px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
video.video { display: block; background: #000; object-fit: contain; }
.panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.price { font-family: var(--font-display); font-weight: 700; font-size: 2.75rem; line-height: 1.1; }
.price small { font-family: var(--font-body); font-size: 1rem; font-weight: 500; color: var(--muted); }
.panel p { color: var(--muted); font-size: 0.95rem; margin-top: 6px; }
ul.plain { margin: 0; padding-left: 1.2em; color: var(--muted); }

/* ---------- Footer ---------- */
footer.site { margin-top: auto; padding: 64px 0 20px; font-size: 0.9rem; color: var(--muted); }
footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}
footer.site .links { display: flex; flex-wrap: wrap; gap: 16px 28px; }
.mail { color: var(--accent); font-size: 1.1rem; font-weight: 500; }
.mail:hover { color: var(--fg); }

@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
  .banner { padding: 0; }
  .banner-img { height: 320px; }
  .bar { padding: 12px 20px; }
  header.site { padding: 12px 0; }
  .intro { padding: 24px 20px 20px; }
  .panel { padding: 24px; }
}

/* Visually hidden, still read by screen readers and search engines */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chips[hidden] { display: none; }

/* ---------- Click-to-enlarge popup ---------- */
button.art {
  width: 100%;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
}
button.art:hover { filter: brightness(1.08); }

body.lb-open { overflow: hidden; }

dialog.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 10, 14, 0.94);
  color: var(--fg);
}
dialog.lightbox::backdrop { background: rgba(8, 10, 14, 0.94); }

.lb-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 80px;
  overflow: hidden;
}
.lb-fig {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lb-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 250px);
  object-fit: contain;
  border-radius: 8px;
  touch-action: none;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.lb-img.zoomed { cursor: grab; }
.lb-img.zoomed:active { cursor: grabbing; }
.lb-cap { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: min(72ch, 100%); text-align: center; }
.lb-title { color: var(--muted); font-size: 0.85rem; }
.lb-note { color: var(--fg); font-size: 1rem; line-height: 1.55; max-height: 7.5em; overflow-y: auto; white-space: pre-line; }
.lb-note[hidden] { display: none; }

.lb-btn {
  position: absolute;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.lb-btn:hover { border-color: var(--muted); }
.lb-btn[hidden] { display: none; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

@media (max-width: 720px) {
  .lb-stage { padding: 72px 12px 88px; }
  .lb-img { max-height: calc(100vh - 300px); }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
}

/* ---------- Beta sign-up ---------- */
.signup-panel { align-items: flex-start; gap: 40px; }
.signup-copy { flex: 1 1 320px; display: flex; flex-direction: column; gap: 12px; }
.signup-copy p { margin-top: 0; }
.signup { flex: 1 1 340px; display: flex; flex-direction: column; gap: 12px; }
.signup label { font-size: 0.9rem; color: var(--muted); }
.signup input[type="email"] {
  font: inherit;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--fg);
}
.signup input[type="email"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.signup .check { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.signup .check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.signup .btn { cursor: pointer; font: inherit; font-weight: 700; justify-content: center; }
.signup .btn[disabled] { opacity: 0.6; cursor: default; }
.signup-status { min-height: 1.4em; font-size: 0.95rem; margin: 0; }
.signup-status.ok { color: var(--fg); }
.signup-status.err { color: #ff9b9b; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Full-width pages, project rows and project pages ---------- */
:root { --gap: 4px; }

/* On the home page and project pages the content uses the whole window width */
.fluid .wrap { max-width: none; padding: 0 clamp(16px, 3vw, 40px); }
/* The top bar of the sub pages lines up with the home page bar */
.fluid header.site .wrap { padding: 0 40px; }
@media (max-width: 720px) { .fluid header.site .wrap { padding: 0 20px; } }
/* Legal pages: full-width layout, but the text keeps a readable line length */
.fluid .wrap.prose { max-width: none; }
.fluid .wrap.prose > * { max-width: 70ch; }

/* An image frame: keeps the image's own proportions (--ratio is set from the image's pixel size) */
.pimg {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--ratio, 4 / 3);
  background: #243049;
  overflow: hidden;
}
.pimg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pimg.missing::after {
  content: "Image missing";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

/* One group per project: a big image box (two thirds of the page) that flips through the project's images, and the
   title with a short description in the remaining third. Every other project has the image on the right. */
.projects { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 88px); container-type: inline-size; padding: 0 clamp(16px, 3vw, 40px); }
.project { display: flex; align-items: center; gap: clamp(20px, 3vw, 48px); }
.project.flip { flex-direction: row-reverse; }
.project[hidden] { display: none; }

.project-media {
  position: relative;
  flex: none;
  width: 66cqw;
  aspect-ratio: 2 / 1;              /* the main image is cropped to this box, like on its project page */
  background: var(--panel);
  overflow: hidden;
}
.project-link { position: absolute; inset: 0; display: block; cursor: pointer; }
.project-media .pimg { position: absolute; inset: 0; width: auto; height: auto; aspect-ratio: auto; }
.project-media .pimg.whole img { object-fit: contain; }
.project-media .pimg[hidden] { display: none; }
a.project-link:hover .pimg img { filter: brightness(1.06); }

.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(18, 21, 28, 0.8);
  color: var(--fg);
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.slide-btn:hover { border-color: var(--muted); background: var(--panel); }
.slide-prev { left: 12px; }
.slide-next { right: 12px; }
.slide-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(18, 21, 28, 0.8);
  color: var(--muted);
  font-size: 0.8rem;
  pointer-events: none;
}

.project-text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.project-text h3 { font-family: var(--font-display); font-size: clamp(1.35rem, 2vw, 1.8rem); line-height: 1.2; letter-spacing: -0.01em; }
.project-text h3 a { color: var(--fg); }
.project-text h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.project-text .meta { color: var(--muted); font-size: 0.9rem; }
.project-text .desc {
  color: var(--muted);
  line-height: 1.7;
  max-width: 60ch;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 6;            /* a short descriptor; the project page has the whole text */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-text .more { align-self: flex-start; color: var(--fg); font-size: 0.9rem; }
.project-text .more:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Narrow screens: the image on top, then the text */
@media (max-width: 900px) {
  .project, .project.flip { flex-direction: column; align-items: stretch; }
  .project-media { width: 100%; aspect-ratio: 3 / 2; }
}

/* Project page */
main.project-page { padding: 40px 0 0; }
.project-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}
.project-head .back { font-size: 0.95rem; }
.project-head .meta { color: var(--muted); }
.project-head .desc { color: var(--muted); max-width: 70ch; font-size: 1.05rem; line-height: 1.7; }

.project-images { display: flex; flex-direction: column; gap: var(--gap); container-type: inline-size; padding: 0 clamp(16px, 3vw, 40px); }
/* Title, year / category and description: centered, above the images */
.project-intro { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 8px 0 clamp(20px, 3vw, 40px); }
.project-intro h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -0.01em; }
.project-intro .meta { color: var(--muted); font-size: 0.95rem; }
.project-intro .desc { color: var(--muted); line-height: 1.7; max-width: 70ch; white-space: pre-line; font-size: 1.05rem; }

/* One image per row, centered, all the same width and shown whole; the note sits underneath */
.project-gallery { display: flex; flex-direction: column; align-items: center; gap: clamp(36px, 5vw, 64px); }
.shot { width: min(100%, 1100px); margin: 0; }
.shot .item { display: block; width: 100%; padding: 0; border: 0; background: none; line-height: 0; cursor: zoom-in; }
.shot .pimg { background: none; }
/* images with a crop point: the same wide box as on the Work page, filled around that point (a click shows the whole picture) */
.shot .item.cropped { position: relative; aspect-ratio: 2 / 1; background: var(--panel); overflow: hidden; }
.shot .item.cropped .pimg { position: absolute; inset: 0; width: auto; height: auto; aspect-ratio: auto; }
.shot .item.cropped .pimg img { width: 100%; height: 100%; object-fit: cover; }
.shot figcaption { margin-top: 14px; color: var(--muted); line-height: 1.7; white-space: pre-line; max-width: 80ch; }
.project-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 40px 0 0;
}
