/*
  Warm soft / Mercury design system
  Shared tokens and reusable styles for bilingual portfolio/blog site
*/

:root {
  color-scheme: light;

  --bg: oklch(97% 0.018 70);
  --bg-elevated: oklch(99% 0.008 70);
  --bg-alt: oklch(95.5% 0.02 70);
  --surface: oklch(99% 0.008 70);
  --surface-strong: oklch(96.5% 0.012 70);
  --foreground: oklch(22% 0.02 50);
  --muted: oklch(50% 0.018 50);
  --muted-strong: oklch(38% 0.02 50);
  --border: oklch(90% 0.014 70);
  --border-strong: oklch(82% 0.018 60);
  --accent: oklch(64% 0.13 28);
  --accent-deep: oklch(54% 0.12 28);
  --accent-soft: oklch(90% 0.05 34);
  --success: oklch(62% 0.11 150);
  --shadow: 0 18px 48px -28px rgba(52, 31, 20, 0.22);
  --shadow-soft: 0 8px 24px -18px rgba(52, 31, 20, 0.18);
  --ring: 0 0 0 4px color-mix(in oklch, var(--accent) 18%, transparent);

  --radius-xs: 12px;
  --radius-sm: 14px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --font-display: 'Tiempos Headline', 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Sohne', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

  --container: 1180px;
  --gutter: clamp(18px, 3vw, 32px);
  --section-gap: clamp(28px, 4vw, 56px);
  --hero-gap: clamp(26px, 4vw, 44px);
  --card-pad: clamp(18px, 2.2vw, 26px);
  --card-pad-lg: clamp(22px, 2.6vw, 30px);

  --text-1: clamp(2.7rem, 6vw, 5.6rem);
  --text-2: clamp(2rem, 3.7vw, 3.3rem);
  --text-3: clamp(1.3rem, 2vw, 1.7rem);
  --text-4: clamp(1.02rem, 1.1vw, 1.08rem);
  --text-5: 0.92rem;

  --line: 1.55;
  --line-tight: 1.08;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.18, .9, .2, 1);
  --speed: 240ms;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--foreground);
  background:
    radial-gradient(1200px 700px at 15% -8%, color-mix(in oklch, var(--accent-soft) 72%, white), transparent 62%),
    radial-gradient(900px 540px at 95% 0%, color-mix(in oklch, var(--surface) 82%, white), transparent 64%),
    linear-gradient(180deg, var(--bg) 0%, color-mix(in oklch, var(--bg) 85%, white) 100%);
  line-height: var(--line);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a[href] { transition: color var(--speed) var(--ease-out), border-color var(--speed) var(--ease-out), background-color var(--speed) var(--ease-out), transform var(--speed) var(--ease-out); }
a:hover { color: var(--accent-deep); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-color: color-mix(in oklch, var(--accent) 32%, var(--border));
}
button, input, select, textarea { font: inherit; }
::selection { background: color-mix(in oklch, var(--accent) 28%, white); }

.skip-link {
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--foreground);
  color: var(--surface);
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(var(--container), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: color-mix(in oklch, var(--bg) 72%, transparent);
  border-bottom: 1px solid color-mix(in oklch, var(--border) 82%, transparent);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
}

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.brand-mark strong,
.brand-mark span {
  display: block;
  line-height: 1;
}
.brand-mark strong {
  font-family: var(--font-display);
  font-size: 1.18rem;
  letter-spacing: 0.02em;
  font-weight: 600;
}
.brand-mark span {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted-strong);
  background: transparent;
  font-size: 0.95rem;
}
.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--foreground);
  border-color: var(--border);
  background: color-mix(in oklch, var(--surface) 88%, white);
}

.main {
  flex: 1;
  padding: clamp(20px, 2vw, 34px) 0 68px;
}

.section {
  padding-block: var(--section-gap);
}
.section + .section { border-top: 1px solid color-mix(in oklch, var(--border) 72%, transparent); }

.hero {
  padding-top: clamp(18px, 2vw, 28px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: var(--hero-gap);
  align-items: stretch;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--surface) 84%, white);
  border: 1px solid color-mix(in oklch, var(--border) 88%, transparent);
  color: var(--muted-strong);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}
.kicker::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 14%, transparent);
}

.hero h1,
.hero h2,
.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: var(--line-tight);
}
.hero h1 { font-size: var(--text-1); max-width: 11ch; }
.hero h2 { font-size: var(--text-2); }
.section-title { font-size: var(--text-2); }

