/* ==========================================================================
   InstaFontStudio — "Cyber-Vibe" design system (ported from styles.css)
   ========================================================================== */

:root {
  --radius: 0.9rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);

  --background: #0f172a;
  --foreground: #e2e8f0;
  --heading: #ffffff;
  --surface: #1e293b;
  --surface-2: #29374d;
  --card: #1e293b;
  --card-foreground: #e2e8f0;
  --popover: #1b2537;
  --primary: #8b5cf6;
  --primary-foreground: #ffffff;
  --neon: #8b5cf6;
  --cyan: #00f0ff;
  --cyan-foreground: #0f172a;
  --secondary: #29374d;
  --secondary-foreground: #e2e8f0;
  --muted: #2b3b52;
  --muted-foreground: #b6c2d4;
  --accent: #3a3560;
  --accent-foreground: #ffffff;
  --danger: #ff3366;
  --destructive: #ff3366;
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.14);
  --ring: #8b5cf6;

  --gradient-neon: linear-gradient(120deg, var(--neon), var(--cyan));
  --gradient-veil: radial-gradient(120% 90% at 50% -10%, rgba(139, 92, 246, 0.28), transparent 60%);
  --shadow-neon: 0 0 0 1px rgba(139, 92, 246, 0.35), 0 18px 50px -18px rgba(139, 92, 246, 0.7);
  --shadow-cyan: 0 0 0 1px rgba(0, 240, 255, 0.35), 0 18px 50px -18px rgba(0, 240, 255, 0.7);
  --shadow-elevated: 0 22px 60px -30px rgba(0, 0, 0, 0.9);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
@keyframes float-slow {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -18px, 0) scale(1.03); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

* { box-sizing: border-box; border-color: var(--border); }
html { scroll-behavior: smooth; }
body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--heading);
  letter-spacing: -0.02em;
  margin: 0;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; color: inherit; }
::selection { background: rgba(0, 240, 255, 0.4); color: var(--heading); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---- utility classes (Tailwind-equivalent primitives used in templates) ---- */
.glass {
  background: rgba(30, 41, 59, 0.62);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--border);
}
.neon-text {
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.neon-ring { transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease; }
.neon-ring:hover { box-shadow: var(--shadow-neon); }
.hide-scrollbar { scrollbar-width: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
.wrap-narrow { max-width: 48rem; margin: 0 auto; padding: 0 1rem; }
.section { padding: 3rem 0; }
.section-sm { padding: 1.5rem 0; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  border-radius: .9rem; padding: .75rem 1.25rem;
  font-size: .875rem; font-weight: 600; border: none; cursor: pointer;
}
.btn-primary { background-image: var(--gradient-neon); color: var(--primary-foreground); }
.btn-secondary { background: rgba(41, 55, 77, .6); color: var(--foreground); border: 1px solid var(--border); }
.btn-block { width: 100%; justify-content: center; }

.eyebrow {
  display: inline-flex; align-items: center; border-radius: 999px;
  border: 1px solid rgba(139,92,246,.3); background: rgba(139,92,246,.1);
  padding: .25rem .75rem; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .16em; color: var(--cyan);
}

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-2xl); }
.card-pad { padding: 1.25rem; }
.muted { color: var(--muted-foreground); }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---- header ---- */
.site-header { position: sticky; top: 0; z-index: 50; width: 100%; }
.site-header-inner {
  max-width: 1280px; margin: 0 auto; padding: .75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; height: 2.25rem; width: 2.25rem; flex-shrink: 0;
  border-radius: .75rem; background-image: var(--gradient-neon); color: #fff;
}
.brand-name { font-weight: 700; font-size: 1rem; color: var(--heading); white-space: nowrap; }

.main-nav { display: none; align-items: center; gap: .25rem; }
.main-nav a {
  border-radius: .5rem; padding: .5rem .75rem; font-size: .875rem; font-weight: 500;
  color: var(--muted-foreground); transition: color .3s;
}
.main-nav a:hover, .main-nav a.is-active { color: var(--foreground); background: rgba(41,55,77,.7); }

.search-wrap { position: relative; display: none; }
.search-wrap input {
  width: 14rem; border-radius: .75rem; border: 1px solid var(--border);
  background: rgba(15,23,42,.6); padding: .6rem .75rem .6rem 2.25rem; font-size: .875rem;
}
.search-wrap input::placeholder { color: var(--muted-foreground); }
.search-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); opacity: .6; pointer-events: none; }
.search-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 50; margin-top: .5rem;
  border-radius: .75rem; overflow: hidden; padding: .25rem; display: none;
}
.search-results.is-open { display: block; }
.search-results a { display: block; border-radius: .5rem; padding: .5rem .75rem; font-size: .875rem; color: var(--muted-foreground); }
.search-results a:hover { background: rgba(41,55,77,.7); color: var(--foreground); }

