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

/* Binghamton University brand palette.
   binghamton.edu/communications-and-marketing/branding/colors.html

   PMS 342  #005A43  Deep Green   — primary, dominant
   PMS 360  #6CC24A  Accent Green
   PMS 381  #CEDC00  Accent Yellow-Green
   PMS 424  #5A5C5B  Accent Gray

   Deep Green is the dominant color, carried by the header band and filled
   surfaces with white on top (7.4:1). It is far too dark to read as text on a
   dark ground, so the interactive accent is PMS 360; yellow-green is reserved
   for small highlights so it never competes with the primary. */
:root {
  --deep-green: #005A43;
  --deep-green-lit: #00734f;
  --accent: #6CC24A;
  --accent-dim: #4e9e33;
  --highlight: #CEDC00;
  --brand-gray: #5A5C5B;

  --bg: #0b0f0d;
  --surface: #131817;
  --surface-2: #1a201e;
  --border: #253029;
  --border-lit: #33443a;

  --text: #e6ebe8;
  --text-muted: #96a29b;
  --red: #f87171;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── controls ── */

button {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #08130a;
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  transition: background 0.15s, opacity 0.15s;
}
button:hover { background: #7ed15b; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

button.ghost {
  background: transparent;
  border: 1px solid var(--border-lit);
  color: var(--text-muted);
  font-weight: 600;
}
button.ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--accent-dim); }

button.danger { background: transparent; border: 1px solid var(--border-lit); color: var(--red); font-weight: 600; }
button.danger:hover { background: rgba(248, 113, 113, 0.12); border-color: var(--red); }

button.small { font-size: 12.5px; padding: 6px 12px; }

input[type="password"], input[type="text"], input[type="date"], textarea, select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 78px; line-height: 1.5; }
input[type="date"] { color-scheme: dark; }