.lead {
  margin: 0;
  font-size: clamp(1.02rem, 1.2vw, 1.18rem);
  color: var(--muted-strong);
  max-width: 62ch;
}

.hero-copy {
  display: grid;
  gap: 18px;
  align-content: start;
  padding-top: 6px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: transparent;
}
.btn-primary {
  background: var(--foreground);
  color: var(--surface);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { background: color-mix(in oklch, var(--foreground) 90%, black); color: var(--surface); transform: translateY(-1px); }
.btn-secondary {
  background: color-mix(in oklch, var(--surface) 84%, white);
  border-color: var(--border);
  color: var(--foreground);
}
.btn-secondary:hover { background: var(--surface); transform: translateY(-1px); }
.btn-accent {
  background: color-mix(in oklch, var(--accent) 12%, white);
  border-color: color-mix(in oklch, var(--accent) 28%, var(--border));
  color: var(--accent-deep);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 0.92rem;
}
.meta-chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--surface) 78%, white);
  border: 1px solid color-mix(in oklch, var(--border) 90%, transparent);
}

.hero-visual,
.panel,
.card,
.article-card,
.blog-card,
.proof-card,
.feature-card,
.cta-panel {
  background: linear-gradient(180deg, color-mix(in oklch, var(--surface) 90%, white), var(--surface));
  border: 1px solid color-mix(in oklch, var(--border) 86%, transparent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.hero-visual {
  overflow: hidden;
  padding: var(--card-pad-lg);
  position: relative;
  isolation: isolate;
  min-height: 100%;
}
.hero-visual::before,
.hero-visual::after {
  content: '';
  position: absolute;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
}
.hero-visual::before {
  width: 220px;
  height: 220px;
  right: -56px;
  top: -42px;
  background: radial-gradient(circle at 30% 30%, color-mix(in oklch, var(--accent) 18%, white), transparent 68%);
  filter: blur(4px);
}
.hero-visual::after {
  width: 170px;
  height: 170px;
  left: -40px;
  bottom: -46px;
  background: radial-gradient(circle at 35% 35%, color-mix(in oklch, var(--accent-soft) 60%, white), transparent 68%);
}

.visual-stack {
  position: relative;
  display: grid;
  gap: 14px;
}
.visual-panel {
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid color-mix(in oklch, var(--border) 88%, transparent);
  background: color-mix(in oklch, var(--bg-elevated) 94%, white);
}

.visual-card-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.mini-figure {
  min-height: 148px;
  border-radius: var(--radius-md);
  padding: 16px;
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--accent-soft) 72%, white), color-mix(in oklch, var(--surface) 94%, white));
  border: 1px solid color-mix(in oklch, var(--border) 84%, transparent);
}

.sparkline {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 128px;
  padding: 10px 6px 0;
}
.sparkline span {
  flex: 1;
  border-radius: 999px 999px 12px 12px;
  background: linear-gradient(180deg, color-mix(in oklch, var(--accent) 85%, white), color-mix(in oklch, var(--accent-deep) 85%, black));
  opacity: 0.92;
}
.sparkline span:nth-child(1) { height: 36%; }
.sparkline span:nth-child(2) { height: 58%; }
.sparkline span:nth-child(3) { height: 48%; }
.sparkline span:nth-child(4) { height: 76%; }
.sparkline span:nth-child(5) { height: 61%; }
.sparkline span:nth-child(6) { height: 87%; }

.caption {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--muted);
}

.dashboard-grid,
.feature-grid,
.proof-grid,
.article-grid {
  display: grid;
  gap: 16px;
}
.dashboard-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }

.feature-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.feature-card {
  grid-column: span 4;
  padding: var(--card-pad-lg);
  min-height: 100%;
  position: relative;
  overflow: hidden;
}
.feature-card h3,
.card h3,
.article-card h3,
.blog-card h3,
.proof-card h3 {
  margin: 0 0 10px;
  font-size: var(--text-3);
  font-family: var(--font-display);
  line-height: 1.16;
  letter-spacing: -0.02em;
}
.feature-card p,
.card p,
.article-card p,
.blog-card p,
.proof-card p { margin: 0; color: var(--muted-strong); }

.feature-card .card-note {
  display: inline-flex;
  margin-top: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--accent-soft) 58%, white);
  color: var(--accent-deep);
  border: 1px solid color-mix(in oklch, var(--accent) 18%, var(--border));
  font-size: 0.85rem;
}

.proof-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.proof-card {
  grid-column: span 6;
  padding: var(--card-pad-lg);
}
.proof-card .eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  margin-bottom: 10px;
}

