/* ============================================================
   Karoo Code Solutions — styles.css
   Palette: ink #14120f · paper #f4eee3 · brand crimson #c81b35
   Day sky: sunset (#6a5a80 → #c98d72 → #f3cf9e)
   Night sky: #0b1026 → #1b2a4a
   ============================================================ */

:root {
  --ink: #14120f;
  --ink-soft: #4a453d;
  --paper: #f4eee3;
  --paper-deep: #e9e1d2;
  --card: #fdfaf3;
  --red: #c81b35;          /* brand crimson — matches invoices/proposals */
  --red-deep: #9c1128;
  --red-bright: #ff6b7d;   /* crimson lifted for dark backgrounds */
  --charcoal: #211f1c;
  --night-1: #0b1026;
  --night-2: #1b2a4a;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --head: "Quicksand", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;

  /* scroll-driven sky variables (updated by JS) */
  --sky-top: #6a5a80;
  --sky-mid: #c98d72;
  --sky-bottom: #f3cf9e;
  --star-alpha: 0;
  --sun-y: 0px;
  --sun-glow: 1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--head); line-height: 1.15; }

h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }

a { color: inherit; }

code {
  font-family: var(--mono);
  background: rgba(200, 27, 53, 0.1);
  color: var(--red-deep);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  font-size: 0.9em;
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  transition: box-shadow 0.4s ease, color 0.4s ease;
  color: #f7f3ec; /* light over the sunset hero; ink once the bar goes solid */
}

/* Backdrop lives on a pseudo-element: backdrop-filter on .nav itself would
   turn it into the containing block for the fixed mobile menu overlay. */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(244, 238, 227, 0.92);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.4s ease, background 0.4s ease;
}

.nav--solid {
  box-shadow: 0 1px 0 rgba(20, 18, 15, 0.08);
  color: var(--ink);
}
.nav--solid::before { opacity: 1; }

