/*
 * Base styles for agheli.design: fonts, reset, type, shared blocks, motion.
 * Every value comes from tokens.css.
 */

/* ---------- Fonts (self-hosted, SIL Open Font License, see fonts/OFL.txt) ---------- */
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

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

a {
  color: inherit;
  text-decoration-color: var(--color-text-faint);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration-hover) var(--ease-out);
}

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

/* The outline follows each element's own corners (cards stay rounded when focused). */
:focus-visible {
  outline: 2px solid var(--color-text-strong);
  outline-offset: 3px;
}

/* ---------- Type ---------- */
.title {
  color: var(--color-text-strong);
  font-size: var(--text-2xl);
  line-height: var(--leading-2xl);
  font-weight: var(--weight-medium);
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
}

.heading {
  color: var(--color-text-strong);
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
  font-weight: var(--weight-medium);
}

.body {
  font-size: var(--text-base);
  line-height: var(--leading-base);
}

.meta {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

/* Captions are read as sentences, so they use the muted grey (as in the PDF). */
.caption {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.label {
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.chip--shipped  { background: var(--chip-shipped-bg);  color: var(--chip-shipped-text); }
.chip--pilot    { background: var(--chip-pilot-bg);    color: var(--chip-pilot-text); }
.chip--progress { background: var(--chip-progress-bg); color: var(--chip-progress-text); }
.chip--designed { background: var(--chip-designed-bg); color: var(--chip-designed-text); }
.chip--own {
  background: var(--chip-own-bg);
  color: var(--chip-own-text);
  box-shadow: inset 0 0 0 1px var(--chip-own-line);
}

/* ---------- Buttons (contact pills) ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text-strong);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition:
    transform var(--duration-press) var(--ease-press),
    background-color var(--duration-hover) var(--ease-out);
}

.button:active {
  transform: scale(0.97);
}

.button--dark {
  background: var(--color-text-strong);
  color: var(--color-bg);
}

/* ---------- Dark band ("At a glance") ---------- */
.band {
  background: var(--band-bg);
  color: var(--band-text);
}

.band .label {
  color: var(--band-text-muted);
}

.band-card {
  background: var(--band-card);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.band-number {
  color: var(--band-text-strong);
  font-size: var(--text-2xl);
  line-height: var(--leading-2xl);
  font-weight: var(--weight-semibold);
}

/* ---------- Motion ---------- */
/* On load: blocks fade up one after another. Set --i on each block (0, 1, 2 ...). */
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.reveal-on-load {
  animation: reveal-in 700ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}

/* On scroll: js/reveal.js adds .is-visible once the block enters the screen. */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--duration-reveal) var(--ease-out),
    transform var(--duration-reveal) var(--ease-out);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Cards lift a little on hover (only with a mouse). */
@media (hover: hover) and (pointer: fine) {
  .lift {
    transition: transform var(--duration-hover) var(--ease-out);
  }
  .lift:hover {
    transform: translateY(-2px);
  }
}

/* People who ask their system for less motion get none. */
@media (prefers-reduced-motion: reduce) {
  .reveal-on-load,
  .js .reveal {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }
  .lift:hover,
  .button:active {
    transform: none;
  }
}
