/* ============================================================
   TGC — TORONTO GRID CLUB
   Deepest black, orange heat, heaviest grain. The race-day world.
   ============================================================ */

/* ---------- HERO ---------- */
.thero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: 1.4rem;
  overflow: hidden;
  padding-block: 7rem 3rem;
}
.thero .thero__bg {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
  object-position: 50% 85%;   /* the car, not the sky */
  opacity: 0.55;
  filter: saturate(0.85) contrast(1.12);
  transition: opacity 1.2s;
}
/* Brighter than the flat photo: the depth is the point, and the
   gradient below still holds the copy. */
.thero .thero__room {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.2s;
  filter: saturate(0.85) contrast(1.12);
}
.thero[data-room] .thero__room { opacity: 0.78; }
.thero[data-room] .thero__bg { opacity: 0; }
/* Copy sits on a dark left edge; the car keeps the bottom of the frame
   and only the last strip fades into the rail below. */
.thero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--ground) 88%, transparent) 0%, color-mix(in srgb, var(--ground) 55%, transparent) 38%, transparent 66%),
    linear-gradient(180deg, var(--ground) 0%, transparent 24%, transparent 80%, var(--ground) 100%);
}
/* On a phone the copy spans the full width, so the whole frame dims. */
@media (max-width: 700px) {
  .thero::after {
    background:
      linear-gradient(color-mix(in srgb, var(--ground) 58%, transparent), color-mix(in srgb, var(--ground) 58%, transparent)),
      linear-gradient(180deg, var(--ground) 0%, transparent 24%, transparent 80%, var(--ground) 100%);
  }
}
.thero > * { position: relative; z-index: 2; }
.thero__mark { width: min(64vw, 480px); }
.thero__h1 {
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.4rem, 1rem + 6vw, 6.5rem); line-height: 0.9;
  max-width: 15ch;
}

/* ---------- THE VENUE ---------- */
.venue { padding-block: var(--space-section); }
.venue__grid { display: grid; gap: clamp(1.6rem, 4vw, 4rem); align-items: center; }
@media (min-width: 960px) { .venue__grid { grid-template-columns: 1.1fr 0.9fr; } }

.venue__card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(1.4rem, 3vw, 2.6rem);
  display: grid; gap: 1px;
  transform-style: preserve-3d;
  will-change: transform;
}
.venue__row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.venue__row:last-child { border-bottom: 0; }
.venue__val { font-family: var(--display-face); font-weight: 700; text-transform: uppercase; }

/* ---------- THE RITUALS: styles/tgc-rituals.css ---------- */

/* ---------- SEASON CALENDAR ---------- */
.cal { padding-block: var(--space-section); }
.cal__list { display: grid; }
.cal__row {
  position: relative;
  display: grid;
  grid-template-columns: 3.4rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding-block: clamp(0.85rem, 1.7vw, 1.3rem);
  border-bottom: 1px solid var(--line);
  transition: background var(--d2) var(--ease-out), padding-left var(--d2) var(--ease-out);
}
.cal__row:first-child { border-top: 1px solid var(--line); }
.cal__row:hover { background: var(--surface); padding-left: 0.9rem; }
.cal__no { color: var(--accent); }
.cal__name {
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.1rem, 0.9rem + 1.1vw, 1.9rem); line-height: 1;
}
.cal__art {
  position: absolute;
  right: clamp(1rem, 6vw, 7rem);
  top: 50%;
  width: clamp(80px, 9vw, 130px);
  aspect-ratio: 1;
  transform: translateY(-50%) scale(0.86);
  opacity: 0;
  pointer-events: none;
  color: var(--accent);
  transition: opacity var(--d2) var(--ease-out), transform var(--d3) var(--ease-out);
}
.cal__row:hover .cal__art { opacity: 1; transform: translateY(-50%) scale(1); }

/* ---------- THE CROWD ---------- */
.crowd { padding-block: var(--space-section); overflow: hidden; }
.crowd__strip { display: flex; gap: clamp(0.5rem, 1.1vw, 1rem); cursor: grab; user-select: none; will-change: transform; }
.crowd__strip.drag { cursor: grabbing; }
.crowd__fig {
  flex: 0 0 auto; margin: 0;
  width: clamp(190px, 23vw, 340px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
}
.crowd__fig img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.7) contrast(1.14) sepia(0.18);
  transition: filter var(--d3) var(--ease-out), transform var(--d4) var(--ease-out);
}
.crowd__fig:hover img { filter: grayscale(0) contrast(1.04) sepia(0); transform: scale(1.05); }

/* ============================================================
   TGC — the photo essay
   Race day told in frames rather than paragraphs.
   ============================================================ */
