/* Kivara Lab — kivara.digital
   business-digest · professional-editorial · startup-charcoal */

:root {
  --primary: #20232A;
  --accent: #61DAFB;
  --bg: #F6F8FA;
  --text: #161B22;
  --muted: #7D8590;
  --white: #FFFFFF;
  --border: #D0D7DE;
  --border-strong: #B6BDC6;
  --surface: #FFFFFF;
  --overlay: rgba(32, 35, 42, 0.72);
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --container: 1140px;
  --font-sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --header-height: 64px;
  --line-tight: 1.28;
  --line-base: 1.65;
  --line-prose: 1.75;
  --ease: 0.22s ease;
  --shadow-card: 0 4px 16px rgba(32, 35, 42, 0.08), 0 1px 3px rgba(32, 35, 42, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(32, 35, 42, 0.12), 0 2px 6px rgba(32, 35, 42, 0.08);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: var(--line-base);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

main {
  flex: 1;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: var(--line-tight);
  color: var(--primary);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.375rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.625rem); }
h3 { font-size: 1.125rem; }
h4 { font-size: 0.9375rem; }

p {
  margin-bottom: var(--space-sm);
}

p:last-child {
  margin-bottom: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* 12-col classic grid */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-md);
}

.col-main { grid-column: 1 / -1; }
.col-aside { grid-column: 1 / -1; }

.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;
}

/* Cookie — top-strip */
.cookie-strip {
  display: none;
  background: var(--primary);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8125rem;
  line-height: 1.5;
  padding: var(--space-xs) var(--space-md);
  text-align: center;
  position: relative;
  z-index: 200;
}

.cookie-strip.is-visible {
  display: block;
}

.cookie-strip a {
  color: var(--accent);
}

.cookie-strip button {
  display: inline;
  margin-left: var(--space-xs);
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-strip button:hover {
  color: var(--white);
}

/* Header — logo-left-nav-right */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(32, 35, 42, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: var(--header-height);
  padding: var(--space-xs) 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--primary);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-lockup:hover {
  color: var(--accent);
}

.brand-lockup img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-lockup span {
  display: none;
}

.main-nav {
  display: none;
  align-items: center;
  gap: var(--space-xs);
  margin-left: auto;
}

.main-nav a {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--ease), color var(--ease);
}

.main-nav a:hover {
  background: var(--bg);
  color: var(--primary);
}

.main-nav a.is-active {
  color: var(--accent);
  background: rgba(97, 218, 251, 0.12);
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: var(--space-xs);
  margin-left: auto;
}

.main-nav + .menu-toggle {
  margin-left: 0;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: transform var(--ease), opacity var(--ease);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Vertical mobile drawer */
.mobile-drawer {
  display: none;
  flex-direction: column;
  gap: var(--space-xs);
  padding: 0 var(--space-md) var(--space-md);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.mobile-drawer.is-open {
  display: flex;
}

.mobile-drawer a {
  padding: var(--space-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
}

.mobile-drawer a:hover,
.mobile-drawer a.is-active {
  background: var(--bg);
  color: var(--accent);
  border-left-color: var(--accent);
}

/* Category strip */
.category-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) 0;
}

.category-strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.category-strip__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-right: var(--space-xs);
}

/* Tags — uppercase-small */
.tag {
  display: inline-block;
  padding: 0.15em 0.6em;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
  text-decoration: none;
  line-height: 1.5;
}

.tag--auto {
  background: rgba(97, 218, 251, 0.18);
  color: #0D8FB8;
}

.tag--tools {
  background: rgba(32, 35, 42, 0.08);
  color: var(--primary);
}

.tag--team {
  background: rgba(125, 133, 144, 0.15);
  color: #4A525C;
}

.tag--sme {
  background: rgba(97, 218, 251, 0.1);
  color: var(--text);
}

/* Subtle-ghost button */
.btn {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero — split-image-text */
.hero-split {
  padding: var(--space-xl) 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero-split__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.hero-split__content {
  order: 2;
}

.hero-split__media {
  order: 1;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.hero-split__media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hero-split__kicker {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.hero-split__content h1 {
  margin-bottom: var(--space-sm);
}

.hero-split__content h1 a {
  text-decoration: none;
  color: var(--primary);
}

.hero-split__content h1 a:hover {
  color: var(--accent);
}

.hero-split__lead {
  font-size: 1.0625rem;
  line-height: var(--line-prose);
  color: var(--muted);
  margin-bottom: var(--space-md);
}

.hero-split__byline {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: var(--space-md);
}

/* Lead story block */
.lead-story {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--border);
}

.lead-story__card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--ease);
}

.lead-story__card:hover {
  box-shadow: var(--shadow-card-hover);
}

.lead-story__thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
}

.lead-story__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lead-story__body {
  padding: 0 var(--space-md) var(--space-md);
}

.lead-story__body h2 {
  margin-bottom: var(--space-sm);
}

.lead-story__body h2 a {
  text-decoration: none;
  color: var(--primary);
}

.lead-story__body h2 a:hover {
  color: var(--accent);
}

/* Article list — horizontal-rows */
.article-list-section {
  padding: var(--space-xl) 0;
}

