/* ==========================================================================
   Creating Space Private Limited — Design System v2
   Quiet, confident, content-first. Brand colors used sparingly and with intent.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #FFFFFF;
  --surface: #F5F5F7;
  --surface-2: #FFFFFF;
  --ink: #1D1D1F;
  --muted: #6E6E73;
  --faint: #86868B;
  --line: #E5E5E5;

  --brand-red: #E31E27;
  --brand-navy: #263674;

  --primary: #1D1D1F;
  --primary-hover: #333336;
  --secondary: #86868B;

  --success-bg: #E4F5E8;
  --success-text: #1E7B34;
  --draft-bg: #FFF2DE;
  --draft-text: #B4690E;
  --danger: #D33A3A;
  --danger-hover: #B62E2E;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.12);
  --radius: 20px;
  --radius-sm: 12px;

  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --ease: cubic-bezier(.4, 0, .2, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #000000;
  --surface: #1C1C1E;
  --surface-2: #131313;
  --ink: #F5F5F7;
  --muted: #98989D;
  --faint: #6E6E73;
  --line: #2C2C2E;

  --primary: #F5F5F7;
  --primary-hover: #D1D1D6;
  --secondary: #98989D;

  --success-bg: #16321F;
  --success-text: #6FD98C;
  --draft-bg: #362510;
  --draft-text: #F0A94E;
  --danger: #FF453A;
  --danger-hover: #FF6961;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 4px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.6);

  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Lenis handles smooth scrolling, removed html scroll-behavior */

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 .35em;
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 600; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; color: var(--ink); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

section { padding: 100px 0; }
@media (max-width: 700px) { section { padding: 64px 0; } }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1.is-visible { transition-delay: .08s; }
.reveal-delay-2.is-visible { transition-delay: .16s; }
.reveal-delay-3.is-visible { transition-delay: .24s; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: .98rem;
  color: var(--ink);
  letter-spacing: -.01em;
}
.brand img { height: 26px; width: auto; }
.brand .tagline { display: none; }
.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a {
  padding: 8px 14px;
  border-radius: 980px;
  font-size: .87rem;
  font-weight: 500;
  color: var(--muted);
  transition: color .15s var(--ease), background .15s var(--ease);
}
.main-nav a:hover { color: var(--ink); }
.main-nav a.active { color: var(--ink); background: var(--surface); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  margin-left: 8px;
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.theme-toggle:hover { background: var(--line); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: 999px;
  border: none;
  background: var(--surface);
  align-items: center; justify-content: center;
  cursor: pointer;
  margin-left: 6px;
}

@media (max-width: 780px) {
  .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 20px; gap: 2px; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; border-radius: 10px; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 140px 0 100px;
  text-align: center;
  background: var(--bg);
}
.hero .eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--secondary);
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 { max-width: 880px; margin-left: auto; margin-right: auto; color: var(--ink); }
.hero p.lead {
  max-width: 560px; margin: 22px auto 36px;
  font-size: 1.2rem; color: var(--muted);
}
.hero .hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .hero-visual {
  margin-top: 72px;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(circle at 0% 0%, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--line);
  position: relative;
  box-shadow: var(--shadow-lg);
}
.hero .hero-visual img { width: 100%; height: auto; display: block; }
.hero .hero-visual .placeholder-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .85rem; letter-spacing: .05em; font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 980px;
  background: var(--primary);
  color: var(--bg);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s var(--ease), filter .15s var(--ease);
}
.btn:hover { filter: brightness(0.9); transform: scale(1.02); }
.btn:active { transform: scale(.97); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--surface); filter: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }

/* ---------- Section headers ---------- */
.section-title { margin-bottom: 44px; text-align: center; }
.section-title.align-left { text-align: left; }
.section-title p { color: var(--muted); font-size: 1.06rem; max-width: 480px; margin: 10px auto 0; }
.section-title.align-left p { margin-left: 0; }

/* ---------- Bento Grid ---------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(280px, auto);
  gap: 24px;
}
@media (max-width: 900px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .bento-grid { grid-template-columns: 1fr; }
}

.bento-item {
  padding: 40px;
  background: var(--surface);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}

.bento-item-large {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-item-wide {
  grid-column: span 2;
}

.bento-item .icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  margin-bottom: auto; color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.bento-item h3 { margin-top: 24px; margin-bottom: 8px; font-size: 1.4rem; }
.bento-item p { color: var(--muted); font-size: 1rem; margin: 0; line-height: 1.5; }

/* ---------- Grid / Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}
.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .thumb { aspect-ratio: 4/3; background: var(--surface); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .thumb img { transform: scale(1.05); }
.card .body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card .body h3 { margin-bottom: 6px; font-size: 1.05rem; }
.card .desc { color: var(--muted); font-size: .9rem; flex: 1; }
.cat-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--secondary);
  background: var(--surface);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  width: fit-content;
}

/* ---------- Catalog filters ---------- */
.catalog-toolbar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line);
}
.catalog-toolbar input[type="search"] {
  flex: 1; min-width: 200px; padding: 12px 16px; border-radius: 980px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .92rem;
}
.catalog-toolbar input[type="search"]:focus { outline: none; border-color: var(--primary); }
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; border-radius: 980px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); font-size: .85rem; font-weight: 500;
  cursor: pointer; transition: all .15s var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 40px 0 0; }
