/* ──────────────────────────────────────────────────────────────────────
   Koirala Studio — modern (Stripe/Vercel-inspired)
   Inter sans, gradient mesh hero, bento card grid.
   ────────────────────────────────────────────────────────────────────── */

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Surface */
  --bg:          #F8F6F1;
  --bg-elev:    #FFFFFF;
  --fg:          #0E0C09;
  --fg-2:        #2E2A24;
  --fg-muted:    #5A554E;
  --fg-faint:    #8E8A82;
  --rule:        #E8E3D9;
  --rule-soft:   #F1ECE3;

  /* Accents — gradient palette */
  --accent:      #1E40C8;  /* cobalt — primary CTA + structural */
  --accent-hi:   #5478FF;  /* lighter cobalt for glow / hover */
  --magenta:     #B83DCD;
  --magenta-hi:  #DE6CF0;
  --peach:       #FF8C66;
  --terra:       #B5482E;  /* terracotta — kept for accent variety */
  --on-accent:   #FFFFFF;

  /* Card tinted backgrounds (soft, used for bento cards) */
  --card-1-bg:   linear-gradient(135deg, #EEF1FE 0%, #FAEDFA 100%);
  --card-2-bg:   linear-gradient(135deg, #FFEFE5 0%, #FAE9F4 100%);

  /* Type */
  --font-sans:   'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display:'Inter', system-ui, -apple-system, sans-serif;

  /* Layout */
  --wrap-col:  720px;
  --wrap-wide: 1080px;

  /* Rhythm */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 1rem;
  --s-4: 1.5rem;
  --s-5: 2.5rem;
  --s-6: 4rem;
  --s-7: 6rem;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(20, 16, 10, 0.04), 0 2px 4px rgba(20, 16, 10, 0.03);
  --shadow-2: 0 2px 6px rgba(20, 16, 10, 0.05), 0 12px 28px rgba(20, 16, 10, 0.08);
  --shadow-3: 0 4px 12px rgba(20, 16, 10, 0.06), 0 24px 48px rgba(20, 16, 10, 0.12);
}

[data-theme="dark"] {
  --bg:          #0A0A0F;
  --bg-elev:     #14141C;
  --fg:          #F2EFE8;
  --fg-2:        #D5D0C5;
  --fg-muted:    #95918A;
  --fg-faint:    #5B5750;
  --rule:        #25232C;
  --rule-soft:   #1B1A22;

  --accent:      #5478FF;
  --accent-hi:   #82A0FF;
  --magenta:     #D061E8;
  --magenta-hi:  #E690F8;
  --peach:       #FF9F7A;
  --terra:       #E07B5C;
  --on-accent:   #FFFFFF;

  --card-1-bg:   linear-gradient(135deg, rgba(84, 120, 255, 0.10) 0%, rgba(208, 97, 232, 0.10) 100%);
  --card-2-bg:   linear-gradient(135deg, rgba(255, 159, 122, 0.10) 0%, rgba(208, 97, 232, 0.10) 100%);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 4px 12px rgba(0, 0, 0, 0.4), 0 24px 48px rgba(0, 0, 0, 0.5);
}

/* ── Font ───────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Reset / base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 0.18s ease, color 0.18s ease;
}

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

a {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:hover { color: var(--accent); }

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* ── Typography ─────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 var(--s-3);
  color: var(--fg);
}

h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: var(--s-6);
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: var(--s-4);
  margin-bottom: var(--s-2);
}

p { margin: 0 0 var(--s-3); color: var(--fg-2); }
ul, ol { padding-left: 1.4em; margin: 0 0 var(--s-3); }
li { margin-bottom: var(--s-2); color: var(--fg-2); }

strong { font-weight: 700; color: var(--fg); }

.eyebrow, .section-label, .label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.timestamp { font-size: 0.85rem; color: var(--fg-muted); }

/* ── Layout ─────────────────────────────────────────────────────────── */
.wrap {
  max-width: var(--wrap-wide);
  margin: 0 auto;
  padding: 0 var(--s-4);
}

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

main { padding: 0 0 var(--s-7); position: relative; }

@media (max-width: 540px) {
  .wrap, .wrap-col { padding: 0 var(--s-3); }
}

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  padding: var(--s-4) 0;
  position: relative;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
}

