:root {
  --bg: #f7f7fb;
  --bg-2: #ffffff;
  --text: #13151c;
  --muted: #5d6474;
  --line: rgba(15, 23, 42, 0.09);
  --accent: #330066;
  --accent-2: #ff0000;
  --brand: #330066;
  --accent-contrast: #ffffff;
  --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 50px -24px rgba(15, 23, 42, 0.25);
  --radius: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d0f14;
    --bg-2: #151821;
    --text: #eceef4;
    --muted: #9aa1b2;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #c9a6ff;
    --accent-2: #ff5b5b;
    --brand: #e6d6ff;
    --accent-contrast: #0d0f14;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 60px -28px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0d0f14;
  --bg-2: #151821;
  --text: #eceef4;
  --muted: #9aa1b2;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #c9a6ff;
  --accent-2: #ff5b5b;
  --brand: #e6d6ff;
  --accent-contrast: #0d0f14;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
}
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--bg-2);
}

/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand svg {
  width: 32px;
  height: 32px;
}
.nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav ul a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
  font-size: 15px;
}
.nav ul a:hover {
  color: var(--text);
  background: var(--line);
}
@media (max-width: 640px) {
  .nav ul li:not(:last-child) {
    display: none;
  }
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.btn svg {
  width: 18px;
  height: 18px;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-primary:hover {
  transform: translateY(-1px);
}
.btn-ghost {
  border-color: var(--line);
  background: var(--bg-2);
}
.btn-ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* sections */
.hero {
  position: relative;
  padding: 92px 0 72px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto;
  height: 720px;
  background:
    radial-gradient(40% 50% at 30% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(35% 45% at 75% 30%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.eyebrow b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}
h1 {
  margin: 22px 0 18px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  max-width: 900px;
}
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  max-width: 680px;
  margin: 0 0 32px;
  font-size: clamp(18px, 2vw, 21px);
  color: var(--muted);
}
section {
  padding: 72px 0;
}
.section-head {
  max-width: 680px;
  margin-bottom: 36px;
}
h2 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
h3 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.muted {
  color: var(--muted);
}

/* cards */
.grid {
  display: grid;
  gap: 20px;
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}
.icon-dot {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.icon-dot svg {
  width: 22px;
  height: 22px;
}

.product {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
  padding: 0;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.product:hover {
  transform: translateY(-3px);
}
.product .media {
  background: linear-gradient(140deg, #4a148c, #1c0038);
  min-height: 300px;
}
.product .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product .body {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.product .body p {
  color: var(--muted);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 4px;
}
.tag {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.tag-accent {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.more {
  margin-top: auto;
  font-weight: 650;
  color: var(--accent);
}
.soon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 220px;
  border-style: dashed;
  box-shadow: none;
}
@media (max-width: 860px) {
  .product {
    grid-template-columns: 1fr;
  }
}

/* product page */
.viewer {
  height: min(78vh, 720px);
  min-height: 460px;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.gallery figure {
  margin: 0;
}
.gallery a {
  display: block;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
}
.gallery img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.4s;
}
.gallery a:hover img {
  transform: scale(1.03);
}
.gallery figcaption {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
}
.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.spec th,
.spec td {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.spec th {
  width: 38%;
  color: var(--muted);
  font-weight: 550;
}
code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: var(--line);
}
pre {
  margin: 0;
  padding: 20px;
  border-radius: 16px;
  background: #0d0f14;
  color: #d7dae3;
  overflow: auto;
  font-size: 14px;
  line-height: 1.6;
}
pre code {
  background: none;
  padding: 0;
}
.check {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.check li {
  display: flex;
  gap: 10px;
}
.check li::before {
  content: '';
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23330066' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* footer */
footer {
  padding: 48px 0 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}
footer a {
  color: var(--muted);
}

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

/* Codestan wordmark (Corbel, as in the brand logo) */
.brand {
  gap: 11px;
}
.brand img {
  width: 38px;
  height: auto;
}
.brand-text {
  display: grid;
  line-height: 1;
  font-family: Corbel, Candara, 'Segoe UI', system-ui, sans-serif;
  color: var(--brand);
}
.brand-text b {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}
.brand-text small {
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.nav .wrap {
  height: 72px;
}

/* tech stack */
.stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stack-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
}
/* the badge is decoration drawn by CSS: it stays out of the page text (copy, search snippets, screen readers) */
.stack-item::before {
  content: attr(data-abbr);
  content: attr(data-abbr) / "";
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--c);
  color: var(--t, #fff);
  font: 800 16px/1 ui-monospace, 'Cascadia Code', Consolas, monospace;
  letter-spacing: -0.02em;
}
.stack-item b {
  font-size: 17px;
}
.stack-item b {
  display: block;
}
.stack-item small {
  display: block;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.35;
}
.stack-section {
  padding-top: 24px;
}

@media (max-width: 900px) {
  .stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 460px) {
  .stack {
    grid-template-columns: 1fr;
  }
}

/* visually hidden text: kept for copy, reader mode and screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Folio3D Reader: app page */
.app-title img {
  display: block;
  margin-bottom: 18px;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
}
.app-hero {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
}
.gallery.phones {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.gallery.phones img {
  aspect-ratio: 1 / 2;
  width: 100%;
  height: auto;
}
.product .media.media-light {
  background: linear-gradient(140deg, #eef1f8, #cfd6ec);
}