.menu-toggle {
  display: grid; place-items: center; height: 2.75rem; width: 2.75rem;
  border-radius: .75rem; border: 1px solid var(--border); background: rgba(41,55,77,.6);
}
.mobile-panel { display: none; border-top: 1px solid var(--border); padding: 1rem; animation: rise .35s ease both; }
.mobile-panel.is-open { display: block; }
.mobile-panel nav { display: grid; gap: .25rem; margin-top: 1rem; }
.mobile-panel nav a { border-radius: .5rem; padding: .75rem; font-size: .875rem; font-weight: 500; color: var(--muted-foreground); }
.mobile-panel nav a.is-active { background: rgba(41,55,77,.7); color: var(--foreground); }

@media (min-width: 1024px) {
  .main-nav { display: flex; }
  .search-wrap { display: block; }
  .menu-toggle { display: none; }
  .mobile-panel { display: none !important; }
}

/* ---- hero / page hero ---- */
.hero { padding: 3rem 0 2rem; }
.hero h1 { font-size: 2.25rem; line-height: 1.1; font-weight: 700; }
@media (min-width: 640px) { .hero h1 { font-size: 3rem; } }
@media (min-width: 1024px) { .hero h1 { font-size: 3.5rem; } }
.page-hero { padding: 2.5rem 0 1.5rem; }
.page-hero h1 { font-size: 1.875rem; line-height: 1.2; font-weight: 700; }
@media (min-width: 640px) { .page-hero h1 { font-size: 2.25rem; } }
@media (min-width: 1024px) { .page-hero h1 { font-size: 2.75rem; } }

/* ---- footer ---- */
.site-footer { margin-top: 6rem; border-top: 1px solid var(--border); background: rgba(30,41,59,.4); }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 3.5rem 1rem; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.4fr repeat(4, 1fr); } }
.footer-col h3 { font-size: .875rem; font-weight: 600; color: var(--heading); }
.footer-col ul { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .5rem; }
.footer-col a { font-size: .875rem; color: var(--muted-foreground); transition: color .3s; }
.footer-col a:hover { color: var(--foreground); }
.footer-bottom {
  margin-top: 3rem; border-top: 1px solid var(--border); padding-top: 1.5rem;
  display: flex; flex-direction: column; gap: .75rem; font-size: .75rem; color: var(--muted-foreground);
}
@media (min-width: 640px) { .footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; } }
.footer-bottom .langs { display: flex; flex-wrap: wrap; gap: .75rem; }
.footer-bottom a:hover { color: var(--foreground); }

/* ---- ad slot ---- */
.ad-slot {
  margin: 0 auto; display: flex; min-height: 6rem; width: 100%; max-width: 1280px;
  align-items: center; justify-content: center; border-radius: 1rem;
  border: 1px dashed rgba(255,255,255,.2); padding: 0 1rem;
  font-size: 11px; text-transform: uppercase; letter-spacing: .2em; color: rgba(182,194,212,.6);
}

/* ---- studio / tool app ---- */
.studio { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .studio { grid-template-columns: minmax(0,1fr) 340px; } }
.studio-input label { display: block; margin-bottom: .5rem; font-size: .875rem; font-weight: 500; }
.studio-input textarea, .studio-input input[type="text"], .studio-input input[type="url"] {
  width: 100%; resize: vertical; border-radius: .75rem; border: 1px solid var(--border);
  background: rgba(15,23,42,.6); padding: .75rem 1rem; font-size: 1rem;
}
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tab {
  border-radius: 999px; border: 1px solid var(--border); background: rgba(41,55,77,.4);
  padding: .4rem .8rem; font-size: .75rem; font-weight: 500; color: var(--muted-foreground); cursor: pointer;
}
.tab.is-active { border-color: rgba(139,92,246,.6); background: rgba(139,92,246,.15); color: var(--foreground); box-shadow: var(--shadow-neon); }

.counter { margin-top: .75rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .75rem; color: var(--muted-foreground); }
.counter select { background: rgba(41,55,77,.6); border: 1px solid var(--border); border-radius: .5rem; padding: .3rem .5rem; font-size: .75rem; }
.counter .over { color: var(--danger); font-weight: 600; }

.hero-result { border-radius: 1rem; border: 1px solid rgba(139,92,246,.3); background: var(--card); padding: 1.25rem; box-shadow: var(--shadow-neon); margin-top: 1.25rem; }
.hero-result .label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--muted-foreground); }
.hero-result .value { margin-top: .5rem; font-size: 1.5rem; line-height: 1.5; word-break: break-word; }
.hero-result .actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }

.results-grid { margin-top: 1.25rem; display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .results-grid { grid-template-columns: repeat(2, 1fr); } }
.result-card { border-radius: 1rem; border: 1px solid var(--border); background: rgba(30,41,59,.7); padding: 1rem; }
.result-card .label { font-size: 11px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .1em; }
.result-card .value { margin-top: .4rem; font-size: 1.05rem; word-break: break-word; }
.result-card .row { margin-top: .75rem; display: flex; gap: .5rem; }
.result-card button {
  border-radius: .5rem; border: 1px solid var(--border); background: rgba(41,55,77,.6);
  padding: .4rem .7rem; font-size: .75rem; font-weight: 600; cursor: pointer; color: var(--foreground);
}
.result-card button:hover { box-shadow: var(--shadow-neon); }

.load-more { width: 100%; margin-top: 1.25rem; border-radius: .75rem; border: 1px solid var(--border); background: rgba(41,55,77,.5); padding: .75rem; font-size: .875rem; font-weight: 600; cursor: pointer; color: var(--foreground); }

.aside-card { border-radius: 1rem; border: 1px solid var(--border); background: var(--card); padding: 1rem; margin-bottom: 1rem; }
.aside-card h3 { font-size: .875rem; font-weight: 600; }
.vibe-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.vibe-tag { border-radius: 999px; border: 1px solid var(--border); background: rgba(41,55,77,.4); padding: .3rem .7rem; font-size: .7rem; cursor: pointer; color: var(--muted-foreground); }
.vibe-tag.is-active { border-color: rgba(0,240,255,.5); background: rgba(0,240,255,.12); color: var(--foreground); }
.slider-row { margin-top: .75rem; display: flex; align-items: center; gap: .75rem; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--cyan); }

.preview-toggle { display: flex; align-items: center; justify-content: space-between; }
.switch { position: relative; display: inline-block; width: 2.5rem; height: 1.4rem; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider-bg { position: absolute; inset: 0; background: rgba(41,55,77,.8); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .slider-bg:before { content: ""; position: absolute; height: 1.05rem; width: 1.05rem; left: .18rem; top: .18rem; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider-bg { background-image: var(--gradient-neon); }
.switch input:checked + .slider-bg:before { transform: translateX(1.1rem); }
.profile-mock { margin-top: 1rem; border-radius: .75rem; border: 1px solid var(--border); background: rgba(15,23,42,.6); padding: 1rem; display: none; }
.profile-mock.is-open { display: block; }

.invisible-list { display: grid; gap: .6rem; }
.invisible-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-radius: .75rem; border: 1px solid var(--border); background: rgba(30,41,59,.6); padding: .75rem 1rem; }
.invisible-row .name { font-weight: 600; font-size: .875rem; }
.invisible-row .note { font-size: .75rem; color: var(--muted-foreground); }
.invisible-preview { border-radius: .5rem; border: 1px dashed var(--border); padding: .4rem 1rem; min-width: 3rem; text-align: center; background: rgba(15,23,42,.5); }

.qr-preview { display: grid; place-items: center; border-radius: 1.25rem; border: 1px solid var(--border); background: #fff; padding: 1.5rem; }
.qr-controls { margin-top: 1rem; display: grid; gap: .75rem; }
.color-row { display: flex; gap: .75rem; align-items: center; }
.color-row input[type="color"] { width: 2.75rem; height: 2.75rem; border-radius: .5rem; border: 1px solid var(--border); background: none; padding: 0; }
.qr-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .75rem; }
.qr-preset { aspect-ratio: 1; border-radius: .75rem; border: 2px solid var(--border); cursor: pointer; }
.qr-preset.is-active { border-color: var(--cyan); box-shadow: var(--shadow-cyan); }

/* ---- tool / platform / blog cards & lists ---- */
.tool-card, .platform-card, .post-card {
  display: block; border-radius: 1.25rem; border: 1px solid var(--border);
  background: rgba(30,41,59,.55); padding: 1.25rem; transition: box-shadow .3s, transform .3s, border-color .3s;
}
.tool-card:hover, .platform-card:hover, .post-card:hover { box-shadow: var(--shadow-elevated); transform: translateY(-2px); border-color: rgba(139,92,246,.4); }
.tool-card .icon-badge, .platform-card .icon-badge {
  display: inline-grid; place-items: center; height: 2.75rem; width: 2.75rem; border-radius: .9rem;
  background-image: var(--gradient-neon); color: #fff; margin-bottom: .9rem;
}
.tool-card h3, .platform-card h3, .post-card h3 { font-size: 1.05rem; font-weight: 700; }
.tool-card p, .platform-card p, .post-card p { margin-top: .4rem; font-size: .875rem; color: var(--muted-foreground); }
.post-card .meta { margin-top: .75rem; font-size: .75rem; color: var(--muted-foreground); }
.category-chip { display: inline-block; border-radius: 999px; background: rgba(139,92,246,.15); color: var(--cyan); font-size: 11px; font-weight: 600; padding: .2rem .6rem; letter-spacing: .05em; text-transform: uppercase; }

.how-to ol { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .how-to ol { grid-template-columns: repeat(2, 1fr); } }
.how-to li { border-radius: 1rem; padding: 1.25rem; }
.how-to .num { display: grid; place-items: center; height: 2.25rem; width: 2.25rem; border-radius: .75rem; background-image: var(--gradient-neon); color: #fff; font-weight: 700; font-size: .875rem; }
.how-to h3 { margin-top: .75rem; font-weight: 600; }
.how-to p { margin-top: .4rem; font-size: .875rem; color: var(--muted-foreground); }

.faq-list dl { display: grid; gap: .75rem; margin: 1.5rem 0 0; }
.faq-list > dl > div { border-radius: 1rem; border: 1px solid var(--border); background: rgba(30,41,59,.7); padding: 1.25rem; }
.faq-list dt { font-weight: 600; color: var(--heading); }
.faq-list dd { margin: .4rem 0 0; font-size: .875rem; color: var(--muted-foreground); }

.prose { font-size: .95rem; line-height: 1.7; color: var(--muted-foreground); }
.prose h2 { color: var(--heading); font-size: 1.25rem; font-weight: 700; margin-top: 1.75rem; }
.prose p { margin: .75rem 0; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin: .35rem 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { border-radius: 999px; border: 1px solid var(--border); background: rgba(41,55,77,.5); padding: .4rem .9rem; font-size: .8rem; color: var(--muted-foreground); }
.chip.is-active, a.chip:hover { color: var(--foreground); border-color: rgba(139,92,246,.5); }

/* ---- tilt card (3D pointer-follow tilt + glare, ported from TiltCard.tsx) ---- */
.tilt-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  transition: transform .15s ease-out, box-shadow .3s ease;
  will-change: transform;
}
.tilt-card:hover { box-shadow: var(--shadow-neon); }
.tilt-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--glare-o, 0);
  transition: opacity .3s;
  background: radial-gradient(360px circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255, 255, 255, 0.85), transparent 60%);
}
.tilt-card > * { position: relative; }

