/* ==========================================================================
   Gustavo Stabelini — portfolio
   Palette and typeface are lifted from the apps themselves: the counter tiles
   use Flutter's pinkAccent / lightBlue on #2C2C2E, and both apps ship Tiller.
   ========================================================================== */

@font-face {
  font-family: 'Tiller';
  src: url('../fonts/Tiller-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Tiller';
  src: url('../fonts/Tiller-Demi.otf') format('opentype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Tiller';
  src: url('../fonts/Tiller-Heavy.otf') format('opentype');
  font-weight: 800;
  font-display: swap;
}

:root {
  --ink: #141416;
  --surface: #1c1c1f;
  --tile: #2c2c2e;
  --edge: #38383e;
  --parch: #f2f0ee;
  --muted: #9a9aa2;

  --p1: #ff4081;   /* player one — FAB Tracker */
  --p2: #03a9f4;   /* player two — RB Tracker */
  --amber: #ffd54f; /* match timer */

  --display: 'Tiller', 'Iowan Old Style', Georgia, serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 48px);
  --measure: 760px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--parch);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--p2);
  text-decoration-color: color-mix(in srgb, var(--p2) 40%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  height: auto;
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* Small caps utility label — used for eyebrows and tile captions. */
.label {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- masthead ---------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
  border-bottom: 1px solid var(--edge);
}

.monogram {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--parch);
  text-decoration: none;
}

.monogram:hover {
  color: var(--p1);
}

.masthead nav {
  display: flex;
  gap: clamp(16px, 3vw, 28px);
}

.masthead nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.masthead nav a:hover {
  color: var(--parch);
}

/* ---------- hero -------------------------------------------------------- */

.hero {
  padding-block: clamp(56px, 10vw, 96px) clamp(40px, 7vw, 72px);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 14px 0 0;
}

.hero .lede {
  max-width: 46ch;
  margin: 20px 0 0;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
}

.hero .lede strong {
  color: var(--parch);
  font-weight: 600;
}

/* ---------- the counter pair (signature element) ------------------------ */

.counters {
  margin-top: clamp(36px, 6vw, 56px);
}

.counter-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: clamp(190px, 30vw, 260px);
  padding: 22px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--tile);
  color: var(--parch);
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.tile::after {
  /* the accent bar reads as the player's colour in the real app */
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 4px;
  background: var(--accent);
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgb(0 0 0 / 45%);
}

.tile--p1 {
  --accent: var(--p1);
}

.tile--p2 {
  --accent: var(--p2);
}

.tile .tile-name {
  color: var(--accent);
}

.tile .tile-value {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.6rem, 12vw, 6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 140ms ease;
}

.tile .tile-unit {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.tile[data-state='won'] .tile-value {
  color: var(--accent);
}

.tile[data-state='dead'] .tile-value {
  color: var(--muted);
}

.counter-hint {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.counter-hint kbd {
  font-family: var(--body);
  font-size: 0.78rem;
  padding: 1px 6px;
  border: 1px solid var(--edge);
  border-radius: 5px;
  color: var(--parch);
}

/* ---------- app entries ------------------------------------------------- */

.apps {
  padding-block: clamp(40px, 7vw, 72px);
  border-top: 1px solid var(--edge);
}

.apps > .label {
  display: block;
  margin-bottom: 28px;
}

.app {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: clamp(20px, 4vw, 34px);
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--edge);
  border-radius: 18px;
  background: var(--surface);
}

.app + .app {
  margin-top: 18px;
}

.app-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid var(--edge);
}

.app-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.app h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 3.6vw, 1.95rem);
  line-height: 1.1;
  margin: 0;
  color: var(--accent);
}

.app--p1 {
  --accent: var(--p1);
}

.app--p2 {
  --accent: var(--p2);
}

.version {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding: 2px 9px;
  border: 1px solid var(--edge);
  border-radius: 999px;
}

.app p {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 62ch;
}

.features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
}

.features li {
  font-size: 0.82rem;
  color: var(--parch);
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

/* The APK is the one thing on the card a visitor can act on, so it gets the
   only filled button on the page. */
.app-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 22px;
}

.download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.download:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 32%, transparent);
}

.download svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.download-meta {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.sideload {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--edge);
}

.app-links a {
  font-size: 0.9rem;
  color: var(--parch);
  text-decoration: none;
}

.app-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.disclaimer {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--muted);
  border-left: 2px solid var(--edge);
  padding-left: 14px;
}

/* ---------- contact / footer -------------------------------------------- */

.contact {
  padding-block: clamp(40px, 7vw, 72px);
  border-top: 1px solid var(--edge);
}

.contact h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 12px 0 0;
  letter-spacing: -0.01em;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.contact-links a {
  padding: 11px 20px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--surface);
  color: var(--parch);
  text-decoration: none;
  font-size: 0.92rem;
  transition: border-color 140ms ease, color 140ms ease;
}

.contact-links a:hover {
  border-color: var(--p2);
  color: var(--p2);
}

.site-footer {
  padding-block: 28px;
  border-top: 1px solid var(--edge);
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- legal pages ------------------------------------------------- */

/* Legal pages run on a narrower measure — masthead and footer follow it so the
   whole page shares one left edge. */
body.legal-page .wrap {
  max-width: var(--measure);
}

.legal {
  margin: 0 auto;
  padding-block: clamp(44px, 8vw, 76px) clamp(40px, 7vw, 64px);
}

.legal .eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.legal .eyebrow img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.legal .eyebrow .label {
  color: var(--accent);
}

.legal h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}

.legal .updated {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.legal section {
  margin-top: 38px;
}

.legal h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--parch);
  margin: 0 0 10px;
}

/* Legal sections are genuinely a numbered sequence — readers cite by number. */
.legal h2::before {
  content: counter(legal-section) '. ';
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.legal {
  counter-reset: legal-section;
}

.legal section {
  counter-increment: legal-section;
}

.legal p {
  margin: 0 0 14px;
  color: #d6d3d1;
}

.legal ul {
  margin: 0 0 14px;
  padding-left: 20px;
  color: #d6d3d1;
}

.legal li {
  margin-bottom: 6px;
}

.legal a {
  color: var(--accent);
  word-break: break-word;
}

.legal .note {
  margin-top: 34px;
  padding: 18px 20px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--surface);
  font-size: 0.9rem;
  color: var(--muted);
}

.backlink {
  display: inline-block;
  margin-top: 40px;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.backlink:hover {
  color: var(--accent);
}

.legal--p1 {
  --accent: var(--p1);
}

.legal--p2 {
  --accent: var(--p2);
}

/* ---------- responsive -------------------------------------------------- */

@media (max-width: 620px) {
  .app {
    grid-template-columns: 1fr;
  }

  .app-icon {
    width: 68px;
    height: 68px;
  }

  .masthead {
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 460px) {
  .counter-pair {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
