/* KilasOS website — hand written, no build step, no framework. */

:root {
  color-scheme: light;

  --bg: #f3f5f1;
  --bg-alt: #e9ede4;
  --surface: #ffffff;
  --surface-2: #eef2e9;
  --text: #16201b;
  --text-muted: #4b5751;
  --border: #ccd4c7;
  --border-strong: #86937f;
  --accent: #4a7506;
  --accent-hover: #3b5e05;
  --accent-contrast: #ffffff;
  --accent-soft: #e3edd2;
  --accent-text: #3f6405;
  --code-bg: #1c2420;
  --code-text: #e8ede8;
  --focus: #1c2420;
  --shadow: 0 1px 2px rgba(22, 32, 27, 0.08), 0 10px 24px rgba(22, 32, 27, 0.07);
  --radius: 14px;
  --radius-sm: 9px;
  --measure: 65ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #121814;
    --bg-alt: #171e19;
    --surface: #1c2420;
    --surface-2: #232d27;
    --text: #e9ede9;
    --text-muted: #a9b4ad;
    --border: #33403a;
    --border-strong: #6b7c72;
    --accent: #82b72e;
    --accent-hover: #97c742;
    --accent-contrast: #16210f;
    --accent-soft: #26331d;
    --accent-text: #a9d75c;
    --code-bg: #0d120f;
    --code-text: #e2e8e2;
    --focus: #c9e86a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 28px rgba(0, 0, 0, 0.45);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 650;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2rem, 1.35rem + 2.6vw, 3.1rem);
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
}

h3 {
  font-size: 1.125rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

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

code,
kbd,
pre,
samp {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.prose {
  max-width: var(--measure);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
  z-index: 20;
}

.skip-link:focus {
  left: 0;
  color: var(--accent-contrast);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

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

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-accent-soft {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent-text);
}

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

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(8px);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header {
    background: var(--bg);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  width: 2rem;
  height: 2rem;
  border-radius: 7px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.95rem;
}

.nav-list a:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

.header-cta {
  padding: 0.55rem 1rem;
}

.nav-mobile {
  position: relative;
  display: none;
}

.nav-mobile summary {
  list-style: none;
  cursor: pointer;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--surface);
}

.nav-mobile summary::-webkit-details-marker {
  display: none;
}

.nav-mobile summary::after {
  content: "";
  display: inline-block;
  margin-left: 0.5rem;
  border-left: 0.35rem solid transparent;
  border-right: 0.35rem solid transparent;
  border-top: 0.4rem solid currentColor;
  vertical-align: 0.15rem;
}

.nav-mobile .nav-list {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  display: block;
  min-width: 12rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  z-index: 15;
}

.nav-mobile .nav-list li + li {
  margin-top: 0.15rem;
}

.nav-mobile .nav-list a {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
}

.nav-mobile .nav-list a:hover {
  background: var(--surface-2);
}

/* ---------- hero ---------- */

.hero {
  padding: 3rem 0 2.5rem;
}

.hero-copy {
  max-width: 46rem;
}

.hero-eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: var(--measure);
}

.hero .btn-row {
  margin-top: 1.5rem;
}

.shot {
  margin: 2.5rem 0 0;
}

.shot img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.shot figcaption {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- sections ---------- */

.section {
  padding: 3.25rem 0;
  border-top: 1px solid var(--border);
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: var(--measure);
  margin-bottom: 2rem;
}

.section-head p {
  color: var(--text-muted);
  margin-bottom: 0;
}

.eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 0.4rem;
}

/* ---------- feature cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

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

.card p {
  color: var(--text-muted);
}

.card-note {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--accent-text);
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 2rem;
  align-items: center;
}

.split img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
}

/* ---------- comparison table ---------- */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.compare-table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.compare-table caption {
  text-align: left;
  padding: 1rem 1.1rem 0;
  color: var(--text-muted);
}

.compare-table th,
.compare-table td {
  padding: 0.7rem 1.1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.compare-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.compare-table tbody th {
  font-weight: 600;
}

.compare-table td {
  color: var(--text-muted);
}

.compare-table td.yes {
  color: var(--accent-text);
  font-weight: 600;
}

.compare-table tr.group th {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.compare-table .cta-cell {
  border-bottom: 0;
  padding-top: 1.1rem;
}

/* ---------- download ---------- */

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.plan {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.plan h3 {
  margin-bottom: 0.2rem;
}

.plan-price {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--accent-text);
  margin-bottom: 0.9rem;
}

.plan ul {
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.plan .btn {
  margin-top: auto;
  align-self: flex-start;
}

.plan .btn-row {
  margin-top: auto;
}

.note-block {
  max-width: var(--measure);
}

.note-block p:last-child {
  margin-bottom: 0;
}

.checksum {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.code-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
  border: 1px solid var(--border);
}

.code-scroll pre {
  margin: 0;
  white-space: pre;
  font-size: 0.9rem;
  line-height: 1.6;
}

.code-scroll code {
  font-size: inherit;
}

.hw-list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

/* ---------- faq ---------- */

.faq-list {
  max-width: var(--measure);
  margin: 0;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15rem 1.1rem;
}

.faq-list details + details {
  margin-top: 0.7rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.85rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "";
  margin-left: auto;
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--accent-text);
  border-bottom: 2px solid var(--accent-text);
  transform: rotate(45deg) translateY(-0.1rem);
  transition: transform 0.15s ease;
}

.faq-list details[open] summary::after {
  transform: rotate(-135deg) translateY(-0.1rem);
}

.faq-list .faq-body {
  padding-bottom: 0.9rem;
}

.faq-list .faq-body p:last-child {
  margin-bottom: 0;
}

.faq-list .faq-body ul {
  padding-left: 1.1rem;
  color: var(--text-muted);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2.5rem 0 2rem;
  margin-top: 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.75rem;
}

.footer-brand p {
  color: var(--text-muted);
  max-width: 32ch;
}

.footer-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.7rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li + li {
  margin-top: 0.45rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  justify-content: space-between;
}

/* ---------- 404 ---------- */

.notfound {
  padding: 5rem 0 4rem;
  text-align: left;
  max-width: var(--measure);
}

.notfound .code {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-text);
  margin: 0 0 0.75rem;
}

/* ---------- responsive ---------- */

@media (max-width: 60rem) {
  .nav-desktop {
    display: none;
  }

  .nav-mobile {
    display: block;
  }

  .hero {
    padding-top: 2.25rem;
  }
}

@media (max-width: 30rem) {
  .wrap {
    padding-inline: 1rem;
  }

  .brand {
    font-size: 1.05rem;
  }

  .header-cta {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .hero .btn-row .btn,
  .download-grid .btn {
    width: 100%;
  }

  .compare-table th,
  .compare-table td {
    padding: 0.65rem 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
