/* ============================================================
   IronHill Community — design system
   Navy board / chalk type / pop-blue accents (no orange)
   ============================================================ */
@import url('/assets/fonts/fonts.css');

:root {
  --navy: #021f3f;
  --navy-deep: #011226;
  --navy-raise: #0a2c52;
  --ink: #f2f2f2;
  --ink-dim: #b2b2b2;
  --blue: #0442bf;
  --blue-bright: #2f6fe8;
  --blue-text: #7da7f5;
  --line: rgba(242, 242, 242, 0.1);
  --card: rgba(242, 242, 242, 0.045);
  --danger: #e05252;
  --ok: #3ecf8e;
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Montserrat', 'Helvetica Neue', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background:
    /* faint argyle diamonds, brandbook pattern */
    repeating-linear-gradient(60deg, transparent 0 34px, rgba(4, 66, 191, 0.05) 34px 35px),
    repeating-linear-gradient(-60deg, transparent 0 34px, rgba(4, 66, 191, 0.05) 34px 35px),
    radial-gradient(120% 90% at 50% 0%, var(--navy) 0%, var(--navy-deep) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  position: relative;
}

/* pop-blue trim line across the very top, like court tape */
body::before {
  content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 95;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-bright) 45%, var(--blue) 100%);
  pointer-events: none;
}

/* film grain — keeps the flat navy from feeling like a void */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

::selection { background: var(--blue); color: var(--ink); }

h1, h2, h3, .display {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.02em;
}

a { color: var(--blue-text); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

.shell { max-width: 720px; margin: 0 auto; padding: 0 16px 96px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 2px 10px;
}
.topbar img.brand { height: 50px; display: block; }
.topbar .actions { display: flex; gap: 8px; align-items: center; }

.iconbtn {
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  min-height: 40px; padding: 6px 12px;
  font-family: var(--font-display); text-transform: uppercase;
  font-size: 13px; letter-spacing: 0.06em; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.iconbtn:hover { border-color: var(--blue-bright); }
.iconbtn.primary { background: var(--blue); border-color: var(--blue); }
.iconbtn.primary:hover { background: var(--blue-bright); }
.iconbtn.danger { color: var(--danger); }

/* ---------- Week strip calendar ---------- */
.calbar { position: sticky; top: 0; z-index: 30; margin: 0 -16px; padding: 8px 16px 10px;
  background: linear-gradient(180deg, var(--navy-deep) 78%, transparent);
}
.weekrow { display: flex; align-items: stretch; gap: 6px; }
.weeknav {
  flex: 0 0 34px; background: none; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink-dim); font-size: 18px; line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}
.weeknav:hover { color: var(--ink); border-color: var(--blue-bright); }
.days { display: flex; flex: 1; gap: 6px; }
.day {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink-dim);
  padding: 7px 0 6px; text-align: center; position: relative;
  transition: transform 0.12s, border-color 0.15s, background 0.15s, color 0.15s;
}
.day .dow { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; }
.day .num { display: block; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.2; color: var(--ink); }
.day.today .dow { color: var(--blue-text); }
.day.selected { background: var(--blue); border-color: var(--blue); color: rgba(242,242,242,0.85); transform: translateY(-2px); }
.day.selected .num, .day.selected .dow { color: var(--ink); }
.day .dot { /* brand diamond, not a plain dot */
  position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%) rotate(45deg);
  width: 5px; height: 5px; background: var(--blue-bright);
}
.day.selected .dot { background: var(--ink); }