/* ---- coverflow (3D swipeable carousel, ported from Coverflow.tsx) ---- */
.coverflow { position: relative; }
.coverflow-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2rem 12%;
  perspective: 1200px;
  scrollbar-width: none;
}
.coverflow-track::-webkit-scrollbar { display: none; }
.coverflow-item {
  flex-shrink: 0;
  width: 78%;
  scroll-snap-align: center;
  transition: transform .3s ease-out, opacity .3s ease-out;
}
@media (min-width: 640px) { .coverflow-item { width: 46%; } }
@media (min-width: 1024px) { .coverflow-item { width: 30%; } }
.coverflow-item > a { display: block; height: 100%; border-radius: 1.25rem; border: 1px solid var(--border); background: var(--card); padding: 1.5rem; }
.coverflow-fade { position: absolute; top: 0; bottom: 0; width: 6rem; pointer-events: none; display: none; }
@media (min-width: 640px) { .coverflow-fade { display: block; } }
.coverflow-fade.left { left: 0; background: linear-gradient(90deg, var(--background), transparent); }
.coverflow-fade.right { right: 0; background: linear-gradient(270deg, var(--background), transparent); }
.coverflow-nav { margin-top: .5rem; display: flex; align-items: center; justify-content: center; gap: .75rem; }
.coverflow-nav button {
  display: grid; place-items: center; height: 2.75rem; width: 2.75rem; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(30,41,59,.62); backdrop-filter: blur(18px);
  color: var(--foreground); cursor: pointer;
}
.coverflow-nav .count { font-size: .75rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

.contact-form { display: grid; gap: 1rem; max-width: 32rem; }
.contact-form label { font-size: .875rem; font-weight: 500; }
.contact-form input, .contact-form textarea {
  margin-top: .35rem; width: 100%; border-radius: .75rem; border: 1px solid var(--border);
  background: rgba(15,23,42,.6); padding: .65rem .9rem; font-size: .9rem;
}

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(1rem);
  background: var(--surface); border: 1px solid var(--border); border-radius: .75rem;
  padding: .65rem 1.1rem; font-size: .85rem; box-shadow: var(--shadow-elevated);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
