/* Orlando Pedretti — site styles
   White editorial layout. Asymmetric scattered tile placement.
*/

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #888888;
  --accent: #2D62FF;           /* hover corner brackets */
  --radius: 14px;
  --max-width: none;
  --side-pad: 4vw;             /* viewport-relative so tiles align with header */
  --header-font: 28px;         /* tweakable */
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
}
a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 40px var(--side-pad) 20px;
  background: transparent;
  pointer-events: none;     /* don't block clicks through transparent gaps */
}
.site-header > * { pointer-events: auto; }
.site-header .brand {
  font-size: var(--header-font);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  color: var(--fg);
  background: rgba(255,255,255,0.92);
  padding: 8px 12px;
  border-radius: 10px;
  backdrop-filter: blur(6px);
}
.site-header nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: var(--header-font);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-weight: 400;
  line-height: 1.18;
}
.site-header nav a {
  color: #6b6b6b;
  background: rgba(255,255,255,0.92);
  padding: 6px 12px;
  border-radius: 10px;
  backdrop-filter: blur(6px);
  transition: color 0.18s ease;
}
.site-header nav a:hover { color: var(--accent) !important; }
.site-header nav a.active {
  color: #000;
  font-weight: 700;
  font-style: italic;
}

/* ---------- Page wrap ---------- */
main {
  padding: 4px 0 40px;
  max-width: none;
  margin: 0 auto;
  position: relative;
}

/* ---------- Scattered canvas ---------- */
.canvas {
  position: relative;
  width: 100%;
  margin: 0;
}

/* ---------- Tile ---------- */
.tile {
  position: absolute;
  top: var(--top);
  left: var(--left);
  width: var(--w);
  aspect-ratio: 16 / 9;
  display: block;
  cursor: pointer;
  overflow: visible; /* corner brackets extend outside */
}

.tile-inner {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1a1a1a;
  transition: transform 0.45s cubic-bezier(.2,.7,.2,1),
              box-shadow 0.45s ease;
  will-change: transform;
}
.tile:hover .tile-inner {
  transform: scale(1.04);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.35);
}

