/* =========================================================================
   TOKENS
   ========================================================================= */
:root {
  /* Surfaces: true black base for OLED, layered with subtle elevation */
  --bg:         #000000;
  --surface-1:  #0a0a0b;
  --surface-2:  #101012;
  --surface-3:  #16171a;
  --hairline:   rgba(255, 255, 255, 0.06);
  --hairline-2: rgba(255, 255, 255, 0.10);

  /* Text */
  --text:       #f2f2f3;
  --text-muted: #9a9aa1;
  --text-faint: #80808a;   /* lowest tier that still clears WCAG AA 4.5:1 on the card surfaces */

  /* Accent: restrained, near-monochrome with one cool highlight */
  --accent:     #e8e8ea;
  --accent-ink: #0a0a0b;
  --signal:     #6ee7b7;

  /* Type */
  --font-sans: 'Satoshi', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing scale (8px base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* Radii */
  --r-lg: 20px;

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur:  220ms;

  /* Layout */
  --maxw: 1180px;
  --gutter-x: clamp(20px, 5vw, 56px);
  --gutter-y: clamp(20px, 4vw, 40px);
}

/* =========================================================================
   BASE
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Subtle atmosphere: a single restrained radial. No glowing blobs. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(255, 255, 255, 0.035), transparent 60%),
    linear-gradient(180deg, #050506 0%, #000 60%);
  z-index: -1;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
svg { display: block; }
p { margin: 0; }

/* The hidden attribute must win over any display rule below. */
[hidden] { display: none !important; }

/* Visually hidden, still read by assistive tech. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

::selection { background: var(--text); color: var(--accent-ink); }

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

/* =========================================================================
   LAYOUT
   ========================================================================= */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding:
    var(--gutter-y)
    max(var(--gutter-x), env(safe-area-inset-right))
    max(var(--gutter-y), env(safe-area-inset-bottom))
    max(var(--gutter-x), env(safe-area-inset-left));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
}

main {
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
}

/* ---- Header ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  color: var(--text);
}
.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.brand-dot {
  color: var(--text-faint);
  margin: 0 6px;
}
.brand-sub {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.meta time { font-variant-numeric: tabular-nums; }
.meta .sep { color: var(--text-faint); }

/* ---- Hero ---- */
.hero {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  max-width: 760px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.eyebrow .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(110, 231, 183, 0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(110, 231, 183, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 231, 183, 0); }
}
.title {
  margin: 0;
  font-size: clamp(34px, 5.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
}
.title em {
  font-style: normal;
  color: var(--text-muted);
  font-weight: 500;
}
.subtitle {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 560px;
}

/* ---- Services grid ----
   Two columns from small tablets, four from desktop, so four cards never
   leave an orphan. Below 560px the cards stack. */
.services {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 560px)  { .services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .services { grid-template-columns: repeat(4, 1fr); } }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  padding: 22px;
  min-height: 220px;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  color: var(--text);
  isolation: isolate;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card::after {
  /* Top highlight hairline: a subtle bevel. */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 30%);
  mask: linear-gradient(#000, transparent 40%);
  -webkit-mask: linear-gradient(#000, transparent 40%);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}

.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.02);
}

.icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  color: var(--text);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.icon-wrap svg { width: 20px; height: 20px; }

.card-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  padding: var(--s-4) 0;
}
.card-name {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.card-foot { margin-top: auto; }

/* The CTA is the card's only link. Its ::before is stretched over the whole
   card, so a click anywhere on the card is a click on this link, keyboard
   focus lands on the visible button, and there is one accessible name. */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline-2);
  background: rgba(255, 255, 255, 0.03);
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.cta svg {
  width: 14px;
  height: 14px;
  transition: transform var(--dur) var(--ease);
}
.cta:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* Raised + filled state. Hover is only wired up for devices that can hover,
   so a tap on a phone does not leave a card stuck in its hover state. The
   :active rule covers the stretched overlay, so a press anywhere on the card
   fills the button. */
.card:focus-within {
  border-color: var(--hairline-2);
}
.cta:active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
@media (hover: hover) {
  .card:hover,
  .card:focus-within {
    border-color: var(--hairline-2);
    transform: translateY(-2px);
  }
  .card:hover .icon-wrap {
    border-color: var(--hairline-2);
    background: var(--surface-3);
  }
  .card:hover .cta {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
  }
  .card:hover .cta svg {
    transform: translate(2px, -2px);
  }
}

/* ---- Footer ---- */
.footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  color: var(--text-faint);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding-top: var(--s-5);
  border-top: 1px solid var(--hairline);
}
.hint {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}
.hint kbd {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  color: var(--text-muted);
}
/* No physical keyboard to press: drop the shortcut hint. */
@media (hover: none) and (pointer: coarse) {
  .hint { display: none; }
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 640px) {
  .shell, main { gap: var(--s-7); }
  .meta .sep, .meta .meta-hide { display: none; }
  .card { min-height: 200px; padding: 20px; }
  .footer { flex-direction: column; align-items: flex-start; gap: var(--s-3); }
}

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