/* ============================================================
   Block.xyz Design System — Tokens
   Colors, Type, Spacing, Radii, Motion
   ============================================================ */

/* ---------- Fonts ----------
   SuisseIntl / "Block" is licensed. We substitute Inter Tight
   from Google Fonts as the closest open-source grotesque.
   If you have SuisseIntl woff2, drop them in fonts/ and replace
   the @import below with an @font-face block.
---------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600&display=swap');

:root {
  /* -------- Color: Primary -------- */
  --color-primary: #000000;
  --color-on-primary: #FFFFFF;

  /* -------- Color: Accent -------- */
  --color-accent-blue: #0066FF;
  --color-accent-green: #00C781;

  /* -------- Color: Surface / Background -------- */
  --color-bg-default: #FFFFFF;
  --color-bg-subtle: #F7F7F7;
  --color-bg-inverse: #000000;

  /* -------- Color: Text -------- */
  --color-text-primary: #000000;
  --color-text-secondary: #6B6B6B;
  --color-text-tertiary: #AAAAAA;
  --color-text-on-inverse: #FFFFFF;

  /* -------- Color: Border -------- */
  --color-border: #E5E5E5;
  --color-border-strong: #000000;

  /* -------- Color: Semantic -------- */
  --color-success: #00C781;
  --color-warning: #F5A623;
  --color-error: #E02020;

  /* -------- Gradient (rare) -------- */
  --gradient-brand: linear-gradient(135deg, #000000 0%, #1A1A1A 100%);
  --gradient-tile-scrim: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.15) 100%);

  /* -------- Type: Family -------- */
  --font-sans: 'Inter Tight', 'SuisseIntl', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-system: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  /* -------- Type: Scale (desktop) -------- */
  --type-display-xl: clamp(3rem, 6vw, 5.5rem);
  --type-display-l: clamp(2.5rem, 4vw, 4rem);
  --type-h1: 2.25rem;   /* 36 */
  --type-h2: 1.75rem;   /* 28 */
  --type-h3: 1.25rem;   /* 20 */
  --type-body-l: 1.125rem; /* 18 */
  --type-body: 1rem;       /* 16 */
  --type-body-s: 0.875rem; /* 14 */
  --type-caption: 0.75rem; /* 12 */
  --type-label: 0.6875rem; /* 11 */

  /* -------- Type: Weight -------- */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* -------- Type: Line Height -------- */
  --lh-display: 1.0;
  --lh-display-l: 1.05;
  --lh-heading: 1.15;
  --lh-body: 1.6;
  --lh-label: 1.3;

  /* -------- Type: Tracking -------- */
  --track-display: -0.02em;
  --track-heading: -0.01em;
  --track-body: 0;
  --track-caption: 0.02em;
  --track-label: 0.06em;
  --track-label-loose: 0.1em;

  /* -------- Spacing (8px base) -------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* -------- Radii -------- */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* -------- Elevation (flat — borders over shadows) -------- */
  --border-hairline: 1px solid var(--color-border);
  --border-strong: 1.5px solid var(--color-border-strong);
  --shadow-dropdown: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-overlay: 0 8px 32px rgba(0, 0, 0, 0.12);

  /* -------- Motion -------- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;

  /* -------- Layout -------- */
  --container-max: 1280px;
  --container-pad-desktop: 48px;
  --container-pad-tablet: 32px;
  --container-pad-mobile: 20px;

  /* -------- Breakpoints (for reference in JS / clamp) -------- */
  --bp-xs: 480px;
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
}

/* ============================================================
   Base reset — opinionated for Block's aesthetic
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg-default);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--type-body);
  line-height: var(--lh-body);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================================
   Semantic type — map tags to tokens
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--color-text-primary);
  font-weight: var(--weight-medium);
  letter-spacing: var(--track-heading);
  line-height: var(--lh-heading);
  text-wrap: balance;
}

h1 { font-size: var(--type-h1); line-height: 1.1; }
h2 { font-size: var(--type-h2); }
h3 { font-size: var(--type-h3); line-height: 1.2; letter-spacing: 0; }

.display-xl {
  font-size: var(--type-display-xl);
  font-weight: var(--weight-regular);
  line-height: var(--lh-display);
  letter-spacing: var(--track-display);
  text-wrap: balance;
}
.display-l {
  font-size: var(--type-display-l);
  font-weight: var(--weight-regular);
  line-height: var(--lh-display-l);
  letter-spacing: var(--track-display);
  text-wrap: balance;
}

p {
  margin: 0;
  font-size: var(--type-body);
  line-height: var(--lh-body);
  color: var(--color-text-primary);
  max-width: 65ch;
  text-wrap: pretty;
}

.body-l { font-size: var(--type-body-l); }
.body-s { font-size: var(--type-body-s); }
.caption {
  font-size: var(--type-caption);
  letter-spacing: var(--track-caption);
  color: var(--color-text-secondary);
  line-height: 1.4;
}
.label {
  font-size: var(--type-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  line-height: var(--lh-label);
}
.label-loose {
  font-size: var(--type-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-label-loose);
  text-transform: uppercase;
}

.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }

a {
  color: var(--color-text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity var(--duration-fast) var(--ease);
}
a:hover { opacity: 0.7; }

/* Nav-style link: no underline, opacity state */
.nav-link {
  color: var(--color-text-primary);
  text-decoration: none;
  opacity: 0.7;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: opacity var(--duration-fast) var(--ease);
}
.nav-link:hover { opacity: 1; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 24px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: var(--weight-medium);
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease),
              background-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
  text-decoration: none;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.btn-primary:hover { opacity: 0.8; }

.btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border: 1.5px solid var(--color-border-strong);
  padding: 0 22.5px;
}
.btn-secondary:hover {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.btn-text {
  background: none;
  border: none;
  color: var(--color-text-primary);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  height: auto;
}

/* ============================================================
   Cards, inputs, layout utilities
   ============================================================ */
.card {
  background: var(--color-bg-default);
  border: var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color var(--duration-base) var(--ease);
}
.card:hover { border-color: var(--color-border-strong); }

.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-family: inherit;
  font-size: var(--type-body);
  color: var(--color-text-primary);
  background: var(--color-bg-default);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease);
}
.input:focus { border-color: var(--color-border-strong); }
.input::placeholder { color: var(--color-text-tertiary); }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad-desktop);
}
@media (max-width: 1024px) {
  .container { padding: 0 var(--container-pad-tablet); }
}
@media (max-width: 640px) {
  .container { padding: 0 var(--container-pad-mobile); }
}

.dot-separator {
  text-align: center;
  font-size: 2rem;
  color: var(--color-text-primary);
  padding: var(--space-7) 0;
  user-select: none;
  line-height: 1;
}

.media-tile {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #F0F0F0;
  position: relative;
}
.media-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-tile-scrim);
  pointer-events: none;
}
.media-tile > img,
.media-tile > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Selection */
::selection {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
