/* Adthletics - shared design system: tokens, type, buttons, and the
   <site-header> / <site-footer> elements (js/site-header.js,
   js/site-footer.js). Every restyled page loads this first, then its own
   sheet (landing.css, auth.css, dashboard.css...). */

:root {
  color-scheme: light;
  /* Brand palette */
  --ink: #111111;
  --cream: #f4f1ea;
  --page: #f6efe0; /* page background: a warm cream */
  --accent: #0077ff;
  --accent-light: #00a8ff;
  --accent-bright: #00d4ff;
  /* Tints derived from the palette */
  --ink-soft: rgba(17, 17, 17, 0.72);
  --ink-line: rgba(17, 17, 17, 0.14);
  --cream-soft: rgba(244, 241, 234, 0.72);
  --cream-faint: rgba(244, 241, 234, 0.45);
  --cream-line: rgba(244, 241, 234, 0.16);
  --cream-tint: rgba(244, 241, 234, 0.06);
  --accent-tint: rgba(0, 212, 255, 0.10);

  --display: "Anybody", "Arial Black", "Helvetica Neue", sans-serif;
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 20px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.display {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 115%;
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.display em {
  font-style: italic;
  color: var(--accent);
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 24px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn .arrow { transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(4px); }

.btn-accent { color: var(--cream); background: var(--accent); }
.btn-accent:hover { color: var(--ink); background: var(--accent-light); }

.btn-line { color: var(--ink); border-color: var(--ink); background: transparent; }
.btn-line:hover { color: var(--cream); background: var(--ink); }

.btn-line-cream { color: var(--cream); border-color: var(--cream); background: transparent; }
.btn-line-cream:hover { color: var(--ink); background: var(--cream); }

.btn-accent-light { color: var(--ink); background: var(--accent-light); }
.btn-accent-light:hover { background: var(--accent-bright); }

.btn-ink { color: var(--cream); background: var(--ink); }
.btn-ink:hover { color: var(--ink); background: var(--cream); }

.btn-sm { padding: 10px 16px; font-size: 15px; }

.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none; /* no hover colour on a button that does nothing */
}

/* A button that reads as a link ("Forgot your password?"). */
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  text-underline-offset: 3px;
}

.link-btn:hover { text-decoration: underline; }

/* ---------- Header ---------- */

/* <site-header> and <site-footer> render their markup from JS (light DOM, so
   these styles apply). Until the header is defined, reserve its height so
   the page does not jump when it appears. */
site-header,
site-footer { display: block; }

site-header:not(:defined) { min-height: 74px; }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding-block: 16px;
}

/* The menu wrapper only matters on small screens (see Responsive): on wider screens
   its nav and language switch sit in the header row, and the phone-only
   sign-up button and menu button are not shown. */
.menu { display: contents; }
.top-cta,
.menu-btn { display: none; }

.logo {
  display: block;
  text-decoration: none;
}

.logo img {
  display: block;
  width: auto;
  height: 42px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
  font-size: 15px;
  font-weight: 600;
}

