/*
 * download.tournament.app. Look and palette follow the tournament.app landing page
 * (tio-manual root/index.html): dark top bar, Roboto, the sport tree with colored rails.
 * After a change: bump SITE_VERSION in src/site.js.
 */
@font-face {
  font-family: 'Roboto';
  font-weight: 400;
  font-display: swap;
  src: url(fonts/roboto-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Roboto';
  font-weight: 500;
  font-display: swap;
  src: url(fonts/roboto-latin-500-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Roboto Condensed';
  font-weight: 700;
  font-display: swap;
  src: url(fonts/roboto-condensed-latin-700-normal.woff2) format('woff2');
}

:root {
  color-scheme: light dark;
  --green: #8dbd6b;
  --green-text: #3c6a1d;
  --bar: #1b1b1b;
  --bar-text: #ffffff;
  --bar-muted: #9b9b9a;
  --bg: #f4f4f4;
  --panel: #ffffff;
  --text: #202020;
  --muted: #6f6f6f;
  --line: #e8e8e8;
  --hover: #fafafa;
  --focus: #43a4f5;
  --stub: 1.75rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --green-text: var(--green);
    --bg: #121212;
    --panel: #171717;
    --text: #e5e5e5;
    --muted: #969696;
    --line: #262626;
    --hover: #232323;
  }
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', 'Helvetica', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
}
h1,
h2 {
  font-family: 'Roboto Condensed', 'Roboto', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}
p {
  margin: 0;
}
a {
  color: var(--green-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.85em;
  background: var(--line);
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  overflow-wrap: anywhere;
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Top bar */
.bar {
  background: var(--bar);
  color: var(--bar-text);
}
.bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--bar-text);
  font-family: 'Roboto Condensed', 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1;
}
.brand:hover {
  text-decoration: none;
}
.brand svg,
.tree .root svg {
  width: 1.6rem;
  height: 1.6rem;
  flex: none;
  color: var(--green);
}
.bar nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}
.bar nav a {
  color: var(--bar-muted);
}
.bar nav a:hover {
  color: var(--bar-text);
  text-decoration: none;
}

/* Hero: headline + the app tree */
.hero {
  padding-block: 4rem 3.5rem;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 3rem 4rem;
  align-items: start;
}
.hero h1 {
  font-size: clamp(2.5rem, 5.2vw, 4rem);
}
.lead {
  margin-top: 1.5rem;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 32rem;
}
.notice {
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--green);
  background: var(--panel);
  border-radius: 0 0.5rem 0.5rem 0;
}
main > .notice {
  margin-block: 3rem;
}

.tree {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.tree .root {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 2.5rem;
  position: relative;
  margin-left: -0.2rem;
  font-family: 'Roboto Condensed', 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1;
}
.tree .root::after {
  content: '';
  position: absolute;
  left: calc(0.5rem - 1px);
  top: calc(50% + 0.95rem);
  bottom: 0;
  width: 2px;
  background: var(--first);
}
.branch {
  position: relative;
  padding-left: calc(var(--stub) + 0.5rem + 0.75rem);
}
.branch::before,
.branch::after {
  content: '';
  position: absolute;
  left: calc(0.5rem - 1px);
  width: 2px;
  transform-origin: top;
  animation: grow-y 200ms ease-out both;
}
.branch::before {
  top: 0;
  height: 50%;
  background: var(--sport);
  animation-delay: var(--d);
}
.branch::after {
  top: 50%;
  bottom: 0;
  background: var(--next, transparent);
  animation-delay: calc(var(--d) + 200ms);
}
.branch:last-child::after {
  content: none;
}
.leaf::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 50%;
  margin-top: -1px;
  width: var(--stub);
  height: 2px;
  background: var(--sport);
  transform-origin: left;
  animation: grow-x 240ms ease-out both;
  animation-delay: calc(var(--d) + 160ms);
  transition: width 160ms ease;
}
.branch:hover .leaf::before {
  width: calc(var(--stub) + 0.5rem);
}
.leaf {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.25rem 1.25rem;
  align-items: center;
  padding: 1rem;
  margin-left: -0.5rem;
  border-radius: 0.5rem;
  animation: fade 320ms ease-out both;
  animation-delay: calc(var(--d) + 320ms);
}
.leaf:hover {
  background: var(--panel);
}
.leaf p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.45;
}
.leaf .meta {
  margin-top: 0.35rem;
}

.logo {
  display: block;
  height: 2.25rem;
}
/* Kickertool wordmark is 3:1 with the figure on top, the others 5.5:1; taller box so the letters match */
.logo.tall {
  height: 3.25rem;
}
.logo img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
}
.logo-text {
  font-family: 'Roboto Condensed', 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
}
.logo-link:hover {
  text-decoration: none;
}

.meta {
  font-size: 0.9rem;
  color: var(--muted);
}
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0.4rem;
  border-radius: 0.25rem;
  border: 1px solid currentColor;
  color: var(--sport-text, var(--sport, var(--green-text)));
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.25rem;
  margin-top: 0.75rem;
}
.button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 0.4rem;
  background: var(--sport, var(--green));
  color: #fff;
  font-weight: 500;
  line-height: 1.3;
}
.button:hover {
  text-decoration: none;
  filter: brightness(1.08);
}
.more {
  color: var(--sport-text, var(--sport, var(--green-text)));
  font-weight: 500;
}

/* App page */
.app {
  padding-block: 2rem 3.5rem;
}
.crumb {
  font-size: 0.95rem;
}
.crumb a {
  color: var(--muted);
}
.app-head {
  padding-block: 2rem 1rem;
}
.app-head .logo {
  height: 3rem;
}
.app-head .logo.tall {
  height: 4.25rem;
}
.app-head .lead {
  margin-top: 1rem;
}
.channel {
  border-top: 1px solid var(--line);
  padding-block: 2rem;
}
.channel h2 {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}
.channel .muted {
  color: var(--muted);
  max-width: 40rem;
  margin-top: 0.5rem;
}
.files {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
  background: var(--panel);
  border-radius: 0.5rem;
  overflow: hidden;
}
.files th,
.files td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.files thead th {
  border-top: none;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.files tbody th {
  font-weight: 500;
  width: 8rem;
}
.files td a {
  font-weight: 500;
  color: var(--sport-text, var(--sport, var(--green-text)));
}
.files .name,
.files .hint {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.files .hint {
  margin-top: 0.25rem;
}
.files .size {
  text-align: right;
  white-space: nowrap;
  color: var(--muted);
}
.files tbody tr:hover {
  background: var(--hover);
}

footer {
  border-top: 1px solid var(--line);
  padding-block: 1.5rem 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
}
footer a {
  color: var(--muted);
}
footer nav {
  display: flex;
  gap: 1.5rem;
}

@keyframes grow-y {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes grow-x {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .branch::before,
  .branch::after,
  .leaf::before,
  .leaf {
    animation: none;
  }
  .leaf::before {
    transition: none;
  }
}

@media (max-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-block: 3rem 2.5rem;
  }
}
@media (max-width: 36rem) {
  :root {
    --stub: 1rem;
  }
  .leaf {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
    padding: 0.75rem;
  }
  .logo {
    height: 2rem;
  }
  .logo.tall {
    height: 2.9rem;
  }
  .files thead {
    display: none;
  }
  .files tbody th {
    width: auto;
    padding-bottom: 0;
    border-top: 1px solid var(--line);
  }
  .files tr,
  .files th,
  .files td {
    display: block;
  }
  .files td {
    border-top: none;
  }
  .files .size {
    text-align: left;
    padding-top: 0;
  }
}
