/* Codeposito site styles.
   Colours come from the Codeposito logo kit (colors.json). Pages follow the
   visitor's light or dark setting. Fonts: Inter for text, JetBrains Mono for
   labels, both self-hosted (SIL Open Font License, see assets/fonts). */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand colours */
  --ink: #0F1222;
  --ink-raised: #1C2237;
  --white: #FFFFFF;
  --teal: #2DD4BF;
  --teal-deep: #0F766E;
  --violet: #8B5CF6;
  --surface: #F6F7FB;
  --slate: #4A5368;

  /* Light theme */
  --bg: var(--white);
  --bg-alt: var(--surface);
  --card: var(--white);
  --heading: var(--ink);
  --text: var(--slate);
  --muted: #5B6478;
  --border: #E3E6EE;
  --border-strong: #CBD1DD;
  --link: var(--teal-deep);
  --icon: var(--teal-deep);
  --icon-bg: rgba(45, 212, 191, 0.14);
  --cursor: #14B8A6;
  --dot: rgba(15, 18, 34, 0.13);
  --header-bg: rgba(255, 255, 255, 0.86);
  --btn-bg: var(--teal);
  --btn-bg-hover: #29BDAC;
  --btn-text: var(--ink);
  --shadow: 0 1px 2px rgba(15, 18, 34, 0.04), 0 8px 24px rgba(15, 18, 34, 0.05);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--ink);
    --bg-alt: #141829;
    --card: var(--ink-raised);
    --heading: var(--white);
    --text: #C3C9D6;
    --muted: #8F97AC;
    --border: #262D45;
    --border-strong: #3A4361;
    --link: var(--teal);
    --icon: var(--teal);
    --icon-bg: rgba(45, 212, 191, 0.12);
    --cursor: var(--teal);
    --dot: rgba(255, 255, 255, 0.085);
    --header-bg: rgba(15, 18, 34, 0.82);
    --btn-bg-hover: #57DDCC;
    --shadow: none;
  }
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3 {
  margin: 0;
  color: var(--heading);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

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

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }

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

[id] { scroll-margin-top: 5.5rem; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  background: var(--heading);
  color: var(--bg);
  font-weight: 600;
}
.skip-link:focus { left: 0.75rem; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  min-height: 4rem;
}

.brand { display: inline-flex; padding: 0.5rem 0; }
.brand img { width: auto; height: 32px; }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }
.site-nav a {
  color: var(--heading);
  font-size: 0.95rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--link); text-decoration: none; }

@media (max-width: 30rem) {
  .brand img { height: 28px; }
  .site-nav { gap: 0.25rem 1.1rem; }
  .site-nav a { font-size: 0.9rem; }
}

@media (max-width: 22.5rem) {
  .header-inner { column-gap: 0.75rem; }
  .brand img { height: 24px; }
  .site-nav { gap: 0.25rem 0.7rem; }
  .site-nav a { font-size: 0.82rem; }
}

/* Labels */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font: 600 0.78rem/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 1.15rem;
  height: 0.17rem;
  border-radius: 1px;
  background: var(--cursor);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--heading);
  font: 600 0.72rem/1 var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--violet);
}

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  font: 600 1rem/1.2 var(--font-sans);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn svg { flex: none; width: 1.05em; height: 1.05em; }

.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { background: var(--btn-bg-hover); }

.btn-secondary { border-color: var(--border-strong); color: var(--heading); }
.btn-secondary:hover { border-color: var(--heading); }

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4.5rem, 12vw, 9rem) 0 clamp(4rem, 10vw, 7.5rem);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 72% 40%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 85% at 72% 40%, #000 15%, transparent 72%);
}
.hero .wrap { position: relative; }