.nav a:not(.btn) {
  position: relative;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav a:not(.btn):hover { color: var(--accent); }

/* Hover underline: sweeps in from the left, slides out to the right. */
.nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.nav a:not(.btn):hover::after,
.nav a:not(.btn):focus-visible::after {
  transform: scaleX(1);
  transform-origin: left center;
}

/* Header buttons lift on hover. They sit on the light page, so btn-ink's cream
   hover would make them vanish: turn the accent colour instead. */
.nav .btn {
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.2s ease;
}

.nav .btn:hover { transform: translateY(-2px); }
.nav .btn-ink:hover { color: var(--cream); background: var(--accent); }

/* The page you are on (<site-header current="...">): underline kept, or the
   button in the accent colour. */
.nav a:not(.btn)[aria-current="page"] { color: var(--accent); }
.nav a:not(.btn)[aria-current="page"]::after { transform: scaleX(1); }
.nav .btn[aria-current="page"],
.top-cta[aria-current="page"] { color: var(--cream); background: var(--accent); }

/* The language drop-down (js/site-header.js): a globe and the current code;
   the list holds links to this page in each language (buttons on pages that
   switch in place). */
.lang { position: relative; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.lang-toggle:hover,
.lang.is-open .lang-toggle { color: var(--cream); background: var(--ink); }

.lang-globe {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

/* A small chevron, turned over while the list is open. */
.lang-caret {
  width: 7px;
  height: 7px;
  margin: -3px 1px 0 1px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.lang.is-open .lang-caret { margin-top: 3px; transform: rotate(-135deg); }

.lang-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 170px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: 0 18px 36px -18px rgba(17, 17, 17, 0.45);
}

.lang-list[hidden] { display: none; }

.lang-list a,
.lang-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.lang-code {
  min-width: 2.2em;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.lang-list a:hover,
.lang-list button:hover,
.lang-list a:focus-visible,
.lang-list button:focus-visible { color: var(--accent); background: var(--accent-tint); }

.lang-list .is-active { color: var(--cream); background: var(--ink); }
.lang-list .is-active .lang-code { color: var(--accent-bright); }
.lang-list .is-active:hover { color: var(--cream); background: var(--ink); }

/* ---------- Utilities ---------- */

/* Off-screen but read by screen readers and search engines: the page's h1. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Footer ---------- */

.foot {
  color: var(--cream);
  background: var(--ink);
}

.foot .wrap {
  display: grid;
  gap: 28px;
  padding-block: clamp(44px, 5vw, 64px) 36px;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  font-size: 14px;
  color: var(--cream-soft);
}

/* Legal links on the left; the idea credit and the copyright on the right. */
.foot-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 22px;
  border-top: 1px solid var(--cream-line);
  font-size: 13.5px;
  color: var(--cream-soft);
}

.foot .foot-legal nav { gap: 6px 20px; }

.foot .foot-legal nav a {
  font-weight: 500;
  color: var(--cream-soft);
}

.foot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.foot-meta a {
  font-weight: 600;
  color: var(--cream);
  text-underline-offset: 2px;
}

.foot-meta a:hover { color: var(--accent-bright); }

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.foot nav a {
  font-weight: 600;
  text-decoration: none;
  color: var(--cream);
}

.foot nav a:hover { color: var(--accent-bright); }

.credit {
  font-size: 12.5px;
  color: var(--cream-faint);
}

.credit a {
  color: var(--cream-soft);
  text-underline-offset: 2px;
}

.credit a:hover { color: var(--accent-bright); }

/* ---------- Responsive ---------- */

/* Phones and tablets: one header row (logo, sign-up button, menu button); the
   links and the language switch open in a panel under it. Below 960px the
   full row (longer in Spanish) no longer fits. Keep the width in step with
   js/site-header.js. */
@media (max-width: 960px) {
  site-header:not(:defined) { min-height: 72px; }
  .top {
    position: relative;
    z-index: 30;
    flex-wrap: nowrap;
    gap: 10px;
    padding-block: 14px;
  }
  .logo img { height: 34px; }
  .top-cta { display: inline-flex; margin-left: auto; }
  .top-cta[hidden] { display: none; }

  .menu-btn {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
  }
  .top-cta[hidden] + .top-cta[hidden] + .menu-btn { margin-left: auto; } /* before auth is known */

  /* Burger: the bar and its two pseudo bars; open, it turns into an X. */
  .menu-icon,
  .menu-icon::before,
  .menu-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }
  .menu-icon { position: relative; }
  .menu-icon::before,
  .menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
  }
  .menu-icon::before { top: -6px; }
  .menu-icon::after { top: 6px; }
  .is-open .menu-icon { background: transparent; }
  .is-open .menu-icon::before { transform: translateY(6px) rotate(45deg); }
  .is-open .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

  .menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 4px 20px 24px;
    border-bottom: 1.5px solid var(--ink);
    background: var(--page);
    box-shadow: 0 24px 40px -24px rgba(17, 17, 17, 0.35);
  }
  .is-open .menu { display: flex; }

  .nav {
    flex-direction: column;
    align-items: stretch;
    align-self: stretch;
    gap: 0;
    margin-left: 0;
    font-size: 19px;
  }
  .nav a:not(.btn) {
    padding-block: 13px;
    border-bottom: 1px solid var(--ink-line);
  }
  .nav a:not(.btn)::after { display: none; }
  .nav .btn { display: none; } /* the sign-up button stays in the header row */

  .lang-toggle { padding: 9px 16px 9px 12px; font-size: 15px; }
  .lang-list { right: auto; left: 0; }
}

@media (max-width: 560px) {
  .btn { font-size: 18px; }
  .top-cta.btn { font-size: 15px; }
}

@media (max-width: 359px) {
  .logo img { height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .btn .arrow, .nav a:not(.btn)::after,
  .menu-icon, .menu-icon::before, .menu-icon::after { transition: none; }
  .nav .btn:hover { transform: none; }
}

/* ---------- Toasts (js/toast.js): short confirmations, bottom right, gone after 5 s ---------- */

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: grid;
  justify-items: end;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  margin: 0;
  padding: 14px 18px 14px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--cream);
  background: var(--ink);
  box-shadow: 0 14px 30px -14px rgba(17, 17, 17, 0.6);
  animation: toast-in 0.22s ease-out;
}

.toast.is-leaving { animation: toast-out 0.25s ease-in forwards; }

@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

@media (max-width: 560px) {
  .toast-stack { right: 16px; left: 16px; bottom: 16px; justify-items: stretch; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .toast.is-leaving { animation: none; }
}
