@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("../assets/fonts/quicksand.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --ink: #222;
  --paper: #fdfcf9;
  --blue: #4f52f0;
  --lilac: #a27cf2;
  --lilac-light: #ece4fd;
  --yellow: #ffd84d;
  --serif: "Fraunces", Georgia, serif;
  --radius: 14px;
  --gap: clamp(12px, 2vw, 22px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 1.05rem/1.6 "Quicksand", system-ui, sans-serif;
}
body.no-scroll { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 .6em;
}

/* Header */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(16px, 4vw, 40px) 20px 10px;
}
.logo img { width: min(560px, 88vw); height: auto; }
.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 28px;
  margin-top: 10px;
  font-weight: 700;
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 4px 2px;
  background: linear-gradient(var(--blue), var(--blue)) left bottom / 0 3px no-repeat;
  transition: background-size .25s;
}
.main-nav a:hover, .main-nav a:focus-visible { background-size: 100% 3px; }

/* Filter */
.works { padding: 20px var(--gap) 60px; max-width: 1500px; margin: 0 auto; scroll-margin-top: 10px; }
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 28px;
}
.chip {
  font: 700 .95rem "Quicksand", sans-serif;
  border: none;
  background: var(--lilac-light);
  color: #4b1fb5;
  padding: 7px 18px;
  border-radius: 99px;
  cursor: pointer;
  transition: transform .15s, background .15s, color .15s;
}
.chip:hover { transform: rotate(-3deg); background: #ddd0fb; }
.chip[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* Grid */
.grid { display: flex; gap: var(--gap); align-items: flex-start; }
.grid-col { flex: 1; min-width: 0; }
.card {
  position: relative;
  display: block;
  margin-bottom: var(--gap);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--lilac-light);
  color: #fff;
  text-decoration: none;
  transition: transform .2s ease;
}
.card img { width: 100%; height: auto; transition: transform .4s ease; }
.card:hover, .card:focus-visible { transform: rotate(-1deg) scale(1.01); }
.card:nth-child(even):hover, .card:nth-child(even):focus-visible { transform: rotate(1deg) scale(1.01); }
.card:hover img { transform: scale(1.04); }
.card-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 14px 12px;
  background: linear-gradient(transparent, rgba(20, 20, 40, .75));
  font-size: .95rem;
  opacity: 0;
  transition: opacity .2s;
}
.card-caption strong { font-family: var(--serif); font-weight: 600; }
.card:hover .card-caption, .card:focus-visible .card-caption { opacity: 1; }
.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: .8rem;
  padding: 2px 9px;
  border-radius: 99px;
}
.sticker {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  background: var(--blue);
  color: #fff;
  font: italic 800 1rem var(--serif);
  transform: rotate(-12deg);
  clip-path: polygon(50% 0%, 61% 30%, 95% 20%, 72% 47%, 98% 72%, 64% 68%, 52% 100%, 40% 70%, 6% 82%, 28% 54%, 2% 28%, 36% 32%);
}
.card.missing { min-height: 220px; }
.card.missing img { display: none; }
.card.missing .card-caption { opacity: 1; color: var(--ink); background: none; }

