/* StackGrains — shared design system
   Product development · IT services · Technology consulting */

:root {
  --navy-900: #061225;
  --navy-800: #0b1c34;
  --navy-700: #12294a;
  --ink:      #0f1c2e;
  --body:     #45566b;
  --muted:    #6b7c93;
  --line:     #e2e8f0;
  --line-soft:#eef2f7;
  --surface:  #ffffff;
  --canvas:   #f6f8fb;
  --brand:    #1d5cff;
  --brand-dk: #0b3fc4;
  --accent:   #00c2b2;

  --radius:    14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15,28,46,.06), 0 1px 3px rgba(15,28,46,.05);
  --shadow-md: 0 8px 24px rgba(15,28,46,.08);
  --shadow-lg: 0 24px 60px rgba(15,28,46,.12);
  --maxw: 1180px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--surface);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 .6rem;
  font-weight: 700;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -.03em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  display: block;
  object-fit: contain;
}
.brand small {
  display: block;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -2px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  margin-left: auto;
}
.nav-links a {
  color: var(--body);
  font-size: .93rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--brand); text-decoration: none; }
.nav-links a.btn-primary,
.nav-links a.btn-primary:hover { color: #fff; }
.nav-cta { margin-left: .6rem; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .45rem .6rem;
  cursor: pointer;
  color: var(--ink);
  line-height: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .94rem;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(29,92,255,.28);
}
.btn-primary:hover { background: var(--brand-dk); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-light {
  background: rgba(255,255,255,.10);
  color: #fff;
  border-color: rgba(255,255,255,.32);
}
.btn-light:hover { background: rgba(255,255,255,.18); }
.btn-sm { padding: .55rem 1.05rem; font-size: .88rem; }

/* ---------- Sections ---------- */
section { padding: 5.5rem 0; }
.section-alt { background: var(--canvas); }

.eyebrow {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: .9rem;
}
.section-head { max-width: 680px; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.section-head p { font-size: 1.05rem; margin: 0; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--navy-900);
  background-image:
    radial-gradient(900px 460px at 78% -10%, rgba(0,194,178,.22), transparent 60%),
    radial-gradient(760px 420px at 12% 8%, rgba(29,92,255,.30), transparent 62%),
    linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 60%, var(--navy-700) 100%);
  color: #b9cbe2;
  padding: 6rem 0 5rem;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 4rem;
  align-items: center;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  letter-spacing: -.035em;
  margin-bottom: 1.1rem;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #6ea8ff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede {
  font-size: 1.14rem;
  color: #a9bdd6;
  max-width: 34rem;
  margin: 0 0 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .38rem .95rem .38rem .6rem;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  font-size: .8rem;
  color: #b9cbe2;
  margin-bottom: 1.6rem;
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,194,178,.18);
}