.brand {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.brand em {
  font-style: normal;
  color: var(--fg-muted);
  font-weight: 500;
}
.brand:hover { color: var(--accent); }

.theme-toggle {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: var(--s-2) var(--s-3);
  border-radius: 999px;
  border: 1px solid var(--rule);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--fg);
  background: var(--bg-elev);
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: var(--s-5) 0;
  margin-top: var(--s-7);
  font-size: 0.85rem;
  color: var(--fg-muted);
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.site-footer nav { display: flex; gap: var(--s-4); flex-wrap: wrap; }
.site-footer a { color: var(--fg-muted); }
.site-footer a:hover { color: var(--accent); }


/* ── Plain hero (privacy / terms / support / 404) ───────────────────── */
.hero { padding: var(--s-5) 0 var(--s-3); }
.hero h1 { margin-bottom: var(--s-2); }

/* ── Hero with animated gradient mesh (landing only) ────────────────── */
.hero-mesh {
  position: relative;
  padding: var(--s-7) 0 var(--s-6);
  overflow: hidden;
  isolation: isolate;
}

.hero-mesh::before,
.hero-mesh::after,
.hero-mesh > .hero-orb {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.6;
  pointer-events: none;
}

/* Blob 1 — cobalt, top-left */
.hero-mesh::before {
  width: 600px; height: 600px;
  top: -150px; left: -100px;
  background: var(--accent);
  animation: blob-drift-1 18s ease-in-out infinite alternate;
}

/* Blob 2 — magenta, top-right */
.hero-mesh::after {
  width: 520px; height: 520px;
  top: -100px; right: -120px;
  background: var(--magenta);
  animation: blob-drift-2 22s ease-in-out infinite alternate;
}

/* Blob 3 — peach, mid-right (rendered via inserted span) */
.hero-orb {
  width: 460px; height: 460px;
  top: 180px; right: 20%;
  background: var(--peach);
  opacity: 0.45;
  animation: blob-drift-3 26s ease-in-out infinite alternate;
}

@keyframes blob-drift-1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 60px) scale(1.1); }
}
@keyframes blob-drift-2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-60px, 80px) scale(1.05); }
}
@keyframes blob-drift-3 {
  0%   { transform: translate(0, 0) scale(0.9); }
  100% { transform: translate(-100px, -40px) scale(1.1); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-4);
  display: inline-block;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 var(--s-4);
  color: var(--fg);
  max-width: 18ch;
}

.hero-lead {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 40em;
  margin: 0 0 var(--s-5);
}
.hero-lead strong {
  color: var(--fg);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30, 64, 200, 0.35);
}
.btn-ghost {
  background: var(--bg-elev);
  color: var(--fg);
  border-color: var(--rule);
  box-shadow: var(--shadow-1);
}
.btn-ghost:hover {
  border-color: var(--fg-muted);
  color: var(--fg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}

/* ── Section heading row ────────────────────────────────────────────── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--s-4);
}
.section-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
}
.section-head .meta {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* ── Bento grid (apps) ──────────────────────────────────────────────── */
.bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-4);
}
@media (max-width: 760px) {
  .bento { grid-template-columns: 1fr; }
}

app-card { display: contents; }

.app-card {
  display: flex;
  flex-direction: column;
  padding: var(--s-5);
  border-radius: 28px;
  background: var(--bg-elev);
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: var(--fg);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
  min-height: 320px;
}

/* Each card gets its own soft gradient backdrop. */
app-card:nth-of-type(1) .app-card { background: var(--card-1-bg); }
app-card:nth-of-type(2) .app-card { background: var(--card-2-bg); }
app-card:nth-of-type(3) .app-card { background: var(--card-1-bg); }
app-card:nth-of-type(4) .app-card { background: var(--card-2-bg); }

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
  color: var(--fg);
}

.app-card .app-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  margin-bottom: var(--s-4);
  background: var(--bg-elev);
  box-shadow: var(--shadow-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.app-icon-fallback {
  background: var(--accent);
  color: var(--on-accent);
}

.app-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  flex: 1;
}

.app-card-row1 {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

.app-num {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fg-faint);
  text-transform: uppercase;
}

.app-name {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  line-height: 1.15;
  flex-basis: 100%;
  margin-top: var(--s-1);
}

.app-desc {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.app-pricing {
  margin-top: auto;
  padding-top: var(--s-3);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-2);
  letter-spacing: -0.005em;
}

.app-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3em 0.7em;
  border-radius: 999px;
  margin-left: auto;
}
.app-status.status-live {
  background: rgba(30, 64, 200, 0.10);
  color: var(--accent);
}
.app-status.status-live::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.app-status.status-soon { color: var(--fg-faint); background: rgba(0,0,0,0.05); }
.app-status.status-dev  { color: var(--fg-faint); background: rgba(0,0,0,0.05); }

