/* ==========================================================================
   Layout concept
   One sticky header (name centred, nav right). Three views swapped by #hash.
   Home: blurred portrait, name centred, three curled arrows to three players.
   Edits: three category grids. Contact: one section split in two.
   ========================================================================== */

:root {
  /* palette from the brief */
  --bg: #ffffff;
  --ink: #000000;            /* button text */
  --amber: #fca311;          /* text + accent. Change this one value to retune every heading and caption */
  --amber-tint: #fff3d9;
  --wa: #25d366;             /* WhatsApp green */

  /* type from the brief */
  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Lora", Georgia, "Times New Roman", serif;

  /* measured at runtime by app.js */
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--amber);
  font: 500 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* the band above a sticky header on phones with a notch */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  background: var(--bg); z-index: 60;
}

.wrap {
  width: 100%; max-width: 1500px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--bg); border-bottom: 2px solid var(--amber);
}
.bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  column-gap: 1rem; min-height: 76px;
}
.brand {
  grid-column: 2; text-decoration: none; color: var(--amber);
  font: 800 clamp(1.55rem, 2.5vw, 2.15rem)/1 var(--font-head); letter-spacing: .01em;
}
.nav { grid-column: 3; justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.nav a {
  text-decoration: none; color: var(--ink);
  font: 700 .78rem/1 var(--font-body); letter-spacing: .09em;
  padding: .65rem 1.05rem; border: 2px solid var(--amber); border-radius: 999px;
  transition: background-color .18s ease;
}
.nav a:hover { background: var(--amber-tint); }
.nav a[aria-current="page"] { background: var(--amber); }

@media (max-width: 720px) {
  .bar { grid-template-columns: 1fr; justify-items: center; row-gap: .6rem; padding-block: .75rem; }
  .brand, .nav { grid-column: 1; }
  .nav { justify-self: center; justify-content: center; }
  .nav a { padding: .6rem .95rem; }
}

/* ---------- Player (shared by Home and Edits) ---------- */
.player {
  position: relative; margin: 0; width: 100%; aspect-ratio: var(--ar, 16 / 9);
  border: 3px solid var(--amber); border-radius: 12px; overflow: hidden;
  background: #1a1a1a; box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
}
.player .poster, .player video, .player iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.player iframe { border: 0; background: #000; }
.player .poster { object-fit: cover; }
.player video { background: #000; object-fit: contain; }

.play {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0;
  background: transparent; cursor: pointer; display: grid; place-items: center;
}
.play-icon {
  width: clamp(46px, 22%, 68px); aspect-ratio: 1; border-radius: 50%;
  background: var(--amber); color: var(--ink); display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35); transition: transform .18s ease;
}
.play-icon svg { width: 44%; height: 44%; margin-left: 6%; }
.play:hover .play-icon, .play:focus-visible .play-icon { transform: scale(1.1); }
.play:focus-visible { outline-offset: -6px; }

.pill {
  position: absolute; left: 10px; top: 10px; z-index: 2; pointer-events: none;
  background: var(--amber); color: var(--ink); border-radius: 999px;
  font: 700 .74rem/1 var(--font-body); padding: .4rem .65rem;
}
.dur {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; pointer-events: none;
  background: rgba(0, 0, 0, .78); color: var(--amber); border-radius: 6px;
  font: 600 .78rem/1 var(--font-body); padding: .32rem .45rem; font-variant-numeric: tabular-nums;
}
.player.is-playing .poster, .player.is-playing .play, .player.is-playing .pill, .player.is-playing .dur { display: none; }

.player-error {
  position: absolute; inset: auto 0 0 0; z-index: 3; margin: 0; padding: .6rem .8rem;
  background: var(--ink); color: var(--amber); font: 600 .85rem/1.35 var(--font-body);
}

.player.is-empty {
  display: grid; place-items: center; text-align: center; padding: 1rem;
  background: rgba(255, 255, 255, .08); border-style: dashed; box-shadow: none;
  color: var(--amber); font: italic 600 1rem/1.4 var(--font-head);
}
.edits .player.is-empty { background: var(--amber-tint); }

/* star: a badge for visitors, a toggle in owner mode */
.star {
  position: absolute; right: 10px; top: 10px; z-index: 4; width: 38px; height: 38px;
  border-radius: 50%; border: 2px solid var(--ink); background: var(--amber); color: var(--ink);
  display: grid; place-items: center; padding: 0;
}
.star svg { width: 20px; height: 20px; }
.star svg path { fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
button.star { cursor: pointer; }
button.star[aria-pressed="false"] { background: #fff; }
button.star[aria-pressed="false"] svg path { fill: none; }
button.star:hover { transform: scale(1.08); }
.player.is-playing .star { display: none; }

/* ---------- Home ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate; background: #1c1c1c;
  min-height: max(700px, calc(100svh - var(--header-h) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  display: flex;
}
.hero-photo {
  position: absolute; inset: -8%; width: 116%; max-width: none; height: 116%; z-index: -2;
  object-fit: cover; filter: blur(22px) saturate(1.05);
}
.hero-shade { position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, .5); }

.hero-stage {
  position: relative; flex: 1;
  display: grid; align-items: center; justify-items: center;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  padding-block: clamp(20px, 4vh, 44px);
}
.hero-name {
  grid-column: 2; grid-row: 2; position: relative; z-index: 2; margin: 0; padding-inline: clamp(0px, 2vw, 28px);
  font: 800 clamp(3rem, 7.4vw, 7.2rem)/.95 var(--font-head); letter-spacing: -.01em;
  color: var(--amber); text-align: center; text-shadow: 0 6px 34px rgba(0, 0, 0, .5);
  width: max-content; max-width: 100%;
}
.arrows {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible;
}
.arrows path {
  fill: none; stroke: var(--amber); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .55));
}
.arrows.is-drawing path { animation: draw 1.15s cubic-bezier(.55, .05, .25, 1) backwards; }
.arrows.is-drawing path:nth-child(2) { animation-delay: .22s; }
.arrows.is-drawing path:nth-child(3) { animation-delay: .44s; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.hero-card { position: relative; z-index: 2; width: var(--w); display: flex; flex-direction: column; gap: .8rem; }
.hero-card .cap {
  margin: 0; width: max(100%, 14rem); color: var(--amber); text-wrap: balance;
  font: italic 700 clamp(1.1rem, 1.5vw, 1.4rem)/1.25 var(--font-head); text-shadow: 0 2px 16px rgba(0, 0, 0, .6);
}
.hero-card.short  { --w: clamp(104px, min(11vw, 15vh), 176px); grid-column: 1; grid-row: 1; justify-self: start; align-self: start; }
.hero-card.colour { --w: clamp(230px, 22vw, 340px); grid-column: 1; grid-row: 3; justify-self: start; align-self: end; margin-left: clamp(0px, 5vw, 90px); }
.hero-card.long   { --w: clamp(260px, 26vw, 400px); grid-column: 3; grid-row: 3; justify-self: end; align-self: end; }

.hero :focus-visible { outline-color: #fff; }

/* phone and small tablet: one column, cards zig-zag, arrows chain down the page */
@media (max-width: 860px) {
  .hero { min-height: 0; }
  .hero-stage {
    display: flex; flex-direction: column; gap: 6.4rem; align-items: stretch;
    padding-block: 2.4rem 3rem;
  }
  .hero-name { grid-column: auto; grid-row: auto; align-self: center; font-size: clamp(3rem, 15vw, 5rem); }
  .hero-card { grid-column: auto; grid-row: auto; margin-left: 0; }
  .hero-card.short  { --w: min(52%, 220px); align-self: flex-start; }
  .hero-card.long   { --w: min(92%, 420px); align-self: flex-end; }
  .hero-card.colour { --w: min(84%, 380px); align-self: flex-start; }
  .hero-card .cap { width: 100%; }
}

/* ---------- Edits ---------- */
.edits { padding-block: clamp(28px, 5vw, 64px) clamp(60px, 8vw, 110px); display: flex; flex-direction: column; gap: clamp(48px, 7vw, 92px); }
.cat + .cat { border-top: 2px solid var(--amber); padding-top: clamp(40px, 6vw, 80px); }
.cat-head { display: flex; flex-direction: column; gap: .75rem; margin-bottom: clamp(20px, 3vw, 34px); }
.cat-head h2 {
  margin: 0; max-width: 22ch; text-wrap: balance;
  font: 800 clamp(2rem, 4.6vw, 3.6rem)/1.05 var(--font-head); letter-spacing: -.01em;
}
.cat-meta { margin: 0; display: flex; align-items: center; gap: .7rem; font-weight: 600; }
.cat-meta .pill { position: static; display: inline-block; }

.grid { display: grid; gap: clamp(16px, 2.2vw, 30px); }
.grid[data-cat="short"]  { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.grid[data-cat="long"],
.grid[data-cat="colour"] { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.card { min-width: 0; display: flex; flex-direction: column; gap: .7rem; }
.card-title { margin: 0; font: 700 1.1rem/1.3 var(--font-head); }
.empty-note {
  margin: 0; padding: 1.6rem; border: 2px dashed var(--amber); border-radius: 12px; background: var(--amber-tint);
  font: italic 600 1.05rem/1.5 var(--font-head);
}

/* ---------- Contact ---------- */
.contact {
  display: grid; grid-template-columns: 1fr 1fr; border-bottom: 2px solid var(--amber);
  min-height: max(420px, calc(100svh - var(--header-h) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
}
.half {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem;
  text-align: center; text-decoration: none; color: var(--ink); background: var(--bg);
  padding-block: 3rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.half + .half { border-left: 2px solid var(--amber); }
.half::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  transition: opacity .35s ease;
}
.half.wa::before { background: var(--wa); }
.half.ig::before {
  background: linear-gradient(135deg, #feda75 0%, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5 100%);
}
.half:hover::before, .half:focus-visible::before, .half:active::before { opacity: 1; }
.half-name { font: 800 clamp(2.5rem, 7vw, 6rem)/1 var(--font-head); letter-spacing: -.01em; }
.half-sub { font: italic 600 clamp(1.05rem, 1.6vw, 1.3rem)/1.4 var(--font-body); }
.half:focus-visible { outline-offset: -8px; }

@media (max-width: 720px) {
  .contact { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .half + .half { border-left: 0; border-top: 2px solid var(--amber); }
}

/* ---------- Owner tools ---------- */
.owner-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: var(--ink); color: var(--amber);
  padding-top: .8rem; padding-bottom: calc(.8rem + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; font-size: .95rem;
}
.owner-msg { margin: 0; flex: 1 1 22rem; min-width: 0; line-height: 1.4; }
.owner-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.owner-actions button {
  font: 700 .85rem/1 var(--font-body); color: var(--ink); background: var(--amber);
  border: 0; border-radius: 999px; padding: .65rem 1rem; cursor: pointer;
}
.owner-out { flex: 1 1 100%; min-width: 0; font: .8rem/1.4 ui-monospace, Menlo, Consolas, monospace; background: #151515; color: #f2f2f2; border: 1px solid #444; border-radius: 8px; padding: .6rem; }
.owner-bar :focus-visible { outline-color: #fff; }
body.has-owner-bar .edits { padding-bottom: 12rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0s !important; }
}
