/* Studio Davelaar - design system tokens from CLAUDE.md */
:root {
  --accent:   #FE4D2A;
  --dark:     #030303;
  --charcoal: #2C2D38;
  --mgrey:    #888888;
  --lgrey:    #AAAAAA;
  --white:    #FFFFFF;

  --font: 'Helvetica Neue', Inter, -apple-system, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--dark);
  color: var(--white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ---------- masthead ---------- */

.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.75rem 2rem;
  pointer-events: none;
}

/* The header floats over the work, so it needs its own ground to stand on.
   A gradient rather than a bar, so the grid still reads as continuous. */
.masthead::before {
  content: '';
  position: absolute;
  inset: -1px 0 auto 0;
  height: 190%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(3,3,3,0.88) 0%, rgba(3,3,3,0.62) 45%, rgba(3,3,3,0) 100%);
}

.masthead h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.masthead-id p {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--mgrey);
}

.masthead-meta {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lgrey);
}

.masthead-meta b { color: var(--accent); font-weight: 700; }
.masthead-meta .dot { margin: 0 0.4rem; }

/* ---------- the grid ---------- */

.grid-wrapper {
  position: fixed;
  inset: 0;
  overflow: hidden;
  perspective: 1400px;
  cursor: grab;
  touch-action: none;
}

.grid-wrapper.is-dragging { cursor: grabbing; }

.grid-plane {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.tile {
  position: absolute;
  top: 0; left: 0;
  will-change: transform, opacity;
  transform-origin: center center;
  background: var(--charcoal);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  /* All pointer handling is done by the wrapper against our own geometry -
     the browser's hit test on these projected tiles is wrong. Cursor and
     hover are driven from JS for the same reason. */
  pointer-events: none;
}

.grid-wrapper.is-over { cursor: pointer; }
.grid-wrapper.is-dragging,
.grid-wrapper.is-dragging.is-over { cursor: grabbing; }

/* Seen state: subtle accent outline drawn over the artwork.
   A pseudo-element, not a border - a border would resize the tile, and an
   inset shadow would paint underneath the image. */
.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1.5px solid transparent;
  pointer-events: none;
  z-index: 3;
  transition: border-color 0.45s ease;
}

.tile.is-seen::after { border-color: rgba(254, 77, 42, 0.55); }

.tile.is-seen.is-hover::after { border-color: rgba(254, 77, 42, 0.9); }

.tile-visual {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #14141b;
}

.tile-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tile.is-hover .tile-visual img { transform: scale(1.05); }

.tile-flag {
  position: absolute;
  top: 0.7rem; left: 0.7rem;
  background: var(--accent);
  color: var(--white);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem;
  border-radius: 100px;
}

.tile-meta {
  padding: 0.85rem 0.95rem 1rem;
  background: var(--charcoal);
}

.tile-tag {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: rgba(3, 3, 3, 0.72);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.tile-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--white);
}

.empty {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--mgrey);
}

/* ---------- hint ---------- */

.hint {
  position: fixed;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  background: rgba(3, 3, 3, 0.7);
  backdrop-filter: blur(8px);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--lgrey);
  pointer-events: none;
  animation: breathe 3.5s ease-in-out infinite;
}

/* Once someone has dragged, they know. Stop telling them. */
body.has-dragged .hint { opacity: 0; animation: none; transition: opacity 0.6s ease; }

@keyframes breathe { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(3, 3, 3, 0.9);
  backdrop-filter: blur(10px);
}

.modal.is-open { display: flex; }

.modal-panel {
  position: relative;
  width: min(1000px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--charcoal);
  border-radius: 14px;
  animation: rise 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 0.9rem; right: 0.9rem;
  z-index: 5;
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(3, 3, 3, 0.6);
  color: var(--white);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { background: var(--accent); }

.modal-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}

.modal-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }

.modal-copy { padding: 1.75rem 2rem 2rem; }

.modal-tag {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.modal-copy h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }

.modal-copy p { font-size: 0.85rem; line-height: 1.7; color: var(--lgrey); max-width: 62ch; }

/* ---------- personalize prompt ---------- */