.pagination button {
  min-width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  cursor: pointer; font-size: .88rem;
}
.pagination button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pagination button:disabled { opacity: .35; cursor: not-allowed; }

.loading, .empty-state { text-align: center; padding: 70px 20px; color: var(--faint); grid-column: 1 / -1; }

/* ---------- Product / Project detail ---------- */
.detail-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; padding: 56px 0 100px; }
@media (max-width: 860px) { .detail-hero { grid-template-columns: 1fr; } }
.detail-gallery .main { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); background: var(--surface); }
.detail-gallery .thumbs { display: flex; gap: 10px; margin-top: 14px; overflow-x: auto; }
.detail-gallery .thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 2px solid transparent; opacity: .6; transition: all .15s var(--ease); }
.detail-gallery .thumbs img.active, .detail-gallery .thumbs img:hover { border-color: var(--primary); opacity: 1; }
.detail-info .meta { color: var(--muted); margin-bottom: 18px; font-size: 1.05rem; }
.spec-table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.spec-table td { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.spec-table td:first-child { color: var(--muted); width: 40%; font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Blog post ---------- */
.post-content { max-width: 720px; margin: 0 auto; padding: 64px 0 100px; }
.post-content img { border-radius: var(--radius); margin: 28px 0; }
.post-meta { color: var(--muted); font-size: .9rem; margin-bottom: 28px; }
.post-content h2 { margin-top: 1.4em; }

/* ---------- About page ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
@media (max-width: 780px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid img { border-radius: var(--radius); box-shadow: var(--shadow-md); }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 72px 48px;
  text-align: center;
  margin: 0 24px;
}
html[data-theme="dark"] .cta-banner { background: var(--surface); }
.cta-banner h2 { color: inherit; }
.cta-banner p { color: rgba(255,255,255,.7); max-width: 480px; margin: 0 auto 28px; }
html[data-theme="dark"] .cta-banner p { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { padding: 64px 0 32px; border-top: 1px solid var(--line); }
.site-footer .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
@media (max-width: 700px) { .site-footer .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.site-footer .brand { margin-bottom: 12px; }
.site-footer p { color: var(--muted); font-size: .88rem; max-width: 320px; }
.site-footer h4 { color: var(--faint); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; font-family: var(--font-body); font-weight: 600; }
.site-footer a { display: block; padding: 5px 0; color: var(--muted); font-size: .9rem; transition: color .15s var(--ease); }
.site-footer a:hover { color: var(--ink); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 24px; font-size: .8rem; color: var(--faint); text-align: center; }

/* ---------- Forms (public + admin shared) ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-family: var(--font-body); font-size: .93rem;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- Admin ---------- */
.admin-body { background: var(--surface); }
.admin-header {
  background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 60px;
}
html[data-theme="dark"] .admin-header { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.admin-header .logo { font-weight: 600; color: inherit; display: flex; align-items: center; gap: 10px; }
.admin-header .logo img { height: 24px; }
.admin-header .header-actions { display: flex; align-items: center; gap: 10px; }
.admin-layout { display: flex; min-height: calc(100vh - 60px); }
.admin-sidebar { width: 200px; background: var(--bg); border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar a { padding: 10px 14px; border-radius: 10px; font-size: .89rem; font-weight: 500; color: var(--muted); }
.admin-sidebar a:hover { background: var(--surface); color: var(--ink); }
.admin-sidebar a.active { background: var(--surface); color: var(--primary); }
.admin-main { flex: 1; padding: 32px; max-width: 900px; }

.login-box { max-width: 380px; margin: 100px auto; padding: 40px 32px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.login-box h1 { font-size: 1.4rem; margin-bottom: 20px; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.admin-table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 12px; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
.admin-actions { display: flex; gap: 8px; justify-content: flex-end; }
.admin-actions .btn { padding: 7px 14px; font-size: .82rem; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; text-transform: capitalize; }
.badge.published { background: var(--success-bg); color: var(--success-text); }
.badge.draft { background: var(--draft-bg); color: var(--draft-text); }

.thumb-upload { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb-upload .item { position: relative; width: 80px; height: 80px; }
.thumb-upload .item img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.thumb-upload .item .remove { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff; border: 2px solid var(--bg); cursor: pointer; font-size: .8rem; line-height: 1; display: flex; align-items: center; justify-content: center; }

.toast { position: fixed; bottom: 24px; right: 24px; z-index: 999; background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 10px; font-size: .88rem; box-shadow: var(--shadow-lg); animation: toast-in .2s var(--ease); }
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