/* Hero code card */
.hero-card {
  background: rgba(9,20,38,.72);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-card .bar {
  display: flex; align-items: center; gap: .45rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.04);
}
.hero-card .bar i {
  width: 10px; height: 10px; border-radius: 50%; display: block;
}
.hero-card .bar span {
  margin-left: auto; font-size: .74rem; color: #7f93ac; letter-spacing: .06em;
  font-family: var(--mono);
}
.hero-card pre {
  margin: 0;
  padding: 1.3rem 1.4rem 1.6rem;
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.85;
  color: #93a9c4;
  overflow-x: auto;
}
.hero-card .k { color: #6ea8ff; }
.hero-card .s { color: #63d9c8; }
.hero-card .c { color: #5b6f8a; }
.hero-card .v { color: #e6edf6; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 4rem;
  padding-top: 2.4rem;
  border-top: 1px solid rgba(255,255,255,.12);
  position: relative; z-index: 1;
}
.hero-stats b {
  display: block;
  font-size: 1.85rem;
  color: #fff;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.hero-stats span { font-size: .85rem; color: #8ea4c0; }

/* ---------- Trust strip ---------- */
.strip { padding: 2.2rem 0; border-bottom: 1px solid var(--line); }
.strip p {
  text-align: center;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.3rem;
  font-weight: 600;
}
.strip ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2.6rem;
}
.strip li {
  font-weight: 700;
  font-size: 1rem;
  color: #94a3b8;
  letter-spacing: -.01em;
}

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.9rem;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card:hover {
  border-color: #c9d8f0;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.card h3 { font-size: 1.12rem; margin-bottom: .5rem; }
.card p { margin: 0; font-size: .95rem; }
.card ul {
  margin: 1.1rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--line-soft);
  list-style: none;
  font-size: .87rem;
}
.card ul li { padding-left: 1.2rem; position: relative; margin-bottom: .35rem; }
.card ul li::before {
  content: "";
  position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent);
}
.icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  margin-bottom: 1.15rem;
  background: linear-gradient(135deg, rgba(29,92,255,.12), rgba(0,194,178,.14));
  color: var(--brand);
}
.icon svg { width: 22px; height: 22px; }

/* ---------- Process ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 2.1rem; }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute; top: 0; left: 0;
  font-size: .78rem; font-weight: 800;
  letter-spacing: .12em;
  color: var(--brand);
}
.step::after {
  content: "";
  position: absolute; top: .55rem; left: 2.4rem; right: 0;
  height: 1px; background: var(--line);
}
.step h3 { font-size: 1.05rem; margin: .6rem 0 .45rem; }
.step p { font-size: .92rem; margin: 0; }

/* ---------- Split ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.checklist { list-style: none; margin: 1.8rem 0 0; padding: 0; }
.checklist li {
  position: relative;
  padding-left: 2.1rem;
  margin-bottom: 1.1rem;
  font-size: .97rem;
}
.checklist li strong { color: var(--ink); display: block; }
.checklist li::before {
  content: "";
  position: absolute; left: 0; top: .15rem;
  width: 22px; height: 22px; border-radius: 7px;
  background-color: rgba(0,194,178,.14);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300a294' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 13px;
  background-repeat: no-repeat;
  background-position: center;
}

/* ---------- Tech stack ---------- */
.stack-group { margin-bottom: 1.8rem; }
.stack-group h4 {
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .85rem;
}
.tags { display: flex; flex-wrap: wrap; gap: .55rem; }
.tag {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: .4rem .8rem;
  font-size: .85rem;
  color: var(--ink);
  font-weight: 500;
}

/* ---------- Insights ---------- */
.post {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.post:hover {
  border-color: #c9d8f0;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.post .thumb {
  height: 128px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: .02em;
  position: relative;
}
.post .thumb::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 24px 24px;
}
.post .thumb span { position: relative; z-index: 1; }
.post .body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.post .kicker {
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: .55rem;
}
.post h3 { font-size: 1.02rem; margin-bottom: .45rem; }
.post h3 a { color: var(--ink); }
.post h3 a:hover { color: var(--brand); text-decoration: none; }
.post p { font-size: .9rem; margin: 0 0 1rem; }
.post .more {
  margin-top: auto;
  font-size: .85rem;
  font-weight: 600;
  color: var(--brand);
}

/* ---------- CTA ---------- */
.cta {
  background-color: var(--navy-800);
  background-image:
    radial-gradient(700px 300px at 85% 0%, rgba(0,194,178,.24), transparent 60%),
    linear-gradient(140deg, var(--navy-800), var(--navy-900));
  color: #b9cbe2;
  border-radius: var(--radius-lg);
  padding: 3.4rem;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 2.5rem;
  align-items: center;
}
.cta h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.15rem); }
.cta p { margin: 0; font-size: 1.02rem; }
.cta-actions { display: flex; flex-direction: column; gap: .8rem; }
.cta-actions .btn { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: #8ea4c0;
  padding: 4rem 0 2rem;
  font-size: .92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.site-footer .brand { color: #fff; }
.site-footer .brand small { color: #7f93ac; }
.site-footer .about { margin: 1.1rem 0 0; max-width: 24rem; }
.site-footer h5 {
  color: #fff;
  font-size: .76rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  font-weight: 700;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .6rem; }
.site-footer a { color: #8ea4c0; }
.site-footer a:hover { color: #fff; }
.footer-note {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding-top: 1.6rem;
  font-size: .84rem;
  color: #6b829f;
}

/* ---------- Article pages ---------- */
.article {
  max-width: 780px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 1rem;
}
.article .crumbs {
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
}
.article h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}
.article h2 {
  font-size: 1.3rem;
  margin-top: 2.6rem;
}
.article p { font-size: 1.03rem; }
.article ul { padding-left: 1.2rem; }
.article li { margin-bottom: .6rem; }
.article strong { color: var(--ink); }
.article .meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  padding-bottom: 1.8rem;
  margin-bottom: 2.2rem;
  border-bottom: 1px solid var(--line);
  font-size: .84rem;
  color: var(--muted);
}
.article .meta .tag { font-size: .76rem; padding: .22rem .6rem; }
.article .further {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  font-size: .92rem;
  margin: 2rem 0;
}
.article .endcap {
  margin: 3rem 0 1rem;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
}
.article .endcap h3 { font-size: 1.1rem; }
.article .endcap p { font-size: .95rem; margin: 0 0 1.2rem; }

.article h3 { font-size: 1.08rem; margin-top: 1.9rem; }
.article .table-wrap {
  overflow-x: auto;
  margin: 1.7rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.article table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
}
.article th,
.article td {
  padding: .72rem .95rem;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.article th {
  background: var(--canvas);
  color: var(--ink);
  font-weight: 700;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.article tr:last-child td { border-bottom: 0; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .55s ease, transform .55s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .split, .cta { grid-template-columns: 1fr; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 1.8rem; }
  .cta { padding: 2.4rem; }
  .step::after { display: none; }
}
@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: .5rem 1.5rem 1.2rem;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .75rem 0; border-bottom: 1px solid var(--line-soft); }
  .nav-cta { margin: .9rem 0 0; justify-content: center; }
  .nav-toggle { display: block; }
  section { padding: 3.8rem 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .split { gap: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
