/*
Theme Name: Cypher
Theme URI: https://github.com/its-RajS/cypher
Author: Cypher
Description: Marketing site theme for Cypher, a developer-first video hosting platform. Colors, copy and section order follow the landing page in the Cypher repository (apps/landing-page).
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: cypher
*/

:root {
  --brand-primary: #276a8f;
  --brand-secondary: #b7bdf7;
  --brand-tertiary: #ff7444;
  --brand-highlight: #fff8be;
  --brand-neutral: #bfc6c4;
  --brand-primary-readable: #276a8f;
  --background: #f6faf9;
  --foreground: #17303a;
  --card: #fbfdfc;
  --muted: #e8efed;
  --muted-foreground: #465c63;
  --border: #c8d5d2;
  --secondary: #e8efed;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --brand-primary-readable: #71b9db;
  --background: #081a22;
  --foreground: #f1f7f5;
  --card: #102832;
  --muted: #173640;
  --muted-foreground: #bfd0cd;
  --border: #31505b;
  --secondary: #123039;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-primary-readable: #71b9db;
    --background: #081a22;
    --foreground: #f1f7f5;
    --card: #102832;
    --muted: #173640;
    --muted-foreground: #bfd0cd;
    --border: #31505b;
    --secondary: #123039;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand-primary-readable); }
a:hover { color: var(--brand-tertiary); }
:focus-visible { outline: 2px solid var(--brand-primary-readable); outline-offset: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: var(--card); padding: 8px 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--brand-primary) 25%, transparent);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--foreground); text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--brand-primary), var(--brand-tertiary)); display: inline-block; }
.main-nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.main-nav a { color: var(--foreground); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.main-nav a:hover { color: var(--brand-primary-readable); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--muted-foreground); cursor: pointer; font-size: 1rem;
}
.theme-toggle:hover { background: var(--secondary); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; color: var(--foreground); cursor: pointer; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 0 24px; border-radius: 10px; font-weight: 600; font-size: 0.9rem;
  text-decoration: none; border: 0; cursor: pointer;
  transition: transform .2s, filter .2s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { color: #fff; }
.btn-accent { background: var(--brand-tertiary); color: #2e1108; }
.btn-accent:hover { color: #2e1108; }
.btn-pill { border-radius: 999px; min-height: 36px; padding: 0 20px; }
.link-ghost { font-weight: 600; font-size: 0.9rem; color: var(--muted-foreground); text-decoration: none; }
.link-ghost:hover { color: var(--foreground); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 110px 0 100px; }
.hero-bar { position: absolute; left: 0; right: 0; top: 0; height: 4px; display: grid; grid-template-columns: repeat(5, 1fr); }
.hero-bar span:nth-child(1) { background: var(--brand-primary); }
.hero-bar span:nth-child(2) { background: var(--brand-secondary); }
.hero-bar span:nth-child(3) { background: var(--brand-highlight); }
.hero-bar span:nth-child(4) { background: var(--brand-tertiary); }
.hero-bar span:nth-child(5) { background: var(--brand-neutral); }
.hero::after {
  content: ""; position: absolute; inset: 0 0 0 40%; pointer-events: none; opacity: .5;
  background:
    radial-gradient(60% 50% at 70% 30%, color-mix(in srgb, var(--brand-secondary) 55%, transparent), transparent 70%),
    radial-gradient(50% 45% at 85% 75%, color-mix(in srgb, var(--brand-tertiary) 35%, transparent), transparent 70%);
}
.hero .wrap { position: relative; z-index: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 10px; font-size: .75rem;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px;
  background: color-mix(in srgb, var(--background) 80%, transparent);
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-tertiary); }
.badge .mono { font-family: var(--mono); font-weight: 600; }
.badge .muted { color: var(--muted-foreground); }
.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5.2rem); font-weight: 300; line-height: .98;
  letter-spacing: -0.04em; margin: 28px 0 0; max-width: 14ch; text-wrap: balance;
}
.hero h1 strong { display: block; font-weight: 600; margin-top: 6px; }
.hero h1 u { text-decoration-color: var(--brand-tertiary); text-decoration-thickness: .08em; text-underline-offset: .12em; }
.hero-lede { max-width: 38rem; margin: 28px 0 0; font-size: 1.1rem; line-height: 1.75; color: var(--muted-foreground); }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 0; margin: 28px 0 0; font-size: .9rem; font-weight: 500; }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-tertiary); }
.hero-points li:nth-child(2)::before { background: var(--brand-primary-readable); }
.hero-points li:nth-child(3)::before { background: var(--brand-secondary); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 36px; }

/* Code sample */
.code-card {
  margin-top: 48px; max-width: 640px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}
.code-card header { padding: 8px 14px; font-family: var(--mono); font-size: .75rem; color: var(--muted-foreground); border-bottom: 1px solid var(--border); }
.code-card pre { margin: 0; padding: 16px; overflow-x: auto; font-family: var(--mono); font-size: .82rem; line-height: 1.7; }

/* Story */
.story { background: color-mix(in srgb, var(--brand-neutral) 25%, transparent); border-top: 1px solid var(--brand-neutral); border-bottom: 1px solid var(--brand-neutral); padding: 56px 0; }
.pill { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: .85rem; font-weight: 600; background: var(--brand-secondary); color: #252b55; margin-bottom: 16px; }
.story h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin: 0 0 24px; }
.story p, .story li { color: var(--muted-foreground); font-size: 15px; }
.story strong { color: var(--foreground); font-weight: 600; }
.story ul { list-style: none; padding: 0; margin: 12px 0; }
.story li { display: flex; gap: 10px; align-items: baseline; margin: 8px 0; }
.story li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-primary); transform: translateY(-2px); }