.essay { padding-block: var(--space-section); border-top: 1px solid var(--line); }
.essay__head { display: grid; gap: 1rem; margin-bottom: clamp(1.8rem, 4vw, 3rem); }

.essay__grid {
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(2, 1fr);
  padding-inline: var(--gutter);
}
@media (min-width: 900px) { .essay__grid { grid-template-columns: repeat(3, 1fr); } }

.essay__cell {
  position: relative; margin: 0; overflow: hidden;
  background: var(--surface);
}
.essay__cell img {
  width: 100%; height: 100%; object-fit: cover;
  aspect-ratio: 4 / 3;
  filter: contrast(1.06) saturate(1.04);
  transition: transform var(--d4) var(--ease-out);
}
.essay__cell:hover img { transform: scale(1.04); }

.essay__cell--hero { grid-column: span 2; grid-row: span 2; }
.essay__cell--hero img { aspect-ratio: 1; }
.essay__cell--wide { grid-column: span 2; }
.essay__cell--wide img { aspect-ratio: 2; }
/* The closing frame runs the full width, so three columns end on a full
   row instead of one photo next to a hole. */
.essay__cell--full { grid-column: 1 / -1; }
.essay__cell--full img { aspect-ratio: 3; }
@media (max-width: 899px) {
  .essay__cell--hero { grid-row: span 1; }
  .essay__cell--hero img { aspect-ratio: 4 / 3; }
  .essay__cell--full { grid-column: auto; }
  .essay__cell--full img { aspect-ratio: 4 / 3; }
}

.essay__cell figcaption {
  position: absolute; inset: auto 0 0 0;
  display: grid; gap: 0.25rem;
  padding: clamp(0.9rem, 2vw, 1.4rem);
  background: linear-gradient(transparent, rgb(0 0 0 / 0.88));
}
.essay__cell figcaption strong {
  font-family: var(--display-face); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.01em;
  font-size: clamp(1rem, 0.85rem + 0.7vw, 1.6rem); line-height: 1;
}

/* The crowd strip gains captions, so a dragged frame still says where
   it was taken rather than being decoration. */
.crowd__fig { position: relative; }
.crowd__fig figcaption {
  position: absolute; inset: auto 0 0 0;
  padding: 0.5rem 0.7rem;
  color: var(--muted);
  background: linear-gradient(transparent, rgb(0 0 0 / 0.85));
  opacity: 0; transition: opacity var(--d2) var(--ease-out);
}
.crowd__fig:hover figcaption { opacity: 1; }

/* Calendar rows carry the same three states as the homepage grid:
   a spent round steps back, the next one is the only lit row. */
