/* Kontainer × Strapi demo storefront. Brand palette mirrors kontainer.com:
   deep teal #063937, signature green #00f595, gold #c0a17c. Mobile-first. */
:root {
  --bg: #f2f2f2;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #e9edec;
  --text: #063937;      /* deep teal — Kontainer's primary ink */
  --muted: #5c716f;
  --faint: #94a5a3;
  --line: #dce3e1;
  --accent: #063937;    /* deep teal — links, numerals, JSON keys */
  --accent-2: #00f595;  /* signature green — CTAs, accents */
  --gold: #c0a17c;      /* muted gold — eyebrow labels */
  --danger: #ff6b6b;
  --brand-dark: #063937;/* dark brand surface — footer */
  --on-brand: #ffffff;  /* text/logo on the dark brand surface */
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --nav-h: 66px;
  --shadow: 0 18px 50px -24px rgba(6, 57, 55, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #041f1d;
    --bg-2: #063937;
    --surface: #0a2c2a;
    --surface-2: #0e3a37;
    --text: #eaf5f2;
    --muted: #9db8b4;
    --faint: #6e8b87;
    --line: #164a46;
    --accent: #00f595;    /* green pops on the dark teal ground */
    --accent-2: #00f595;
    --gold: #cbb08e;
    --brand-dark: #052e2c;
    --on-brand: #eaf5f2;
    --shadow: 0 18px 60px -20px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.08; margin: 0; }
h1, h2 { font-weight: 300; }   /* Kontainer's airy, light-weight display type */
p { margin: 0; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.eyebrow {
  color: var(--gold);
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}
.muted { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s var(--ease), background .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-2); color: #063937; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-2) 86%, #063937); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; height: 100%; gap: 16px; }
/* Kontainer wordmark — a single SVG masked so it inherits the surrounding
   text color: deep teal on the light nav, white on the dark footer. */
.brand {
  display: inline-block; width: 156px; height: 24px; flex: none;
  background: currentColor; color: var(--text);
  -webkit-mask: url(/site/assets/kontainer-logo.svg) left center / contain no-repeat;
  mask: url(/site/assets/kontainer-logo.svg) left center / contain no-repeat;
}
.nav-links { display: none; margin-left: 12px; gap: 4px; }
.nav-links a {
  color: var(--muted); font-size: 15px; font-weight: 500;
  padding: 8px 14px; border-radius: 10px; transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-badge { display: none; font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 5px 11px; border-radius: 999px; }
.nav-badge b { color: var(--accent-2); }
.hamburger {
  margin-left: auto; display: inline-flex; flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav.open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .hamburger span:nth-child(2) { opacity: 0; }
.nav.open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 40;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
  padding: 12px 20px 20px; display: none; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow);
}
.nav.open + .mobile-menu { display: flex; }
.mobile-menu a { color: var(--text); padding: 14px 6px; font-size: 18px; font-weight: 600; border-bottom: 1px solid var(--line); }
.mobile-menu a:last-child { border-bottom: 0; }

@media (min-width: 860px) {
  .nav-links { display: flex; }
  .nav-badge { display: inline-block; }
  .hamburger { display: none; }
  .mobile-menu { display: none !important; }
}

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero-media { position: relative; min-height: 62vh; background: var(--surface-2); }
.hero-media img, .hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 35%, transparent) 0%, transparent 30%, color-mix(in srgb, var(--bg) 92%, transparent) 100%);
}
.hero-copy { position: relative; z-index: 2; padding: 22vh 0 56px; }
.hero-copy h1 { font-size: clamp(34px, 8vw, 76px); max-width: 15ch; }
.hero-copy p { margin-top: 16px; max-width: 46ch; font-size: clamp(16px, 2.4vw, 20px); color: var(--text); opacity: 0.9; }
.hero-actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }

/* Sections */
.section { padding: 64px 0; }
@media (min-width: 720px) { .section { padding: 92px 0; } }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 5vw, 44px); margin-top: 10px; }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 17px; }

/* Grid + cards */
/* Let grid/flex children shrink below their content so inner overflow-x
   containers (e.g. the JSON <pre>) scroll instead of widening the page. */