.tile .thumb-img,
.tile .player-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  background: #1a1a1a;
}
/* Tiles flagged fit-contain: show whole image, no crop */
.tile.fit-contain .tile-inner { background: #000; }
.tile.fit-contain .thumb-img { object-fit: contain; }
.tile .thumb-img { color: transparent; font-size: 0; }
.tile .thumb-img.broken { opacity: 0; }
.tile-inner.no-thumb {
  background: repeating-linear-gradient(
    45deg,
    #1a1a1a 0 12px,
    #1f1f1f 12px 24px
  );
}
.tile-inner.no-thumb::after {
  content: attr(data-fallback-title);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  text-align: center;
  pointer-events: none;
}

.tile .player-frame {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.tile.is-playing .player-frame { opacity: 1; }
.tile.is-playing .thumb-img { opacity: 0; transition: opacity 0.35s ease 0.05s; }

/* ---------- Hover overlay: BRAND  ▶  NAME ---------- */
.tile .overlay {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 16px;
  z-index: 3;
  pointer-events: none;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 18px;
  text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}
.tile .ovl-brand,
.tile .ovl-name {
  opacity: 0;
  transition: opacity 0.25s ease;
  font-size: clamp(11px, 1vw, 16px);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.tile .ovl-brand { justify-self: end;   text-align: right; }
.tile .ovl-name  { justify-self: start; text-align: left;
                   font-weight: 700; font-style: italic; }
.tile .ovl-play {
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5));
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.tile:hover .ovl-brand,
.tile:hover .ovl-name { opacity: 1; }

/* When playing, fade text + dim play icon */
.tile.is-playing .ovl-brand,
.tile.is-playing .ovl-name { opacity: 0; transition-delay: 0s; }
.tile.is-playing .ovl-play { opacity: 0; transform: scale(0.85); }

/* Still-only tiles: no play icon, no overlay text */
.tile.still-only {
  cursor: zoom-in;
}
.tile.still-only .ovl-play,
.tile.still-only .ovl-brand,
.tile.still-only .ovl-name { display: none; }

/* ---------- Blue L-shape corner brackets (outside tile) ---------- */
.tile .corner {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--accent);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.4s cubic-bezier(.2,.7,.2,1);
  pointer-events: none;
  z-index: 4;
}
.tile .corner.tl { top: -14px; left: -14px; border-right: 0; border-bottom: 0; transform: translate(10px, 10px); }
.tile .corner.tr { top: -14px; right: -14px; border-left: 0; border-bottom: 0; transform: translate(-10px, 10px); }
.tile .corner.bl { bottom: -14px; left: -14px; border-right: 0; border-top: 0; transform: translate(10px, -10px); }
.tile .corner.br { bottom: -14px; right: -14px; border-left: 0; border-top: 0; transform: translate(-10px, -10px); }
.tile:hover .corner { opacity: 1; transform: translate(0, 0) !important; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 5vh 5vw;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox-stage {
  position: relative;
  width: min(90vw, calc((85vh) * 16 / 9));
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.6);
}
.lightbox-stage iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.lightbox-stage.still {
  aspect-ratio: auto;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 85vh;
  background: transparent;
  box-shadow: none;
}
.lightbox-img {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 8px;
}
.lightbox-close {
  position: absolute;
  top: 24px; right: 28px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
  z-index: 2;
}
.lightbox-close:hover { background: rgba(255,255,255,0.18); transform: scale(1.04); }
.lightbox-caption {
  position: absolute;
  left: 28px; top: 28px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

/* ---------- About page ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.5fr 2.05fr;
  grid-template-areas:
    ".    image"
    "text image"
    "send .   ";
  gap: 32px 36px;
  align-items: start;
  padding: 24px var(--side-pad) 60px;
  max-width: 1700px;
  margin: 0 auto;
}
.about-image-wrap { grid-area: image; }
.about-text-wrap  { grid-area: text;  align-self: end; justify-self: start; width: 340px; max-width: 40vw; }
.about-send-wrap  { grid-area: send;  align-self: end; justify-self: start; width: 340px; max-width: 40vw; padding-bottom: 24px; }

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "image" "text" "send";
    padding: 16px 24px 60px;
    gap: 28px;
  }
}

.about-text {
  font-size: clamp(16px, 1.15vw, 21px);
  line-height: 1.55;
  max-width: 100%;
  letter-spacing: 0.005em;
  color: #111;
  font-weight: 400;
  margin: 0;
  text-align: justify;
  hyphens: auto;
}
.about-image-frame {
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #efefef;
}
.about-image-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: 22px;
}
.send-link {
  display: inline-block;
  font-size: clamp(20px, 1.6vw, 30px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #111;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  transition: color 0.2s ease;
  font-family: inherit;
}
.send-link:hover { color: var(--accent); }

/* ---------- Message modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 210;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 40px;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 36px 32px 28px;
  position: relative;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,0.25);
}
.modal-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  font-style: italic;
}
.modal-card p.modal-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: #777;
}
.modal-card label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888;
  margin: 12px 0 6px;
}
.modal-card input,
.modal-card textarea {
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  color: #111;
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease;
}
.modal-card input:focus,
.modal-card textarea:focus { border-color: var(--accent); }
.modal-card textarea { min-height: 130px; resize: vertical; }
.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  gap: 12px;
}
.modal-actions button {
  background: #111;
  color: #fff;
  border: 0;
  padding: 12px 26px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease;
  font-weight: 600;
}
.modal-actions button:hover { transform: translateY(-1px); }
.modal-actions button[disabled] { opacity: 0.5; cursor: default; transform: none; }
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: #111;
  cursor: pointer;
  font-size: 22px;
  opacity: 0.55;
  line-height: 1;
}
.modal-close:hover { opacity: 1; }
.modal .form-status {
  font-size: 12px;
  color: #777;
  min-height: 16px;
}
.modal .form-status.error { color: #c33; }
.modal .form-status.ok { color: #2a8a4a; }

/* ---------- Footer (subtle) ---------- */
.site-foot {
  padding: 20px var(--side-pad) 30px;
  color: #aaa;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: left;
}

/* ---------- Mobile fallback: stack tiles ---------- */
@media (max-width: 800px) {
  :root { --side-pad: 18px; }
  .site-header { padding: 18px var(--side-pad) 12px; }
  .site-header .brand,
  .site-header nav { font-size: 16px; }
  .canvas { display: block; min-height: 0 !important; }
  .tile {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    margin: 6px 0 14px !important;
  }
  .tile.fit-contain { aspect-ratio: 3 / 4 !important; }
  main { padding: 0 0 40px; }
  .about-grid { padding: 12px var(--side-pad) 40px; gap: 18px; }
}