/* ---------- Date heading ---------- */
.datehead { padding: 22px 2px 6px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.datehead h1 {
  font-size: clamp(30px, 8.5vw, 44px); line-height: 1.0; letter-spacing: 0.01em;
  position: relative; padding-left: 16px;
}
.datehead h1::before { /* skewed pop-blue slash, echoes the logo's italic H */
  content: ''; position: absolute; left: 0; top: 6%; bottom: 4%; width: 7px;
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
  transform: skewX(-12deg);
}
.datehead h1 .year { color: var(--blue-text); font-weight: 500; font-size: 0.55em; letter-spacing: 0.12em; }
.todaybtn {
  background: none; border: none; color: var(--blue-text);
  font-family: var(--font-display); text-transform: uppercase; font-weight: 600;
  font-size: 13px; letter-spacing: 0.08em; padding: 6px 0; white-space: nowrap;
}

/* ---------- Workout sections ---------- */
.board { display: grid; gap: 14px; padding-top: 12px; counter-reset: sec; }
.board .section { counter-increment: sec; }
.board .section::after { /* ghost block numeral, competition-poster style */
  content: counter(sec, decimal-leading-zero);
  position: absolute; right: 10px; top: -6px;
  font-family: var(--font-display); font-weight: 700; font-size: 58px; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(125, 167, 245, 0.16);
  transform: skewX(-8deg);
  pointer-events: none;
}

.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 18px;
  position: relative;
  overflow: hidden;
  animation: rise 0.35s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.section:nth-child(2) { animation-delay: 0.05s; }
.section:nth-child(3) { animation-delay: 0.1s; }
.section:nth-child(4) { animation-delay: 0.15s; }
.section:nth-child(5) { animation-delay: 0.2s; }
.section:nth-child(n+6) { animation-delay: 0.25s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.section::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--blue-bright), var(--blue));
}
.section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { font-size: 21px; letter-spacing: 0.04em; }
.tag {
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase;
  font-size: 12px; letter-spacing: 0.1em;
  color: var(--ink); background: var(--blue);
  border-radius: 4px; padding: 3px 10px 2px;
  transform: skewX(-8deg); /* italic chip, like the logo's H */
}
.tag.ghost { background: none; border: 1px solid rgba(125, 167, 245, 0.45); color: var(--blue-text); }

.lines { list-style: none; display: grid; gap: 2px; }
.lines li {
  padding: 5px 0; border-bottom: 1px dashed rgba(242, 242, 242, 0.07);
  font-size: 15.5px; font-weight: 500;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.lines li:last-child { border-bottom: none; }

/* PR percentage chip */
.prchip {
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--navy-deep); background: var(--ink);
  padding: 2px 9px; border-radius: 4px; white-space: nowrap;
  transform: skewX(-8deg);
}
.prhint {
  margin-top: 10px; font-size: 13px; color: var(--ink-dim);
  border: 1px dashed var(--line); border-radius: 10px; padding: 9px 12px;
}
.prhint button { background: none; border: none; color: var(--blue-text); font-weight: 600; font-size: 13px; padding: 0; }

.empty {
  text-align: center; padding: 64px 16px; color: var(--ink-dim);
  animation: rise 0.35s both;
}
.empty .big { font-family: var(--font-display); text-transform: uppercase; font-weight: 700; font-size: 26px; color: var(--ink); margin-bottom: 6px; }
.empty img { height: 96px; opacity: 0.35; margin-bottom: 18px; }

/* ---------- Modal (PRs / login) ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(1, 18, 38, 0.8); backdrop-filter: blur(4px);
  align-items: flex-end; justify-content: center;
}
.modal-wrap.open { display: flex; }
.modal {
  background: var(--navy); border: 1px solid var(--line);
  border-radius: 18px 18px 0 0; width: min(680px, 100%);
  max-height: 86dvh; overflow: auto; padding: 20px 18px 28px;
  animation: slideup 0.25s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 700px) {
  .modal-wrap { align-items: center; }
  .modal { border-radius: 18px; }
}
.modal h2 { font-size: 22px; margin-bottom: 4px; }
.modal .sub { color: var(--ink-dim); font-size: 13.5px; margin-bottom: 16px; }
.modal-close { float: right; background: none; border: none; color: var(--ink-dim); font-size: 26px; line-height: 1; }

.unit-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.unit-toggle button {
  background: none; border: none; color: var(--ink-dim); padding: 8px 18px;
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px;
}
.unit-toggle button.active { background: var(--blue); color: var(--ink); }

.prlist { display: grid; gap: 8px; }
.prrow {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--card);
}
.prrow label { flex: 1; font-weight: 600; font-size: 14.5px; }
.prrow input {
  width: 96px; text-align: right;
  background: var(--navy-deep); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
}
.prrow input:focus { outline: none; border-color: var(--blue-bright); }
.prrow .u { color: var(--ink-dim); font-size: 13px; width: 20px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim); font-weight: 600; }
.field input[type="text"], .field input[type="password"], .field input[type="date"], .field select, .field textarea {
  background: var(--navy-deep); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  width: 100%;
}
.field :focus { outline: none; border-color: var(--blue-bright); }

.formmsg { font-size: 13.5px; min-height: 20px; }
.formmsg.err { color: var(--danger); }
.formmsg.ok { color: var(--ok); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--navy-deep);
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 10px 20px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 100; font-size: 14px;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
.foot {
  margin-top: 40px; text-align: center; color: var(--ink-dim);
  font-size: 12px; letter-spacing: 0.04em;
}
.foot a { color: var(--ink-dim); text-decoration: none; }
.foot a:hover { color: var(--blue-text); }
