/* Felix Meets AI: shared styles, mobile first */
:root {
  --canvas: #ffffff;
  --paper: #f7f7f5;
  --card: #f5f3f1;
  --hairline: #e4e2e3;
  --ink-1: #0e0e10;
  --ink-2: #3d3d40;
  --ink-3: #74757a;
  --coral: #ff4b32;
  --on-ink: #ffffff;
  --surface: var(--canvas);
  --dot: rgba(14, 14, 16, 0.07);
  --shadow: 0 1px 2px rgba(14, 14, 16, 0.04), 0 4px 14px rgba(14, 14, 16, 0.05);
  --shadow-lift: 0 2px 4px rgba(14, 14, 16, 0.05), 0 10px 24px rgba(14, 14, 16, 0.08);
  --r-card: 16px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0e0e10;
    --paper: #0e0e10;
    --card: #242428;
    --hairline: #2c2c30;
    --ink-1: #f7f7f5;
    --ink-2: #d4d4d6;
    --ink-3: #a3a4a9;
    --on-ink: #0e0e10;
    --surface: #18181b;
    --dot: rgba(247, 247, 245, 0.06);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.35);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  /* Subtle dot grid motif, no full-surface color gradient */
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.5px);
  background-size: 22px 22px;
  color: var(--ink-1);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 56px 16px 32px;
}

@media (min-width: 360px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
}

main.wrap { flex: 1; }

a { color: inherit; }

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

/* Profile header */
.profile { text-align: center; margin-bottom: 28px; }

.avatar {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto 20px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card);
  /* Thin ring: paper gap plus hairline */
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--hairline);
}

h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.intro { margin: 8px 0 0; color: var(--ink-2); }

/* Round social icon row */
.socials {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.social {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-1);
  transition: transform 0.18s var(--ease), border-color 0.18s ease, color 0.18s ease;
}

.social svg { width: 20px; height: 20px; }

.social:hover { transform: translateY(-2px); }

.social:active { transform: translateY(0) scale(0.96); }

.social:focus-visible { border-radius: 50%; }

/* Link list */
.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink-1);
  text-decoration: none;
  transition: transform 0.18s var(--ease), box-shadow 0.18s ease, border-color 0.18s ease;
}

.link:hover { border-color: var(--ink-3); box-shadow: var(--shadow-lift); transform: translateY(-2px); }

.link:active { transform: translateY(0); box-shadow: var(--shadow); }

.link:focus-visible { border-radius: var(--r-card); }

/* Social and contact rows stay borderless; only the quiet legal buttons keep the hairline */
.link:not(.link-quiet),
.link:not(.link-quiet):hover { border-color: transparent; }

.link-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--card);
  color: var(--ink-1);
}

.link-icon svg { width: 20px; height: 20px; }

.link-text { flex: 1; min-width: 0; }

.link-title { flex: 1; min-width: 0; font-weight: 600; }

.link-sub { display: block; font-size: 0.875rem; color: var(--ink-3); }

.link-arrow {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--ink-3);
  transition: transform 0.18s var(--ease), color 0.18s ease;
}

.link:hover .link-arrow { transform: translateX(2px); color: var(--ink-1); }

/*
 * Highlighted primary link: always a dark card with the moving skillmyai hero field behind it, ported from
 * skillmyai.com (GradientLayers on the Business pricing card): the folds gradient image pans and turns
 * (bg-pan), five HERO_MESH colour fields flow over it (mesh-a to mesh-e), film grain sits on top. The field
 * is deepened like the source (fields mixed with warm dark #2a0f0c, image darker and more saturated), so
 * white text stays readable without a flat scrim. Transform only; still under reduced motion.
 */
.link-primary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 88px;
  margin-bottom: 6px;
  padding: 16px 20px;
  color: #ffffff;
  border: 0;
  background: #3a1510;
  box-shadow: none;
}

.link-primary:hover {
  box-shadow: none;
}

/* Field layer: its own rounded mask, so the animated layers never paint past the corners (round-clip) */
.card-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}

.card-image {
  position: absolute;
  inset: 0;
  background: url(/brand/card-gradient.webp) center / 100% 100% no-repeat;
  filter: brightness(0.5) saturate(1.35);
  animation: bg-pan 18s ease-in-out infinite;
  will-change: transform;
}

@keyframes bg-pan {
  0%, 100% { transform: scale(1.14) translate3d(0, 0, 0) rotate(0deg); }
  33% { transform: scale(1.26) translate3d(6%, -5%, 0) rotate(3deg); }
  66% { transform: scale(1.2) translate3d(-5%, 4%, 0) rotate(-2deg); }
}