/* About */
.about { background: var(--blue); color: #fff; }
.about-inner {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 90px);
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(60px, 9vw, 120px) 24px;
}
.about-photo { margin: 0; justify-self: center; transform: rotate(-3deg); max-width: 440px; }
.about-photo img { background: #fdf8ee; padding: 12px; box-shadow: 0 20px 40px rgba(15, 10, 70, .35); }
.about-photo figcaption { margin-top: 10px; text-align: right; font-size: .8rem; color: rgba(255, 255, 255, .75); }
.eyebrow { margin: 0 0 14px; font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.about h2 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 500; letter-spacing: -0.02em; }
.about h2 em { font-style: italic; color: var(--yellow); }
.about-text p { max-width: 34em; }
.about-text a { color: var(--yellow); }
.about-text .text-link {
  display: inline-block;
  margin-top: 12px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid currentColor;
  transition: color .15s;
}
.about-text .text-link:hover { color: var(--yellow); }

/* Contact */
.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(60px, 9vw, 120px) 24px;
}
.contact h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); color: #4b1fb5; }
.social { list-style: none; padding: 0; margin: 24px 0 0; display: flex; gap: 14px; }
.social a { display: block; width: 46px; height: 46px; color: var(--blue); transition: transform .15s, color .15s; }
.social a:hover, .social a:focus-visible { transform: rotate(-8deg) scale(1.08); color: #4b1fb5; }
.social svg { width: 100%; height: 100%; display: block; }
.card-stack { position: relative; width: min(100%, 420px); aspect-ratio: 1210 / 1613; margin: 0 auto; }
.biz { position: absolute; height: auto; filter: drop-shadow(0 10px 14px rgba(60, 30, 120, .22)); will-change: transform; }
.biz-back { left: 16.942%; top: 5.27%; width: 53.967%; }
.biz-middle { left: 39.256%; top: 31.804%; width: 46.446%; }
.biz-front { left: 9.917%; top: 47.179%; width: 56.033%; }

/* Footer */
.site-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  font-size: .9rem;
}
.site-footer a { color: var(--ink); }

/* Detail dialog */
.work-dialog {
  width: min(1300px, 96vw);
  height: min(92vh, 1200px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: none;
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
.work-dialog::backdrop { background: rgba(40, 30, 80, .55); backdrop-filter: blur(3px); }
.dialog-close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  appearance: none;
  cursor: pointer;
}
.dialog-close svg { display: block; width: 24px; height: 24px; flex: none; }
.dialog-close:hover { background: var(--blue); }
.work-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
  height: 100%;
}
.work-images {
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #fff;
}
.work-images img { width: auto; max-width: 100%; max-height: calc(min(92vh, 1200px) - 120px); height: auto; border-radius: 10px; margin: 0 auto; }
.scroll-hint {
  position: sticky;
  bottom: 18px;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -8px;
  padding: 10px 18px;
  border: none;
  border-radius: 99px;
  background: var(--blue);
  color: #fff;
  font: 700 .95rem "Quicksand", sans-serif;
  box-shadow: 0 8px 20px rgba(40, 30, 120, .3);
  cursor: pointer;
  transition: opacity .3s, transform .3s;
}
.scroll-hint svg { width: 18px; height: 18px; animation: nudge 1.2s ease-in-out infinite; }
.scroll-hint.is-hidden { opacity: 0; transform: translateY(10px); pointer-events: none; }
@keyframes nudge { 50% { transform: translateY(4px); } }
.work-info {
  overflow-y: auto;
  padding: 70px 32px 32px;
  display: flex;
  flex-direction: column;
}
.work-meta { color: #4b1fb5; font-weight: 700; font-size: .9rem; margin: 0 0 8px; }
.work-info h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.work-links { padding-left: 1.1em; }
.work-links a { font-weight: 700; }
.work-nav { margin-top: auto; display: flex; justify-content: space-between; gap: 10px; padding-top: 24px; }
.work-nav button {
  font: 700 .95rem "Quicksand", sans-serif;
  border: 2px solid var(--ink);
  background: transparent;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
}
.work-nav button:hover { background: var(--ink); color: #fff; }

@media (max-width: 760px) {
  .about-inner { grid-template-columns: 1fr; }
  .about-photo { max-width: 340px; }
  .work-dialog { width: 100vw; height: 100dvh; border-radius: 0; }
  .work-images img { max-height: none; width: 100%; }
  .work-detail { display: block; height: 100%; overflow-y: auto; }
  .work-images, .work-info { overflow: visible; padding: 16px; }
  .work-info { padding-top: 8px; }
  .card-caption { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; animation: none !important; }
}

/* Legal page */
.legal { max-width: 760px; margin: 0 auto; padding: 20px 24px 60px; }
.legal h1 { color: var(--blue); }
.legal h2 { font-size: 1.3rem; margin-top: 1.6em; }