.nav--night { color: #f5f2ec; }
.nav--night::before { background: rgba(11, 16, 38, 0.85); }
.nav--night.nav--solid {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f5f2ec;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.nav__mark { width: 46px; height: 30px; }

.nav__wordstack {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.nav__word {
  font-family: var(--head);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.nav__word b { font-weight: 700; }

.nav__subword {
  font-family: var(--head);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-top: 3px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav__links a { text-decoration: none; opacity: 0.85; transition: opacity 0.2s; }
.nav__links a:hover { opacity: 1; }

.nav__cta {
  background: var(--red);
  color: #fff !important;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  opacity: 1 !important;
  transition: transform 0.15s ease, background 0.2s;
}
.nav__cta:hover { background: var(--red-deep); transform: translateY(-1px); }

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav__burger span {
  width: 24px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* ============ HERO / SKY ============ */
.sky-track { height: 220vh; position: relative; }

.sky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--sky-top), var(--sky-mid) 55%, var(--sky-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
}

.sky__sun {
  position: absolute;
  top: 12vh;
  left: 62vw;
  width: clamp(70px, 9vw, 130px);
  height: clamp(70px, 9vw, 130px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe9c4, #ffb45e 60%, #ef8f3f);
  box-shadow: 0 0 calc(70px * var(--sun-glow)) calc(24px * var(--sun-glow)) rgba(255, 160, 90, 0.42);
  transform: translateY(var(--sun-y));
  will-change: transform;
}

.sky__stars {
  position: absolute;
  inset: 0;
  opacity: var(--star-alpha);
  transition: opacity 0.1s linear;
  pointer-events: none;
}

.star {
  position: absolute;
  color: #fff;
  font-family: var(--mono);
  animation: twinkle 3s ease-in-out infinite;
}

.star--dot {
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
}

.star--glyph { font-size: 11px; opacity: 0.9; color: #ffd9dd; }

@keyframes twinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.sky__mountains {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 34vh;
  pointer-events: none;
}

.sky__mountains--far path { fill: rgba(20, 18, 15, 0.35); }
.sky__mountains--near { height: 26vh; }
.sky__mountains--near path { fill: var(--ink); }

.sky__content {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 0 1.5rem;
  max-width: 900px;
  margin-top: -6vh;
}

.hero__kicker {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red-deep);
  margin-bottom: 1rem;
  transition: color 0.4s;
}

.hero__title {
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 700;
  transition: color 0.4s;
}

.hero__grow {
  display: inline-block;
  animation: grow-in 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

@keyframes grow-in {
  from { transform: scale(0.2) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.hero__accent { color: var(--red-deep); }

.hero__cursor {
  color: var(--red-deep);
  animation: blink 1.1s steps(1) infinite;
  font-weight: 400;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__sub {
  margin: 1.4rem auto 2rem;
  max-width: 560px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: #3b3129;
  transition: color 0.4s;
}

.sky--night .hero__sub { color: #cfd6e8; }
.sky--night .hero__title { color: #f5f2ec; }
.sky--night .hero__kicker { color: #ff8f9a; }
.sky--night .hero__hint { color: #8fa0c4; }
.sky--night .hero__accent,
.sky--night .hero__cursor { color: var(--red-bright); }

.hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-family: var(--head);
  text-decoration: none;
  font-size: 1rem;
  transition: transform 0.15s ease, background 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.btn--primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 20px rgba(156, 17, 40, 0.35);
}
.btn--primary:hover { background: var(--red-deep); transform: translateY(-2px); }

.btn--ghost {
  border: 2px solid currentColor;
  color: var(--ink);
  transition: color 0.4s, border-color 0.4s, transform 0.15s;
}
.btn--ghost:hover { transform: translateY(-2px); }
.sky--night .btn--ghost { color: #f5f2ec; }

.hero__hint {
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #3b3129;
  opacity: 0.8;
  animation: bob 2.4s ease-in-out infinite;
  transition: color 0.4s;
}
@keyframes bob { 50% { transform: translateY(6px); } }

/* ============ CLAIM STRIP ============ */
.claim {
  background: var(--ink);
  color: #f5f2ec;
  padding: clamp(3rem, 8vw, 5rem) 1.5rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

.claim__text {
  max-width: 780px;
  margin: 0 auto;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-family: var(--head);
  font-weight: 500;
  line-height: 1.5;
}

.claim__text em { color: #ffd166; font-style: normal; }
.claim__text strong { color: var(--red-bright); font-weight: 700; }

/* ============ SECTIONS ============ */
.section {
  padding: clamp(4rem, 9vw, 7rem) clamp(1.25rem, 5vw, 4rem);
  position: relative;
  z-index: 2;
  background: var(--paper);
}

.section--tint { background: var(--paper-deep); }

.section--dark {
  background: linear-gradient(to bottom, var(--night-1), var(--night-2));
  color: #f5f2ec;
}

.section__head {
  max-width: 700px;
  margin: 0 auto clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}

.section__kicker {
  font-family: var(--mono);
  color: var(--red-deep);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.section__kicker--light { color: #ff8f9a; }

.section__sub { color: var(--ink-soft); margin-top: 0.9rem; }
.section__sub--light { color: #b9c2d8; }
h2.light { color: #f5f2ec; }

/* ============ SERVICE CARDS ============ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid rgba(20, 18, 15, 0.08);
  border-radius: 18px;
  padding: 1.8rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(20, 18, 15, 0.1);
  border-color: rgba(200, 27, 53, 0.4);
}

.card__icon {
  font-family: var(--mono);
  font-size: 1.5rem;
  color: var(--red);
  background: rgba(200, 27, 53, 0.1);
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
}

.card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card p { color: var(--ink-soft); font-size: 0.95rem; }

/* ============ PRODUCT / OWN APP (MzanziMenu) ============ */
.product {
  --mm: #b04a6a;          /* MzanziMenu protea pink */
  --mm-deep: #863250;
  max-width: 1000px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid rgba(20, 18, 15, 0.08);
  border-radius: 22px;
  padding: clamp(1.6rem, 4vw, 2.8rem);
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  box-shadow: 0 18px 44px rgba(20, 18, 15, 0.06);
}
@media (max-width: 760px) { .product { grid-template-columns: 1fr; } }

.product__brand {
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.product__brand span { color: var(--mm); }
.product__pitch { color: var(--ink-soft); margin-top: 0.7rem; }
.product__points { list-style: none; margin: 1.2rem 0 1.6rem; padding: 0; }
.product__points li { position: relative; padding-left: 1.6rem; margin-bottom: 0.5rem; color: var(--ink-soft); font-size: 0.96rem; }
.product__points li::before { content: "✓"; position: absolute; left: 0; color: var(--mm); font-weight: 700; }
.product__actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
/* MzanziMenu-pink buttons so the product owns its own identity */
.product .btn--primary { background: var(--mm); box-shadow: 0 6px 20px rgba(176, 74, 106, 0.35); }
.product .btn--primary:hover { background: var(--mm-deep); }
.product .btn--ghost { color: var(--mm); }

/* little phone mock */
.product__visual { display: grid; place-items: center; }
.pmock {
  width: min(190px, 62vw);
  background: #16150f;
  border-radius: 26px;
  padding: 8px;
  box-shadow: 0 20px 50px rgba(20, 18, 15, 0.2);
}
.pmock__screen { background: #fff; border-radius: 19px; overflow: hidden; }
.pmock__head { background: var(--mm); color: #fff; padding: 0.7rem 0.85rem; }
.pmock__head b { display: block; font-family: var(--head); font-size: 0.9rem; }
.pmock__head span { font-size: 0.66rem; opacity: 0.9; }
.pmock__row { display: flex; justify-content: space-between; padding: 0.5rem 0.85rem; font-size: 0.72rem; color: var(--ink); border-bottom: 1px solid #f0ece6; }
.pmock__row span:last-child { font-weight: 700; }
.pmock__bill { background: #2f7a4d; color: #fff; text-align: center; font-size: 0.72rem; font-weight: 700; padding: 0.55rem; }

/* ============ PROCESS STEPS ============ */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.4rem;
  max-width: 1100px;
  margin: 0 auto;
  counter-reset: step;
}

.step {
  background: var(--card);
  border-radius: 18px;
  padding: 1.8rem;
  position: relative;
  border: 1px solid rgba(20, 18, 15, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.step:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(20, 18, 15, 0.1); }

.step__glyph { font-size: 2rem; display: block; margin-bottom: 0.8rem; }

.step__num {
  position: absolute;
  top: 1.4rem; right: 1.5rem;
  font-family: var(--mono);
  color: rgba(20, 18, 15, 0.25);
  font-weight: 500;
}

.step h3 { margin-bottom: 0.4rem; }
.step p { color: var(--ink-soft); font-size: 0.95rem; }

/* ============ TERMINAL ============ */
.term {
  max-width: 760px;
  margin: 0 auto;
  background: #0d1117;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.7rem 1rem;
  background: #161b22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.term__dot { width: 12px; height: 12px; border-radius: 50%; }
.term__dot--r { background: #ff5f57; }
.term__dot--y { background: #febc2e; }
.term__dot--g { background: #28c840; }

.term__title { margin-left: 0.8rem; color: #8b949e; font-size: 0.8rem; }

.term__screen {
  padding: 1rem 1.2rem 0.4rem;
  min-height: 220px;
  max-height: 340px;
  overflow-y: auto;
  color: #d5dce4;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.term__screen .t-cmd { color: #7ee787; }
.term__screen .t-accent { color: #ff8f9a; }
.term__screen .t-dim { color: #8b949e; }
.term__screen a { color: #79c0ff; }

.term__inputline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.2rem 1rem;
}

.term__prompt { color: #7ee787; }

.term__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e6edf3;
  font-family: var(--mono);
  font-size: 0.9rem;
  caret-color: #e8404f;
}
.term__input::placeholder { color: #4d5762; }

/* ============ ABOUT ============ */
.about {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  max-width: 1100px;
  margin: 0 auto;
  align-items: center;
}

.about__text h2 { margin: 0.5rem 0 1.2rem; }
.about__text p { color: var(--ink-soft); margin-bottom: 1rem; }

.about__points {
  list-style: none;
  margin-top: 1.5rem;
  display: grid;
  gap: 0.9rem;
}

.about__points li {
  padding-left: 1.6rem;
  position: relative;
  color: var(--ink-soft);
}

.about__points li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--red);
  font-weight: 700;
}

.about__points strong { color: var(--ink); }

.about__panel { min-width: 0; }

.codegrow {
  background: #0d1117;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 24px 60px rgba(20, 18, 15, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}

.codegrow__pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #d5dce4;
  min-height: 13em;
  white-space: pre;
}

.codegrow__pre .k { color: #ff7b72; }
.codegrow__pre .f { color: #d2a8ff; }
.codegrow__pre .s { color: #a5d6ff; }
.codegrow__pre .c { color: #8b949e; }
.codegrow__pre .cur { color: #e8404f; animation: blink 1.1s steps(1) infinite; }

/* ============ CONTACT ============ */
.contact {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: clamp(2rem, 5vw, 3rem);
  max-width: 640px;
  margin: 0 auto;
}

.contact__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  width: 100%;
}

.contact__form label { display: grid; gap: 0.4rem; font-weight: 500; font-size: 0.9rem; }

.contact__full { grid-column: 1 / -1; }

.contact__form input,
.contact__form textarea {
  font-family: var(--body);
  font-size: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1.5px solid rgba(20, 18, 15, 0.15);
  background: var(--card);
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

.contact__form input:focus,
.contact__form textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 27, 53, 0.15);
}

.contact__submit { grid-column: 1 / -1; justify-self: center; }

.contact__status { grid-column: 1 / -1; font-size: 0.9rem; color: var(--red-deep); min-height: 1.4em; }

.contact__aside { text-align: center; }
.contact__aside h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.contact__aside p { color: var(--ink-soft); margin-bottom: 1.4rem; }

.contact__mail { color: var(--red-deep); font-weight: 600; text-decoration: none; }
.contact__mail:hover { text-decoration: underline; }

/* ============ FOOTER ============ */
.footer {
  background: var(--night-1);
  color: #b9c2d8;
  text-align: center;
  position: relative;
  z-index: 2;
}

.footer__scene svg {
  display: block;
  width: 100%;
  height: 80px;
  transform: translateY(1px);
}
.footer__scene path { fill: var(--night-1); }
.footer__scene { background: var(--paper-deep); }

.footer__inner { padding: 2.5rem 1.5rem 3rem; }

.footer__brand {
  font-family: var(--head);
  font-size: 1.3rem;
  color: #f5f2ec;
  font-weight: 500;
}
.footer__brand b { font-weight: 700; }

.footer__tag { color: var(--red-bright); font-family: var(--mono); font-size: 0.85rem; margin: 0.4rem 0 1rem; }

.footer__copy { font-size: 0.8rem; opacity: 0.7; }

/* ============ CORNER ACCENTS (letterhead motif) ============ */
.corner {
  position: absolute;
  width: clamp(140px, 22vw, 270px);
  height: auto;
  pointer-events: none;
  z-index: 1;
}

.corner--contact {
  top: 0;
  left: 0;
}

/* ============ REVEAL ON SCROLL ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.reveal--in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .about, .contact { grid-template-columns: 1fr; }
  .contact__form { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav__links {
    position: fixed;
    inset: 0;
    background: rgba(11, 16, 38, 0.97);
    color: #f5f2ec;
    flex-direction: column;
    justify-content: center;
    font-size: 1.3rem;
    gap: 2rem;
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform 0.35s ease, visibility 0s 0.35s;
  }
  .nav__links.open { transform: none; visibility: visible; transition: transform 0.35s ease; }
  .nav__burger { display: flex; z-index: 60; }
  .nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__burger.open span:nth-child(2) { opacity: 0; }
  .nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .sky-track { height: 190vh; }
}
