/* AFianco website — Modern SaaS design system */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  /* ── Default palette: coral on near-white ── */
  --bg: #ffffff;
  --surface: oklch(0.985 0.005 30);
  --surface-2: oklch(0.97 0.008 30);
  --surface-3: oklch(0.94 0.012 30);

  --ink: oklch(0.18 0.022 30);
  --ink-2: oklch(0.3 0.018 30);
  --ink-3: oklch(0.44 0.015 30);
  --ink-4: oklch(0.6 0.012 30);
  --ink-5: oklch(0.74 0.008 30);

  --line: oklch(0.92 0.01 30);
  --line-2: oklch(0.88 0.012 30);

  /* Coral accent — warm, modern */
  --brand: oklch(0.62 0.16 30);
  --brand-2: oklch(0.7 0.14 30);
  --brand-soft: oklch(0.97 0.04 30);
  --brand-glow: oklch(0.62 0.16 30 / 0.22);
  --brand-deep: oklch(0.45 0.15 30);

  --success: oklch(0.6 0.14 145);
  --success-soft: oklch(0.96 0.04 145);
  --warning: oklch(0.74 0.13 75);
  --warning-soft: oklch(0.96 0.04 75);
  --danger: oklch(0.6 0.18 25);
  --danger-soft: oklch(0.96 0.04 25);

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 999px;

  --shadow-xs: 0 1px 2px oklch(0.18 0.022 165 / 0.04);
  --shadow-sm: 0 1px 3px oklch(0.18 0.022 165 / 0.06), 0 1px 2px oklch(0.18 0.022 165 / 0.04);
  --shadow-md: 0 6px 20px -6px oklch(0.18 0.022 165 / 0.08), 0 2px 6px -2px oklch(0.18 0.022 165 / 0.05);
  --shadow-lg: 0 24px 50px -16px oklch(0.18 0.022 165 / 0.14), 0 8px 16px -8px oklch(0.18 0.022 165 / 0.06);
  --shadow-xl: 0 40px 80px -24px oklch(0.18 0.022 165 / 0.2);

  --container: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
}

/* ── Emerald palette ── */
[data-palette="emerald"] {
  --brand: oklch(0.55 0.13 165);
  --brand-2: oklch(0.64 0.11 165);
  --brand-soft: oklch(0.96 0.03 165);
  --brand-glow: oklch(0.55 0.13 165 / 0.22);
  --brand-deep: oklch(0.4 0.12 165);
}

/* ── Indigo palette ── */
[data-palette="indigo"] {
  --brand: oklch(0.55 0.18 275);
  --brand-2: oklch(0.64 0.16 275);
  --brand-soft: oklch(0.96 0.03 275);
  --brand-glow: oklch(0.55 0.18 275 / 0.22);
  --brand-deep: oklch(0.4 0.16 275);
}

/* ── Warm coral palette (also available as explicit override) ── */
[data-palette="coral"] {
  --brand: oklch(0.62 0.16 30);
  --brand-2: oklch(0.7 0.14 30);
  --brand-soft: oklch(0.97 0.04 30);
  --brand-glow: oklch(0.62 0.16 30 / 0.22);
  --brand-deep: oklch(0.45 0.15 30);
}

/* ── Slate palette ── */
[data-palette="slate"] {
  --brand: oklch(0.45 0.05 240);
  --brand-2: oklch(0.58 0.05 240);
  --brand-soft: oklch(0.96 0.012 240);
  --brand-glow: oklch(0.45 0.05 240 / 0.18);
  --brand-deep: oklch(0.3 0.04 240);
}