.cal__row[data-round="raced"] { opacity: 0.5; }
.cal__row[data-round="raced"]:hover { opacity: 1; }
.cal__row[data-round="next"] {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.cal__flag { color: var(--muted); }
.cal__row[data-round="next"] .cal__flag { color: var(--accent); }


/* ============================================================
   THE BRAND-STANDARD PIECES (scripts/tgc-kit.js, brand/ P. 14-15, S07-S08)
   ============================================================ */

/* ---------- start lights: five on, one by one, then all out ---------- */
.thero__top { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.tlights { display: flex; gap: 0.45rem; }
.tlights i {
  width: 0.9rem; height: 0.9rem; border-radius: 50%; background: #1c1c1c;
  animation: tlight 6s linear infinite;
}
.tlights i:nth-child(2) { animation-name: tlight2; }
.tlights i:nth-child(3) { animation-name: tlight3; }
.tlights i:nth-child(4) { animation-name: tlight4; }
.tlights i:nth-child(5) { animation-name: tlight5; }
@keyframes tlight  { 0%, 8%  { background: #1c1c1c; box-shadow: none; } 8.4%, 76.6% { background: #ff1d1d; box-shadow: 0 0 16px #ff1d1daa; } 77%, 100% { background: #1c1c1c; box-shadow: none; } }
@keyframes tlight2 { 0%, 20% { background: #1c1c1c; box-shadow: none; } 20.4%, 76.6% { background: #ff1d1d; box-shadow: 0 0 16px #ff1d1daa; } 77%, 100% { background: #1c1c1c; box-shadow: none; } }
@keyframes tlight3 { 0%, 31% { background: #1c1c1c; box-shadow: none; } 31.4%, 76.6% { background: #ff1d1d; box-shadow: 0 0 16px #ff1d1daa; } 77%, 100% { background: #1c1c1c; box-shadow: none; } }
@keyframes tlight4 { 0%, 43% { background: #1c1c1c; box-shadow: none; } 43.4%, 76.6% { background: #ff1d1d; box-shadow: 0 0 16px #ff1d1daa; } 77%, 100% { background: #1c1c1c; box-shadow: none; } }
@keyframes tlight5 { 0%, 55% { background: #1c1c1c; box-shadow: none; } 55.4%, 76.6% { background: #ff1d1d; box-shadow: 0 0 16px #ff1d1daa; } 77%, 100% { background: #1c1c1c; box-shadow: none; } }

/* ---------- the next circuit, glowing, with the car on it ---------- */
.tdrop {
  position: absolute; z-index: 2; right: clamp(1rem, 6vw, 7rem); top: 50%;
  width: min(36vw, 520px); translate: 0 -50%;
  display: grid; justify-items: end; gap: 1rem; pointer-events: none;
}
.tdrop__svg { width: 100%; height: auto; max-height: 62svh; overflow: visible; }
.tdrop__line {
  fill: none; stroke: var(--accent); stroke-width: 6; stroke-linejoin: round;
  stroke-dasharray: 1; filter: drop-shadow(0 0 10px var(--accent));
  animation: tdraw 11s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
.tdrop__car { fill: #050505; stroke: var(--accent); stroke-width: 4; }
.tdrop__label { color: var(--ink); }
@keyframes tdraw { 0% { stroke-dashoffset: 1; } 45%, 100% { stroke-dashoffset: 0; } }
@media (max-width: 820px) {
  .tdrop { opacity: 0.35; width: 70vw; right: -10vw; }
  .tdrop__label { display: none; }
}

/* ---------- the strap: the TGC lanyard, running ---------- */
.strap {
  overflow: hidden; background: var(--accent); color: var(--ground);
  border-block: 1px solid var(--line);
}
.strap__track {
  display: flex; width: max-content;
  animation: strapRun 38s linear infinite;
}
.strap__unit {
  display: flex; align-items: center; gap: clamp(1.4rem, 3vw, 2.8rem);
  padding: clamp(0.9rem, 1.6vw, 1.3rem) clamp(1.4rem, 3vw, 2.8rem) clamp(0.9rem, 1.6vw, 1.3rem) 0;
}
.strap__mark {
  width: clamp(11rem, 18vw, 16rem); aspect-ratio: 7171 / 1288;
  background: var(--ground);
  -webkit-mask: url("../assets/brand/tgc.png") center / contain no-repeat;
          mask: url("../assets/brand/tgc.png") center / contain no-repeat;
}
.strap__plus {
  width: 1.3rem; height: 1.3rem; background: var(--ground);
  clip-path: polygon(43% 0, 57% 0, 57% 37%, 63% 43%, 100% 43%, 100% 57%, 63% 57%, 57% 63%, 57% 100%, 43% 100%, 43% 63%, 37% 57%, 0 57%, 0 43%, 37% 43%, 43% 37%);
}
.strap__word {
  font-family: var(--font-mono); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3em; font-size: clamp(0.7rem, 0.6rem + 0.3vw, 0.95rem);
}
@keyframes strapRun { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- wristbands: one per tier, true to the print pack ---------- */
.bands { margin-top: clamp(2.4rem, 5vw, 4rem); display: grid; gap: 0.7rem; max-width: 60rem; }
.wband {
  --b: #d4ff00; --i: #0a0a0a;
  display: grid; grid-template-columns: 3rem auto 1fr; align-items: center; gap: 1rem;
  height: 3.2rem; padding-right: 1.2rem; background: var(--b); color: var(--i);
}
.wband b {
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.1rem, 0.8rem + 1vw, 1.7rem); letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 0.8rem;
}
.wband .mono { color: var(--i); opacity: 0.85; justify-self: end; }
.wband__tab {
  height: 100%;
  background: repeating-linear-gradient(135deg, rgba(0,0,0,0.14) 0 6px, transparent 6px 12px);
  border-right: 1px dashed currentColor;
}
.wband__plus { display: none; }
.wband--seated  { --b: var(--accent); --i: #050505; }
.wband--partner { --b: #f4f0ea;       --i: #050505; }
.wband--crew    { --b: #0a0a0a;       --i: #d4ff00; outline: 1px solid #2a2a2a; }
.wband--member  { --b: #f2f2f0;       --i: #0c0c0c;
  box-shadow: inset 0 -6px 0 0 #ffe600;
}

@media (prefers-reduced-motion: reduce) {
  .tlights i, .tdrop__line, .strap__track { animation: none; }
  .tlights i { background: #ff1d1d; }
  .tdrop__line { stroke-dashoffset: 0; }
  .tdrop__car { display: none; }
}