label.field { display: block; }
label.field > span {
  color: var(--text-muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
}

.card-title {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.err { color: var(--red); font-size: 13px; }
.ok  { color: var(--accent); font-size: 13px; }
.muted { color: var(--text-muted); }

/* ── page frame ── */

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Deep Green band — the dominant brand element on every page. */
.site-header {
  background: var(--deep-green);
  border-bottom: 3px solid var(--highlight);
  padding: 26px 0;
  margin-bottom: 34px;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.site-header h1 {
  color: #fff;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.site-header .tag {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  margin-top: 3px;
}

.site-header a { color: #fff; }
.site-header .actions { display: flex; gap: 10px; }
.site-header .actions button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 13px;
  padding: 8px 14px;
}
.site-header .actions button:hover { background: rgba(255, 255, 255, 0.22); }

.site-header .actions a.navbtn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  min-height: 38px;
  padding: 8px 14px;
  white-space: nowrap;
}
.site-header .actions a.navbtn:hover {
  background: rgba(255, 255, 255, 0.22);
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 60px;
  padding: 22px 0 40px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── feed / archive navigation ── */

.feed-nav { display: flex; justify-content: center; margin-top: 38px; }
.feed-nav:empty { display: none; }
.feed-nav a {
  align-items: center;
  border: 1px solid var(--border-lit);
  border-radius: 8px;
  color: var(--text);
  display: inline-flex;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  min-height: 46px;
  padding: 12px 22px;
  text-align: center;
}
.feed-nav a:hover {
  background: var(--surface-2);
  border-color: var(--accent-dim);
  color: var(--accent);
  text-decoration: none;
}

/* ── empty states ── */

.empty {
  border: 1px dashed var(--border-lit);
  border-radius: 10px;
  color: var(--text-muted);
  padding: 46px 24px;
  text-align: center;
}
.empty strong { color: var(--text); display: block; margin-bottom: 6px; font-size: 15px; }
.empty span { font-size: 14px; }

/* ── practice feed ── */

.practice { margin-bottom: 42px; }

.practice-head {
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 10px;
}

.practice-head h2 {
  font-size: 17px;
  font-weight: 700;
}
/* Yellow-green marks the day — a small highlight, never a large field. */
.practice-head h2::before {
  background: var(--highlight);
  border-radius: 2px;
  content: '';
  display: inline-block;
  height: 15px;
  margin-right: 10px;
  vertical-align: -2px;
  width: 4px;
}
.practice-head .count { color: var(--text-muted); font-size: 13px; }

.clip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 18px;
}

/* Sticky so the video stays on screen while you read down a long note list —
   tapping a note near the bottom shouldn't scroll the clip out of view.
   This is why .clip and .clip-main cannot use overflow:hidden. */
.clip-media {
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 2;
}

.clip video, .clip .poster {
  aspect-ratio: 16 / 9;
  background: #000;
  display: block;
  width: 100%;
  object-fit: cover;
}

.clip .poster { border: none; cursor: pointer; padding: 0; position: relative; }
.clip .poster img { display: block; height: 100%; object-fit: cover; width: 100%; }

.clip .poster .play {
  align-items: center;
  background: rgba(0, 90, 67, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  height: 62px;
  justify-content: center;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: background 0.15s, transform 0.15s;
  width: 62px;
}
.clip .poster:hover .play { background: var(--deep-green-lit); transform: translate(-50%, -50%) scale(1.06); }
.clip .poster .play::after {
  border-left: 17px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  content: '';
  margin-left: 5px;
}

.clip .poster .noframe {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  font-size: 13px;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.clip-info { padding: 15px 18px 17px; }
.clip-side { padding: 0 18px 17px; }

.clip-caption { font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; }
.clip-caption.none { color: var(--text-muted); font-style: italic; }

.clip-meta {
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  margin-top: 9px;
}
.clip-meta .dot { opacity: 0.5; }

.clip-actions { display: flex; gap: 8px; margin-top: 13px; flex-wrap: wrap; }

/* ── coaching notes ── */

.notes { margin-top: 15px; }
.notes:empty { margin-top: 0; }

.notes-head {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding-top: 13px;
  margin-bottom: 8px;
}

.note {
  align-items: flex-start;
  border-radius: 8px;
  display: flex;
  gap: 4px;
}

/* The whole row is the jump target — a timestamp chip alone would be a
   fiddly tap on a phone. */
.note-jump {
  align-items: flex-start;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text);
  display: flex;
  flex: 1;
  font: inherit;
  gap: 10px;
  min-height: 44px;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
}
button.note-jump { cursor: pointer; }
button.note-jump:hover { background: var(--surface-2); }
.note.current { background: rgba(108, 194, 74, 0.10); box-shadow: inset 2px 0 0 var(--accent); }
.note.current .stamp { background: var(--accent); border-color: var(--accent); color: #08130a; }

.stamp {
  background: var(--surface-2);
  border: 1px solid var(--border-lit);
  border-radius: 5px;
  color: var(--accent);
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  white-space: nowrap;
}
.stamp.none { border-color: var(--border); color: var(--text-muted); }

.note-body { font-size: 14px; line-height: 1.5; padding-top: 2px; white-space: pre-wrap; }
.note.general .note-body { color: var(--text-muted); }

.note-tools { display: flex; gap: 4px; padding-top: 9px; flex-shrink: 0; }
.note-tools button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  min-height: 36px;
  padding: 4px 8px;
}
.note-tools button:hover { background: var(--surface-2); color: var(--text); }
.note-tools button.rm:hover { color: var(--red); }

.show-all { margin-top: 6px; }

/* ── note composer (coach) ── */

.composer {
  background: var(--surface-2);
  border: 1px solid var(--border-lit);
  border-radius: 8px;
  margin-top: 14px;
  padding: 13px;
}
.composer-head {
  align-items: center;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.composer-head .label { color: var(--text-muted); font-size: 12.5px; }
.composer textarea { background: var(--bg); min-height: 62px; font-size: 14px; }
.composer-foot { display: flex; gap: 9px; margin-top: 10px; align-items: center; flex-wrap: wrap; }

/* ── desktop: notes beside the video ──────────────────────────────────────────
   Below this width nothing changes — the columns simply stack, exactly as they
   do today on a phone. The split is a ratio, not fixed columns, so it tracks
   the window: the video takes 1.5 parts to the notes' 1, which puts the video's
   right edge past the page centre while the notes stay entirely right of it. */

@media (min-width: 1200px) {
  .wrap { max-width: clamp(1120px, 94vw, 1560px); }

  .clip {
    align-items: stretch;
    column-gap: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }

  /* One cell spanning the clip's full height, so the sticky video inside it can
     travel the whole way down a tall notes column instead of stopping short. */
  .clip-main { display: flex; flex-direction: column; min-width: 0; }

  /* The card's top-right corner belongs to the notes column now. */
  .clip-media { border-radius: 10px 0 0 0; }

  .clip-side {
    border-left: 1px solid var(--border);
    min-width: 0;
    padding: 0;
    position: relative;
  }

  /* Out of flow, so the notes contribute nothing to the row height: the card is
     sized by the video column and the list scrolls within it. Without
     overscroll-behavior, a wheel gesture that bottoms out here would chain to
     the page and yank the whole feed. */
  .clip-scroll {
    inset: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 20px 18px;
    position: absolute;
    scrollbar-color: var(--border-lit) transparent;
    scrollbar-width: thin;
  }
  .clip-scroll::-webkit-scrollbar { width: 10px; }
  .clip-scroll::-webkit-scrollbar-track { background: transparent; }
  .clip-scroll::-webkit-scrollbar-thumb {
    background: var(--border-lit);
    border: 3px solid var(--surface);
    border-radius: 999px;
  }
  .clip-scroll::-webkit-scrollbar-thumb:hover { background: var(--brand-gray); }

  /* Keeps the "31 notes" count in view while the list moves under it. */
  .clip-scroll .notes-head {
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 1;
  }

  /* A column divider already separates the notes; a second rule above the
     heading would just be noise. */
  .clip-side .notes { margin-top: 0; }
  .clip-side .notes-head { border-top: none; padding-top: 14px; }

  /* The upload form has no business stretching to 1500px. */
  #panel > main > .card { max-width: 900px; }
}

@media (max-width: 560px) {
  .site-header h1 { font-size: 19px; }
  .site-header .wrap { gap: 10px; }
  .site-header .actions a.navbtn,
  .site-header .actions button { font-size: 12.5px; padding: 7px 11px; min-height: 34px; }
  .feed-nav a { font-size: 13.5px; padding: 11px 16px; }
  .clip-body { padding: 13px 13px 15px; }
  .note-jump { gap: 9px; padding: 9px 6px; }
  .note-body { font-size: 13.5px; }
  .wrap { padding: 0 14px; }
}