.grid > *, .split > *, .card, .feature > div, .step { min-width: 0; }
.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: transform .25s var(--ease), border-color .2s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow); }
.card-media { aspect-ratio: 4 / 3; background: var(--surface-2); position: relative; overflow: hidden; }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 18px 20px; }
.card-body .title { font-weight: 700; font-size: 18px; }
.card-body .meta { color: var(--muted); font-size: 14px; margin-top: 5px; }
.card-tag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 5px 10px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px); color: var(--text);
}

/* Detail: media section split */
.split { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 820px) { .split { grid-template-columns: 1.3fr 1fr; gap: 44px; } }
.split.reverse > :first-child { order: 0; }
@media (min-width: 820px) { .split.reverse > :first-child { order: 1; } }
.split .media img, .split .media video { width: 100%; border-radius: var(--radius); }
.split .media { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }

/* File card (non-visual assets) */
.file-card {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s;
}
.file-card:hover { border-color: var(--accent); }
.file-ext {
  flex: none; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 12px; padding: 14px 16px;
}
.file-card .name { font-weight: 650; }
.file-card .desc { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* JSON reveal */
.reveal { margin-top: 16px; }
.reveal summary {
  cursor: pointer; color: var(--muted); font-size: 13.5px; list-style: none;
  display: inline-flex; align-items: center; gap: 8px; user-select: none; font-weight: 500;
}
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary::before { content: "›"; font-size: 18px; line-height: 1; transition: transform .2s; color: var(--accent); }
.reveal[open] summary::before { transform: rotate(90deg); }
.reveal pre {
  margin: 12px 0 0; padding: 18px; overflow-x: auto; font: 12.5px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text);
}
.reveal pre .k { color: var(--accent); }
.reveal pre .s { color: var(--accent-2); }
.reveal pre .n { color: #e0a458; }

/* "How it works" band */
.band { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.step .num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); margin-bottom: 14px; }
.step h3 { font-size: 18px; }
.step p { color: var(--muted); font-size: 15px; margin-top: 8px; }

/* Flow diagram (about) */
.flow { display: flex; align-items: stretch; gap: 14px; margin-top: 8px; }
.flow .node { flex: 1 1 0; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.flow .node b { display: block; font-size: 16px; }
.flow .node span { color: var(--muted); font-size: 14px; }
.flow .arrow { flex: none; align-self: center; color: var(--faint); font-size: 22px; }
@media (max-width: 620px) {
  .flow { flex-direction: column; }
  .flow .arrow { transform: rotate(90deg); align-self: center; }
}

/* Feature list */
.features { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 700px) { .features { grid-template-columns: repeat(2, 1fr); } }
.feature { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.feature .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); margin-top: 8px; }
.feature h3 { font-size: 16px; }
.feature p { color: var(--muted); font-size: 14.5px; margin-top: 4px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none; place-items: center;
  background: rgba(0, 0, 0, 0.9); padding: 24px; cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); cursor: default; }
.lightbox .close { position: absolute; top: 18px; right: 22px; font-size: 34px; color: #fff; background: none; border: 0; cursor: pointer; line-height: 1; }

/* Footer — dark brand surface, white wordmark */
footer { padding: 56px 0; background: var(--brand-dark); color: var(--on-brand); }
footer .cols { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
footer .muted { color: color-mix(in srgb, var(--on-brand) 68%, transparent); font-size: 14px; max-width: 52ch; }
footer .brand { width: 176px; height: 27px; color: var(--on-brand); }
footer .btn-ghost { color: var(--on-brand); border-color: color-mix(in srgb, var(--on-brand) 34%, transparent); }
footer .btn-ghost:hover { border-color: var(--accent-2); }

/* States */
.state { padding: 18vh 0; text-align: center; }
.state h1 { font-size: clamp(28px, 6vw, 46px); }
.state p { color: var(--muted); max-width: 52ch; margin: 14px auto 0; }
.state .actions { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.state code { background: var(--surface-2); padding: 3px 8px; border-radius: 6px; font-family: ui-monospace, monospace; font-size: 14px; }

/* Skeleton loading */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 8%, transparent), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-hero { height: 62vh; border-radius: 0; }
.sk-card { aspect-ratio: 4 / 3; }

/* Back link */
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; margin-bottom: 20px; }
.back:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