.article-list-header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--primary);
}

.article-list-header h2 {
  margin-bottom: var(--space-xs);
}

.article-list-header p {
  color: var(--muted);
  font-size: 0.9375rem;
}

.article-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.article-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--ease);
}

.article-row:hover {
  box-shadow: var(--shadow-card-hover);
}

.article-row__thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
}

.article-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-row__body {
  padding: 0 var(--space-md) var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.article-row__meta {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: var(--space-xs);
}

.article-row__title {
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
}

.article-row__title a {
  text-decoration: none;
  color: var(--primary);
}

.article-row__title a:hover {
  color: var(--accent);
}

.article-row__excerpt {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: var(--line-prose);
}

/* Intro prose */
.intro-block {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--border);
}

.intro-block .prose {
  max-width: 42rem;
}

.intro-block .prose p {
  line-height: var(--line-prose);
}

.prose h2 {
  margin-bottom: var(--space-sm);
}

.prose blockquote {
  margin: var(--space-md) 0;
  padding-left: var(--space-md);
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--muted);
}

/* Page header */
.page-header {
  padding: var(--space-xl) 0 var(--space-md);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

.page-header p {
  color: var(--muted);
  margin-top: var(--space-xs);
}

/* Article — split-content-rail */
.article-page {
  padding: var(--space-lg) 0 var(--space-xl);
}

.article-header {
  margin-bottom: var(--space-lg);
}

.article-byline {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: var(--space-sm);
}

.article-hero {
  margin-bottom: var(--space-lg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.article-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-content {
  line-height: var(--line-prose);
}

.article-content h2 {
  margin: var(--space-lg) 0 var(--space-sm);
}

.article-content blockquote {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: var(--bg);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--muted);
}

.article-updated {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.article-disclaimer {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: var(--space-md);
  padding: var(--space-sm);
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Right-rail sidebar */
.rail-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.aside-sticky {
  position: sticky;
  top: calc(var(--header-height) + var(--space-md));
}

.author-bio {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
}

.author-bio__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: var(--space-sm);
  border: 2px solid var(--border);
}

.author-bio__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-bio__label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: var(--space-xs);
}

.author-bio__name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.author-bio__role {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.author-bio__text {
  font-size: 0.875rem;
  line-height: var(--line-prose);
  color: var(--text);
}

.rail-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
}

.rail-box h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.rail-box li {
  margin-bottom: var(--space-xs);
  padding-bottom: var(--space-xs);
  border-bottom: 1px dashed var(--border);
}

.rail-box li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.rail-box a {
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
}

.rail-box span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.related-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.related-section h2 {
  margin-bottom: var(--space-md);
  font-size: 1.125rem;
}

.related-list li {
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px dashed var(--border);
}

.related-list a {
  font-weight: 600;
  text-decoration: none;
}

.related-list span {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Forms */
.form-field {
  margin-bottom: var(--space-md);
}

.form-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--primary);
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 0.75rem var(--space-sm);
  font: inherit;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-field textarea {
  min-height: 140px;
  resize: vertical;
}

.content-page {
  padding: var(--space-lg) 0 var(--space-xl);
}

.content-page .prose {
  max-width: 42rem;
  line-height: var(--line-prose);
}

.content-page .prose h2 {
  margin: var(--space-lg) 0 var(--space-sm);
}

.content-page .prose h3 {
  margin: var(--space-md) 0 var(--space-xs);
}

.content-page .prose ul {
  list-style: disc;
  margin: var(--space-sm) 0 var(--space-sm) var(--space-lg);
}

.content-page .prose li {
  margin-bottom: var(--space-xs);
}

/* Footer — three-column */
.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.88);
  padding: var(--space-xl) 0 var(--space-lg);
  margin-top: auto;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-masthead {
  text-align: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-masthead__edition {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-xs);
}

.footer-masthead__name {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-xs);
}

.footer-masthead__tagline {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.78);
  max-width: 32rem;
  margin: 0 auto;
  line-height: var(--line-prose);
}

.footer-grid {
  display: grid;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.footer-col h4 {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.footer-col li {
  margin-bottom: var(--space-xs);
}

.footer-col a {
  font-size: 0.875rem;
  text-decoration: none;
}

.footer-col a:hover {
  text-decoration: underline;
}

.footer-bottom {
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.text-center { text-align: center; }
.mt-md { margin-top: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Breakpoints */
@media (min-width: 640px) {
  .brand-lockup span {
    display: inline;
  }

  .article-row {
    grid-template-columns: 240px 1fr;
  }

  .article-row__body {
    padding: var(--space-md);
  }

  .lead-story__card {
    grid-template-columns: 1fr 1fr;
  }

  .lead-story__body {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .main-nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .hero-split__grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-split__content {
    order: 1;
  }

  .hero-split__media {
    order: 2;
  }

  .col-main {
    grid-column: span 8;
  }

  .col-aside {
    grid-column: span 4;
  }

  .grid-12--article .col-main {
    grid-column: span 8;
  }

  .grid-12--article .col-aside {
    grid-column: span 4;
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .article-row {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 767px) {
  .hero-split {
    padding: var(--space-lg) 0;
  }
}