.personalize {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 150;
  display: none;
  width: 300px;
  padding: 1.4rem;
  background: var(--charcoal);
  border: 1px solid rgba(254, 77, 42, 0.4);
  border-radius: 12px;
}

.personalize.is-open { display: block; animation: rise 0.35s ease; }

.personalize h3 {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lgrey);
  margin-bottom: 0.8rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.1rem; }

.chip {
  background: var(--accent);
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
}

.btn {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: transparent;
  color: var(--white);
  font-family: var(--font);
  font-size: 0.72rem;
  cursor: pointer;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- small screens ---------- */

@media (max-width: 700px) {
  .masthead { padding: 1.1rem 1.1rem; }
  .masthead h1 { font-size: 0.95rem; }
  .modal { padding: 0.9rem; }
  .modal-copy { padding: 1.2rem 1.2rem 1.5rem; }
  .personalize { left: 1rem; right: 1rem; width: auto; }
}

.build {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(254, 77, 42, 0.5);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  pointer-events: none;
}

.tile-hook {
  margin-top: 0.35rem;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--lgrey);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal-meta {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mgrey);
  margin-bottom: 1rem;
}

.modal-flag {
  margin-bottom: 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 0.68rem;
  line-height: 1.5;
  border-left: 2px solid var(--accent);
  background: rgba(254, 77, 42, 0.09);
  color: var(--lgrey);
}

/* ---------- credits, results and links ---------- */

/* Cases where a public source names Rhys. Sits under the Featured flag. */
.tile-credit {
  position: absolute;
  top: 0.7rem; right: 0.7rem;
  background: rgba(3, 3, 3, 0.72);
  border: 1px solid rgba(254, 77, 42, 0.65);
  color: var(--accent);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 100px;
}

.modal-role {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.7rem;
  border-radius: 100px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.modal-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-block h3 {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

.modal-block ul { list-style: none; }

.modal-block li {
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--lgrey);
  padding-left: 0.9rem;
  position: relative;
}

.modal-block li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.65em;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(254, 77, 42, 0.55);
}

.modal-block a {
  color: var(--lgrey);
  text-decoration: none;
  border-bottom: 1px solid rgba(254, 77, 42, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.modal-block a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Numbers get room to breathe - they are what a client scans for. */
.modal-results ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem 1.25rem;
}

.modal-results li {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--white);
  padding-left: 0;
}

.modal-results li::before { display: none; }

/* ================= build 008: menu, visual tiles, credit links ============= */

/* ---------- top-right menu ---------- */

.menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;   /* masthead itself is click-through */
}

.menu-count {
  margin-right: 0.35rem;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mgrey);
}

.menu-count b { color: var(--accent); font-weight: 700; }

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;          /* was 24px - below every touch guideline there is */
  min-width: 44px;
  padding: 0.35rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  background: rgba(3, 3, 3, 0.55);
  backdrop-filter: blur(8px);
  color: var(--lgrey);
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.menu-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- reset confirmation sheet ---------- */

.sheet {
  position: fixed;
  top: 5.5rem; right: 2rem;
  z-index: 300;
  display: none;
  width: 320px;
  padding: 1.3rem;
  background: var(--charcoal);
  border: 1px solid rgba(254, 77, 42, 0.45);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.sheet.is-open { display: block; animation: rise 0.25s ease; }

.sheet h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.sheet p {
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--lgrey);
  margin-bottom: 1.1rem;
}

.sheet-actions { display: flex; gap: 0.5rem; }
.sheet-actions .btn { width: auto; flex: 1; }

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  font-weight: 600;
}