/* Sections */
.section { padding: 80px 0; }
.section-head { text-align: center; max-width: 42rem; margin: 0 auto 56px; }
.eyebrow { font-size: .85rem; font-weight: 600; color: var(--brand-primary-readable); margin-bottom: 12px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
.section-head p { margin: 0; color: var(--muted-foreground); }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  position: relative; overflow: hidden; background: var(--card);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 30%, transparent);
  border-radius: var(--radius); padding: 24px; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--brand-primary); box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c, var(--brand-primary)); }
.card .icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; background: var(--c, var(--brand-primary)); color: var(--ink, #fff); font-weight: 700; font-size: .95rem; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; font-weight: 600; }
.card p { margin: 0; color: var(--muted-foreground); }
.card a.stretched { color: inherit; text-decoration: none; }
.card a.stretched::after { content: ""; position: absolute; inset: 0; }

/* How it works */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.steps li::before { content: counter(step); display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-tertiary); color: #2e1108; font-weight: 700; margin-bottom: 12px; }
.steps h3 { margin: 0 0 6px; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted-foreground); }

/* Pricing */
.pricing { background: color-mix(in srgb, var(--secondary) 70%, transparent); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.plan { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--brand-primary); border-radius: var(--radius); padding: 24px; }
.plan.hl { border: 2px solid var(--brand-tertiary); }
.plan .tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand-tertiary); color: #3d170c; font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.plan .name { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); font-weight: 500; }
.plan .price { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 2px; }
.plan .price small { font-size: .85rem; font-weight: 400; color: var(--muted-foreground); }
.plan .desc { margin: 0 0 20px; color: var(--muted-foreground); font-size: .9rem; }
.plan ul { list-style: none; margin: 0 0 24px; padding: 0; flex: 1; }
.plan li { display: flex; gap: 8px; font-size: .9rem; color: var(--muted-foreground); margin: 10px 0; }
.plan li::before { content: "✓"; color: var(--brand-primary-readable); font-weight: 700; flex: none; }
.plan .btn { width: 100%; }
.pricing-note { text-align: center; margin-top: 32px; font-size: .85rem; color: var(--muted-foreground); }

/* CTA */
.cta { position: relative; overflow: hidden; text-align: center; padding: 110px 0; background: var(--brand-highlight); color: #332c0f; border-top: 1px solid var(--brand-tertiary); border-bottom: 1px solid var(--brand-tertiary); }
.cta::before, .cta::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.cta::before { width: 260px; height: 260px; left: -80px; top: -96px; background: var(--brand-secondary); opacity: .65; }
.cta::after { width: 290px; height: 290px; right: -80px; bottom: -130px; background: var(--brand-tertiary); opacity: .65; }
.cta .wrap { position: relative; z-index: 1; }
.cta h2 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; letter-spacing: -0.02em; margin: 0 auto 20px; max-width: 18ch; }
.cta p { max-width: 40rem; margin: 0 auto 36px; font-size: 1.1rem; color: #5d5120; }
.cta .link-ghost { color: #332c0f; }
.cta .actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; align-items: center; }

/* Footer */
.site-footer { border-top: 1px solid color-mix(in srgb, var(--brand-primary) 35%, transparent); background: color-mix(in srgb, var(--secondary) 55%, transparent); padding: 40px 0 24px; font-size: .8rem; color: var(--muted-foreground); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-top p { margin: 8px 0 0; font-size: .75rem; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 24px; margin: 0; padding: 0; }
.footer-links a { color: var(--muted-foreground); text-decoration: none; }
.footer-links a:hover { color: var(--brand-primary-readable); }
.footer-bottom { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--brand-primary); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .72rem; opacity: .85; }

/* Content pages */
.page-hero { padding: 64px 0 24px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--secondary) 45%, transparent); }
.page-hero h1 { margin: 0 0 12px; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.page-hero .lede { margin: 0 0 24px; color: var(--muted-foreground); font-size: 1.1rem; max-width: 42rem; }
.breadcrumbs { font-size: .8rem; color: var(--muted-foreground); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted-foreground); }
.entry { padding: 48px 0 80px; }
.entry h2 { margin-top: 2.2em; font-size: 1.5rem; letter-spacing: -0.01em; }
.entry .wrap-narrow > :first-child { margin-top: 0; }
.entry h3 { margin-top: 1.8em; font-size: 1.2rem; }
.entry p, .entry li { color: var(--muted-foreground); }
.entry strong { color: var(--foreground); }
.entry code { font-family: var(--mono); background: var(--muted); padding: 2px 6px; border-radius: 5px; font-size: .88em; }
.entry pre { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; overflow-x: auto; }
.entry table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .92rem; }
.entry th, .entry td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.entry th { color: var(--foreground); }
.draft-note { border-left: 4px solid var(--brand-tertiary); background: color-mix(in srgb, var(--brand-highlight) 55%, transparent); color: #332c0f; padding: 12px 16px; border-radius: 6px; font-size: .9rem; }
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.post-list article { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.post-list h2 { margin: 0 0 6px; font-size: 1.2rem; }
.post-list h2 a { text-decoration: none; color: var(--foreground); }
.post-list p { margin: 0; color: var(--muted-foreground); }

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 960px) {
  .grid-3, .steps { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--card); border-bottom: 1px solid var(--border); padding: 12px 24px 18px; box-shadow: 0 12px 24px rgba(0,0,0,.12); }
  .site-header .wrap { padding: 0 16px; gap: 10px; }
  .brand { font-size: 1.1rem; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 14px; }
  .grid-3, .grid-4, .steps { grid-template-columns: 1fr; }
  .hero { padding: 72px 0 64px; }
  .header-actions .link-ghost { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card { transition: none; }
}