.hero h1 {
  max-width: 13ch;
  font-size: clamp(2.75rem, 8vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

/* The cursor from the logo: a bar under the next character. */
.cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.12em;
  margin-left: 0.07em;
  vertical-align: -0.2em;
  border-radius: 0.02em;
  background: var(--cursor);
  animation: blink 1.2s steps(1, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.lede {
  max-width: 38rem;
  margin: 1.75rem 0 0;
  color: var(--text);
  font-size: clamp(1.15rem, 2.3vw, 1.375rem);
  line-height: 1.55;
}

/* Sections */

.section { padding: clamp(4rem, 9vw, 6.5rem) 0; }
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-rule { border-top: 1px solid var(--border); }

.section h2 { font-size: clamp(2rem, 4.5vw, 2.9rem); }
.section h2 + p { margin-top: 1.25rem; }

/* meghOS */

.product {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}

.product-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
}
.product-title img { width: 3.75rem; height: 3.75rem; }

.product-tagline {
  margin: 0 0 1rem;
  color: var(--heading);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.product-intro > p { max-width: 34rem; }

.channels { color: var(--muted); }
.channels strong { color: var(--heading); font-weight: 600; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-weight: 600;
}
.text-link svg { width: 1em; height: 1em; transition: transform 0.15s ease; }
.text-link:hover svg { transform: translateX(2px); }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: var(--shadow);
}
.card .icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1.1rem;
  border-radius: 0.7rem;
  background: var(--icon-bg);
  color: var(--icon);
}
.card .icon svg { width: 1.3rem; height: 1.3rem; }
.card h3 { margin-bottom: 0.45rem; font-size: 1.1rem; letter-spacing: -0.012em; }
.card p { font-size: 0.98rem; line-height: 1.6; }

@media (min-width: 60rem) {
  .product { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

/* About */

.about {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}
.about-copy > p { max-width: 36rem; }

.facts {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: var(--shadow);
}
.facts > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.05rem 1.35rem;
  border-top: 1px solid var(--border);
}
.facts > div:first-child { border-top: 0; }
.facts dt {
  padding-top: 0.2rem;
  color: var(--muted);
  font: 600 0.74rem/1.6 var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.facts dd {
  margin: 0;
  color: var(--heading);
  font-weight: 500;
  overflow-wrap: anywhere;
}

@media (min-width: 60rem) {
  .about { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
}
@media (max-width: 30rem) {
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
}

/* Contact */

.email-link {
  display: inline-block;
  margin: 1.75rem 0 1.25rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--cursor);
  color: var(--heading);
  font: 600 clamp(1.2rem, 4vw, 2rem)/1.25 var(--font-mono);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.email-link:hover { color: var(--link); text-decoration: none; }

.muted { color: var(--muted); }

/* Footer */

.site-footer {
  padding: 2.75rem 0 3rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.75rem 3rem;
}
.footer-brand img { width: auto; height: 20px; margin-bottom: 1rem; }
.footer-brand p { margin: 0; line-height: 1.6; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-nav a { color: var(--text); }
.footer-nav a:hover { color: var(--link); }

/* Legal pages */

.legal { padding: clamp(3rem, 8vw, 5rem) 0 clamp(4rem, 9vw, 6rem); }
.legal .wrap { max-width: 48rem; }

.doc-head { padding-bottom: 2.25rem; }
.doc-head h1 { font-size: clamp(2.3rem, 6vw, 3.4rem); letter-spacing: -0.035em; }
.doc-head .lede { margin-top: 1rem; color: var(--muted); font-size: 1.15rem; }

.legal section { padding: 2rem 0; border-top: 1px solid var(--border); }
.legal h2 { margin-bottom: 0.9rem; font-size: 1.3rem; letter-spacing: -0.015em; }
.legal ul, .legal ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.legal li { margin-bottom: 0.55rem; padding-left: 0.2rem; }
.legal li::marker { color: var(--muted); }
.legal ul:last-child, .legal ol:last-child { margin-bottom: 0; }
.legal strong { color: var(--heading); font-weight: 600; }
.legal a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .btn, .text-link svg { transition: none; }
}