.btn-accent:hover { background: #e63d20; border-color: #e63d20; color: var(--white); }

/* ---------- tiles: artwork first, text on hover ---------- */

/* The image now fills the whole tile rather than sitting above a text block. */
.tile-visual {
  position: absolute;
  inset: 0;
  flex: none;
}

/* Work with no case film has no poster frame to pull from. Rather than a
   blank rectangle, the tile sets its own title. Reads as intent, not as a
   missing asset - and it goes away the moment a still is dropped in. */
.tile-plate {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem;
  background:
    radial-gradient(120% 100% at 30% 20%, rgba(254, 77, 42, 0.22), rgba(254, 77, 42, 0) 60%),
    linear-gradient(160deg, #191922 0%, #0c0c11 100%);
}

/* On hover the caption states the title anyway, so the plate steps back
   rather than saying it twice. */
.tile.is-hover .tile-plate span { opacity: 0.16; }

.tile-plate span {
  transition: opacity 0.32s ease;
  font-size: clamp(0.95rem, 2.4vw, 1.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-align: center;
  text-wrap: balance;
  color: rgba(255, 255, 255, 0.9);
}

.tile-badges {
  position: absolute;
  top: 0.7rem; left: 0.7rem; right: 0.7rem;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.tile-flag, .tile-credit { position: static; }

/* Text overlays the artwork and only appears on hover, so a screen full of
   tiles reads as images and reveals itself where the pointer goes. */
.tile-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  padding: 2.5rem 1rem 1rem;
  background: linear-gradient(180deg, rgba(3,3,3,0) 0%, rgba(3,3,3,0.86) 55%, rgba(3,3,3,0.96) 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.tile.is-hover .tile-meta { opacity: 1; transform: none; }

.tile.is-hover .tile-visual img { transform: scale(1.06); }

.tile-hook {
  -webkit-line-clamp: 3;
  color: #cfcfcf;
}

/* A dark wash lifts on hover so the hovered tile brightens out of the grid. */
.tile-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 3, 0.34);
  transition: background 0.32s ease;
  pointer-events: none;
}

.tile.is-hover .tile-visual::after { background: rgba(3, 3, 3, 0.06); }

/* No hover on touch. Showing the whole card permanently turned the grid into
   a wall of type, so touch gets the label only - what it is and when - and the
   description stays behind the tap where it belongs. */
@media (hover: none) {
  .tile-meta {
    opacity: 1;
    transform: none;
    padding: 1.8rem 0.85rem 0.85rem;
    background: linear-gradient(180deg, rgba(3,3,3,0) 0%, rgba(3,3,3,0.82) 60%, rgba(3,3,3,0.94) 100%);
  }
  .tile-meta .tile-hook,
  .tile-meta .tile-immersive { display: none; }
  .tile-visual::after { background: rgba(3, 3, 3, 0.16); }
}

/* ---------- credit links ---------- */

.modal-block li a.is-search { border-bottom-style: dotted; opacity: 0.85; }
.modal-block li a.is-moderate { border-bottom-style: dashed; }

.credit-role {
  color: var(--mgrey);
  font-size: 0.68rem;
}

.modal-panel-narrow { width: min(620px, 100%); }

.modal-copy p + p { margin-top: 0.9rem; }

/* ---------- contact ---------- */

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.1rem;
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.contact-label {
  width: 100%;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--white);
  font-size: 0.92rem;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.contact-link:hover { color: var(--accent); }

.modal-note {
  margin-top: 1.5rem;
  padding: 0.6rem 0.8rem;
  border-left: 2px solid var(--mgrey);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-size: 0.68rem !important;
  color: var(--mgrey) !important;
}

.modal-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent);
}

@media (max-width: 700px) {
  .masthead { flex-direction: column; gap: 0.6rem; padding: 1rem 1rem 1.4rem; }
  .menu { align-self: flex-start; flex-wrap: wrap; }
  .menu-count { width: 100%; margin: 0 0 0.2rem; }
  .sheet { left: 1rem; right: 1rem; width: auto; top: auto; bottom: 1rem; }
  .hint { bottom: 1rem; font-size: 0.55rem; letter-spacing: 0.12em; }
}

/* Under 380px the tiles were cropped on every edge at once, which reads as
   broken rather than as an infinite plane. */
@media (max-width: 380px) {
  .masthead h1 { font-size: 0.9rem; }
  .masthead-id p { font-size: 0.66rem; }
}


/* ---------- handoff to an immersive case page ---------- */

.veil {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--dark);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.veil.is-on { opacity: 1; pointer-events: auto; }

/* Tiles that open a full page say so, rather than looking identical to the
   ones that only open a modal. */
.tile-immersive {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.tile-immersive::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