.app-arrow {
  position: absolute;
  top: var(--s-5);
  right: var(--s-5);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-elev);
  box-shadow: var(--shadow-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--fg-2);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.app-card:hover .app-arrow {
  background: var(--fg);
  color: var(--bg);
  transform: translate(2px, -2px);
}

.coda {
  color: var(--fg-faint);
  font-size: 0.9rem;
  margin-top: var(--s-5);
  text-align: center;
}

@media (max-width: 540px) {
  .app-card { padding: var(--s-4); min-height: 260px; border-radius: 22px; }
  .app-card .app-icon { width: 72px; height: 72px; border-radius: 18px; }
  .app-name { font-size: 1.3rem; }
}

/* ── App detail page ────────────────────────────────────────────────── */
.app-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-3);
  padding-top: var(--s-5);
  margin-bottom: var(--s-6);
  position: relative;
}

.app-hero .app-icon {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  background: var(--bg-elev);
  box-shadow: var(--shadow-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--s-2);
}
.app-hero .app-icon-fallback { background: var(--accent); color: var(--on-accent); }

.app-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--fg);
}

.app-hero .lead {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--fg-muted);
  max-width: 36em;
  line-height: 1.5;
  margin-bottom: var(--s-3);
}

.app-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: var(--s-2);
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--fg);
  color: var(--bg);
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.app-cta:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30, 64, 200, 0.35);
}

/* ── Back link ──────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: var(--s-4) 0 var(--s-3);
}
.back-link:hover { color: var(--accent); }

/* ── Pricing block ──────────────────────────────────────────────────── */
.pricing { margin: var(--s-6) 0; }
.pricing-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-3);
}

.pricing-tier {
  padding: var(--s-4);
  border-radius: 20px;
  background: var(--bg-elev);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.pricing-tier:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.tier-name {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
}
.tier-price {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.tier-desc {
  font-size: 0.88rem;
  color: var(--fg-muted);
  margin: 0;
}

.pricing-tier.featured {
  background: linear-gradient(135deg, rgba(30, 64, 200, 0.08), rgba(184, 61, 205, 0.08));
  box-shadow: var(--shadow-2);
  border: 1px solid rgba(30, 64, 200, 0.2);
}
.pricing-tier.featured .tier-price { color: var(--accent); }
.pricing-tier.featured::after {
  content: 'Best value';
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.2em 0.6em;
  background: rgba(30, 64, 200, 0.12);
  border-radius: 999px;
}

/* ── Support: contact block & FAQ ───────────────────────────────────── */
.contact-block {
  padding: var(--s-5);
  background: var(--bg-elev);
  border-radius: 24px;
  box-shadow: var(--shadow-1);
  margin: var(--s-4) 0 var(--s-5);
}
.contact-block .label { margin-bottom: var(--s-2); }
.contact-block .email {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--accent);
}
.contact-block .email:hover { color: var(--magenta); }

.faq-item {
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--rule);
}
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { margin: 0 0 var(--s-2); font-size: 1.05rem; }
.faq-item p { margin: 0; }

/* ── Prose pages (privacy / terms) ──────────────────────────────────── */
.prose { max-width: var(--wrap-col); margin: 0 auto; padding: 0 var(--s-4); }
.prose h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-top: var(--s-4);
  margin-bottom: var(--s-3);
}
.prose .timestamp { margin-bottom: var(--s-5); display: block; }
.prose h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: var(--s-6);
  letter-spacing: -0.018em;
}
.prose p { color: var(--fg-2); font-size: 1rem; line-height: 1.65; }
.prose ul { padding-left: 1.2em; }
.prose ul li { color: var(--fg-2); margin-bottom: var(--s-1); }
.prose a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.prose a:hover { border-bottom-color: var(--accent); }

/* ── 404 ────────────────────────────────────────────────────────────── */
.not-found { text-align: left; padding-top: var(--s-6); }
.not-found h1 {
  font-size: clamp(4rem, 14vw, 9rem);
  background: linear-gradient(135deg, var(--accent), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -0.04em;
}

/* ── Selection ──────────────────────────────────────────────────────── */
::selection { background: var(--accent); color: var(--on-accent); }

/* ── Reduced motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero::after,
  .hero-orb { animation: none; }
}