/* ── Dark mode (works with every palette) ── */
[data-theme="dark"] {
  --bg: oklch(0.16 0.012 30);
  --surface: oklch(0.2 0.014 30);
  --surface-2: oklch(0.24 0.016 30);
  --surface-3: oklch(0.28 0.018 30);

  --ink: oklch(0.97 0.005 30);
  --ink-2: oklch(0.88 0.008 30);
  --ink-3: oklch(0.72 0.01 30);
  --ink-4: oklch(0.58 0.012 30);
  --ink-5: oklch(0.42 0.012 30);

  --line: oklch(0.3 0.018 30);
  --line-2: oklch(0.36 0.02 30);

  --brand-soft: oklch(0.28 0.04 30);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
  font-feature-settings: "ss01", "cv11";
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ── Type system ── */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid color-mix(in oklab, var(--brand) 18%, transparent);
  white-space: nowrap;
}
.eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 18%, transparent); }
.eyebrow.subtle { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }
.eyebrow.subtle .dot { background: var(--ink-4); box-shadow: none; }

.h1 {
  font-size: clamp(44px, 6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}

.h2 {
  font-size: clamp(36px, 4.5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}

.h3 {
  font-size: clamp(24px, 2.4vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-weight: 600;
  margin: 0;
}

.h4 {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0;
}

.h5 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0;
}

.lede {
  font-size: clamp(17px, 1.25vw, 20px);
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 56ch;
  margin: 0;
  font-weight: 400;
}

.body-lg { font-size: 17px; line-height: 1.55; color: var(--ink-3); }
.body    { font-size: 15px; line-height: 1.55; color: var(--ink-3); }
.body-sm { font-size: 13px; line-height: 1.5; color: var(--ink-3); }

.mono { font-family: var(--font-mono); font-feature-settings: "ss01", "ss02"; }
.muted { color: var(--ink-4); }

.gradient-text {
  background: linear-gradient(135deg, var(--ink) 0%, var(--brand) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Layout ── */

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-wide { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }

section { position: relative; }

.section-pad { padding: clamp(80px, 11vh, 140px) 0; }
.section-pad-sm { padding: clamp(56px, 8vh, 96px) 0; }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: all .18s cubic-bezier(.2,.7,.3,1);
  white-space: nowrap;
  position: relative;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-sm), inset 0 1px 0 color-mix(in oklab, white 18%, transparent);
}
.btn-primary:hover {
  background: var(--ink-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 1px 0 color-mix(in oklab, white 18%, transparent);
}

.btn-brand {
  background: var(--brand);
  color: white;
  box-shadow: 0 6px 24px -6px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn-brand:hover {
  background: var(--brand-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 32px -8px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.2);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--bg);
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
}

.btn-glass {
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  color: var(--ink);
  border-color: var(--line);
  backdrop-filter: blur(8px);
}

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--brand);
}
.btn-link:hover { gap: 10px; }

.arrow { display: inline-block; transition: transform .18s ease; font-size: 1.05em; line-height: 1; }
.btn:hover .arrow, .btn-link:hover .arrow { transform: translateX(3px); }

/* ── Cards ── */

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.card-lift {
  transition: all .22s cubic-bezier(.2,.7,.3,1);
}
.card-lift:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip.brand {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: color-mix(in oklab, var(--brand) 18%, transparent);
}
.chip.success {
  background: var(--success-soft);
  color: var(--success);
  border-color: color-mix(in oklab, var(--success) 18%, transparent);
}
.chip.warning {
  background: var(--warning-soft);
  color: oklch(0.5 0.13 75);
  border-color: color-mix(in oklab, var(--warning) 18%, transparent);
}
.chip.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 18%, transparent);
}

/* ── Nav ── */