.panel {
  padding: var(--card-pad-lg);
}

.article-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.article-card,
.blog-card {
  grid-column: span 12;
  padding: var(--card-pad-lg);
  display: grid;
  gap: 16px;
}

.article-meta,
.blog-meta,
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.88rem;
}
.tag,
.pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--border) 90%, transparent);
  background: color-mix(in oklch, var(--surface) 84%, white);
}
.tag--accent,
.pill--accent {
  background: color-mix(in oklch, var(--accent-soft) 62%, white);
  color: var(--accent-deep);
  border-color: color-mix(in oklch, var(--accent) 18%, var(--border));
}

.article-card h3,
.blog-card h3 { max-width: 28ch; }
.article-link,
.blog-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-weight: 600;
  color: var(--accent-deep);
}
.article-link::after,
.blog-link::after {
  content: '↗';
  font-size: 0.95em;
  transition: transform var(--speed) var(--ease-out);
}
.article-link:hover::after,
.blog-link:hover::after { transform: translateX(2px); }

.cta-panel {
  padding: clamp(22px, 3vw, 32px);
  display: grid;
  gap: 14px;
}
.cta-panel .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer {
  border-top: 1px solid color-mix(in oklch, var(--border) 72%, transparent);
  padding: 28px 0 38px;
  color: var(--muted-strong);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.9fr;
  gap: 24px;
  align-items: start;
}
.footer h2,
.footer h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  line-height: 1.12;
  color: var(--foreground);
}
.footer p,
.footer li { color: var(--muted-strong); }
.footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.footer a:hover { color: var(--accent-deep); }
.footer-bottom {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid color-mix(in oklch, var(--border) 72%, transparent);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 18px;
  font-size: 0.9rem;
}

.rte,
.prose {
  display: grid;
  gap: 16px;
}
.rte :is(p, ul, ol, blockquote),
.prose :is(p, ul, ol, blockquote) {
  margin: 0;
  color: var(--muted-strong);
  font-size: var(--text-4);
}
.rte h2,
.rte h3,
.prose h2,
.prose h3 {
  margin: 16px 0 0;
  font-family: var(--font-display);
  line-height: 1.14;
}
.rte h2,
.prose h2 { font-size: clamp(1.55rem, 2.4vw, 2.2rem); }
.rte h3,
.prose h3 { font-size: clamp(1.2rem, 1.7vw, 1.55rem); }
.rte blockquote,
.prose blockquote {
  padding: 16px 18px;
  border-left: 3px solid color-mix(in oklch, var(--accent) 55%, var(--border));
  background: color-mix(in oklch, var(--surface) 86%, white);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.data-shell {
  display: grid;
  gap: 18px;
}

[data-shpitto-blog-root] {
  display: grid;
  gap: 16px;
}

[data-shpitto-blog-list] {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.blog-card {
  grid-column: span 12;
}

.blog-card .story-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.blog-card .story-topline .tag + .tag { margin-left: 8px; }

.blog-card .story-body {
  display: grid;
  gap: 12px;
}

.blog-card .story-body p {
  max-width: 68ch;
}

.blog-card .story-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.small-note {
  font-size: 0.88rem;
  color: var(--muted);
}

.hr {
  height: 1px;
  background: color-mix(in oklch, var(--border) 76%, transparent);
  border: 0;
  margin: 0;
}

@media (max-width: 1100px) {
  .hero-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .feature-card { grid-column: span 6; }
  .proof-card { grid-column: span 12; }
}

@media (max-width: 820px) {
  .header-row { flex-wrap: wrap; }
  .site-nav { width: 100%; justify-content: flex-start; }
  .hero h1 { max-width: 12ch; }
  .feature-card { grid-column: span 12; }
  .grid-two { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root {
    --gutter: 14px;
    --section-gap: 26px;
    --hero-gap: 18px;
  }

  .site-nav {
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }

  .hero-actions,
  .cta-panel .cta-row,
  .footer-bottom { flex-direction: column; align-items: stretch; }
  .btn,
  .button { width: 100%; }

  .hero-visual { min-height: auto; }
  .visual-card-grid { grid-template-columns: 1fr; }
  .article-card,
  .blog-card,
  .proof-card,
  .feature-card,
  .cta-panel,
  .panel,
  .hero-visual {
    border-radius: var(--radius-md);
  }

  [data-shpitto-blog-list] { gap: 14px; }
}

@container (min-width: 720px) {
  .card[data-span='wide'] { grid-column: span 8; }
}

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