/* Mesh colour fields: HERO_MESH colours mixed 58 % with #2a0f0c, at opacity 0.8 (MeshBlobs) */
.mesh-blob {
  --c: #2a0f0c;
  position: absolute;
  aspect-ratio: 1;
  opacity: 0.8;
  background: radial-gradient(closest-side, var(--c) 0%, var(--c) 25%, transparent 100%);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.mesh-a { --c: color-mix(in srgb, #f07a2a 58%, #2a0f0c); left: -10%; top: -20%; width: 85%; animation-name: mesh-a; animation-duration: 14s; }
.mesh-b { --c: color-mix(in srgb, #ef3a2b 58%, #2a0f0c); left: 45%; top: -25%; width: 80%; animation-name: mesh-b; animation-duration: 19s; animation-delay: -4s; }
.mesh-c { --c: color-mix(in srgb, #3b6fd0 58%, #2a0f0c); left: 30%; top: 35%; width: 90%; animation-name: mesh-c; animation-duration: 23s; animation-delay: -9s; }
.mesh-d { --c: color-mix(in srgb, #8a55ea 58%, #2a0f0c); left: -20%; top: 40%; width: 75%; animation-name: mesh-d; animation-duration: 12s; animation-delay: -2s; }
.mesh-e { --c: color-mix(in srgb, #ff9a5c 58%, #2a0f0c); left: 60%; top: 40%; width: 70%; animation-name: mesh-e; animation-duration: 17s; animation-delay: -7s; }

@keyframes mesh-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(38%, 22%, 0) scale(1.15); }
  66% { transform: translate3d(12%, 40%, 0) scale(0.9); }
}
@keyframes mesh-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
  50% { transform: translate3d(-42%, 30%, 0) scale(0.85); }
}
@keyframes mesh-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.95); }
  25% { transform: translate3d(-25%, -30%, 0) scale(1.1); }
  75% { transform: translate3d(28%, -12%, 0) scale(1); }
}
@keyframes mesh-d {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(45%, -35%, 0) scale(1.2); }
}
@keyframes mesh-e {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.1); }
  40% { transform: translate3d(-35%, -20%, 0) scale(0.9); }
  80% { transform: translate3d(-10%, 25%, 0) scale(1.05); }
}

/* Film grain: static noise tile in overlay, one noise pixel per device pixel (film-grain) */
.card-grain {
  position: absolute;
  inset: 0;
  opacity: 0.6;
  background: url(/brand/card-noise.webp) 0 0 / 256px repeat;
  mix-blend-mode: overlay;
}

@media (min-resolution: 2dppx) {
  .card-grain { background-size: 128px; }
}

.brand-logo { display: block; width: auto; height: 26px; overflow: visible; }

/* Logo ring: the gradient colours travel around the ring; the circle turns about its own centre */
.logo-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: logo-ring-spin 8s linear infinite;
}

@keyframes logo-ring-spin {
  to { transform: rotate(360deg); }
}

.link-primary .link-sub {
  margin-top: 6px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(42, 15, 12, 0.35);
}

.link-primary .link-arrow { width: 20px; height: 20px; color: rgba(255, 255, 255, 0.85); }

.link-primary:hover .link-arrow { color: #ffffff; }

@media (prefers-reduced-motion: reduce) {
  .card-image { animation: none; transform: scale(1.14); }
  .mesh-blob, .logo-ring { animation: none; }
}

/* Quiet secondary buttons for legal pages */
.legal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.link-quiet {
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  background: transparent;
  box-shadow: none;
  font-size: 0.875rem;
  color: var(--ink-2);
}

.link-quiet:hover { color: var(--ink-1); box-shadow: none; transform: none; }

/* Footer */
.footer {
  padding-top: 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.footer nav { display: flex; justify-content: center; gap: 20px; margin-bottom: 8px; }

.footer a {
  display: inline-block;
  padding: 6px 2px;
  color: var(--ink-2);
  text-decoration: none;
}

.footer a:hover { color: var(--ink-1); text-decoration: underline; }

.footer p { margin: 0; }

/* Legal and simple text pages */
.back {
  display: inline-block;
  margin-bottom: 24px;
  padding: 6px 0;
  color: var(--ink-2);
  text-decoration: none;
}

.back:hover { color: var(--ink-1); text-decoration: underline; }

.prose h1 { margin-bottom: 24px; }

.prose h2 { margin: 28px 0 6px; font-size: 1.0625rem; line-height: 1.35; }

.prose p { margin: 0 0 10px; color: var(--ink-2); }

.prose a { color: var(--ink-1); text-decoration-color: var(--coral); text-underline-offset: 3px; }

.prose ul { margin: 0 0 10px; padding-left: 20px; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .link:hover, .link:active, .social:hover, .social:active, .link:hover .link-arrow { transform: none; }
}

/* Keep the hidden attribute authoritative over display rules (used for social links until real URLs exist) */
[hidden] { display: none !important; }