.nav-wrap {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: color-mix(in oklab, var(--bg) 75%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.nav-wrap.scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.nav-logo .mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: 0 4px 12px -3px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.25);
  font-size: 0;
  color: transparent;
  flex-shrink: 0;
}
.nav-logo .mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: white;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M 16 6 L 25 16 L 16 26 L 7 16 Z' stroke='black' stroke-width='2' fill='none' stroke-linejoin='round'/><path d='M 16 11 C 14 13.5 13 15 13 17.2 C 13 19.6 14.4 21 16 21 C 17.6 21 19 19.6 19 17.2 C 19 16 18.4 14.8 17.5 14 C 17.5 15.5 17 16 16.5 16 C 16.5 14 16.5 12.6 16 11 Z' fill='black'/></svg>") center / 80% no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M 16 6 L 25 16 L 16 26 L 7 16 Z' stroke='black' stroke-width='2' fill='none' stroke-linejoin='round'/><path d='M 16 11 C 14 13.5 13 15 13 17.2 C 13 19.6 14.4 21 16 21 C 17.6 21 19 19.6 19 17.2 C 19 16 18.4 14.8 17.5 14 C 17.5 15.5 17 16 16.5 16 C 16.5 14 16.5 12.6 16 11 Z' fill='black'/></svg>") center / 80% no-repeat;
  pointer-events: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 22px);
  font-size: 14px;
  color: var(--ink-3);
}
.nav-links a:not(.btn):hover { color: var(--ink); }

@media (max-width: 880px) { .nav-links .desktop-only { display: none; } }

/* ── Utility ── */

.grid { display: grid; gap: 24px; }
.flex { display: flex; gap: 16px; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.wrap { flex-wrap: wrap; }

.stack-xs { display: flex; flex-direction: column; gap: 6px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.stack-md { display: flex; flex-direction: column; gap: 18px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.stack-xl { display: flex; flex-direction: column; gap: 48px; }

/* ── Decorative ── */

.dot-grid {
  background-image: radial-gradient(circle, var(--ink-5) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.25;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.bento {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}

.bento-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  padding: clamp(24px, 3vw, 36px);
  position: relative;
  overflow: hidden;
  transition: all .22s cubic-bezier(.2,.7,.3,1);
}
.bento-card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.bento-card.dark {
  background: oklch(0.14 0.02 270);
  color: oklch(0.97 0.005 270);
  border-color: oklch(0.22 0.02 270);
}
.bento-card.brand {
  background: linear-gradient(180deg, var(--brand-soft) 0%, var(--bg) 100%);
}

/* Visible focus */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--brand);
  color: white;
}

/* ────────── Section rhythm refinements ────────── */

/* Calmer section breaks: subtle surface tint, no harsh contrast */
section + section { position: relative; }

/* Calm dark section variant — replaces over-saturated ink+glow combos */
.section-dark {
  background: oklch(0.18 0.022 165);
  color: oklch(0.97 0.005 165);
}
.section-dark .lede,
.section-dark .body,
.section-dark .body-lg,
.section-dark .body-sm {
  color: oklch(0.78 0.012 165);
}

/* Reduce all glow opacity globally */
.glow {
  opacity: 0.4;
}

.h1, .h2 { letter-spacing: -0.03em; }

/* Smoother button transitions */
.btn-primary {
  background: oklch(0.22 0.015 165);
}
.btn-primary:hover {
  background: oklch(0.3 0.018 165);
}

/* Eyebrow restyle: less brand-soft, more neutral */
.eyebrow {
  background: var(--surface-2);
  color: var(--ink-3);
  border-color: var(--line);
}
.eyebrow .dot {
  background: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--brand) 20%, transparent);
}
.eyebrow.subtle { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }
.eyebrow.subtle .dot { background: var(--ink-4); box-shadow: none; }

/* Chip refinements: drop heavy color-mixed defaults */
.chip { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.chip.brand { background: var(--brand-soft); color: var(--brand-deep); border-color: color-mix(in oklab, var(--brand) 22%, transparent); }
.chip.success { background: var(--success-soft); color: oklch(0.42 0.14 145); border-color: color-mix(in oklab, var(--success) 22%, transparent); }
.chip.warning { background: var(--warning-soft); color: oklch(0.45 0.12 75); border-color: color-mix(in oklab, var(--warning) 22%, transparent); }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in oklab, var(--danger) 22%, transparent); }
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

@keyframes shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in oklab, var(--brand) 40%, transparent) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shine 3s linear infinite;
}
