:root {
  color-scheme: light;
  --body-bg: #f8fafc;
  --surface: #ffffff;
  --text-default: #0f172a;
  --text-muted: #64748b;
  --primary: #7c3aed;
  --primary-strong: #5b21b6;
  --border: #e2e8f0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--body-bg);
  color: var(--text-default);
}

.site-global-header,
.site-global-footer {
  width: 100%;
}

.site-global-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e8ecf4;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-global-header > div {
  width: min(100%, 1180px);
  min-height: 68px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-global-header > div > a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #172033;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-global-header > div > a img {
  width: 38px;
  height: 38px;
  padding: 7px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #6d5dfc, #5146df);
  box-shadow: 0 7px 18px rgba(81, 70, 223, 0.22);
}

.site-global-header > div > a span span {
  display: inline;
}

.site-global-header > div > a span span:last-child {
  margin-left: 5px;
  color: #7a8496;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.site-global-header a {
  color: #334155;
  transition: color 0.2s ease;
}

.site-global-header a:hover {
  color: #5146df;
}

.site-global-footer {
  background: #ffffff !important;
  color: #64748b !important;
  width: 100%;
  border-top: 1px solid #e8ecf4;
}

.site-global-footer a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-global-footer a:hover {
  color: #5146df;
}

.site-global-footer .footer-links li,
.site-global-footer .footer-block li {
  margin-bottom: 0.55rem;
}

.full-width-section {
  width: 100%;
}

.tool-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
}

.homepage-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: center;
}

.homepage-main>section {
  width: min(100%, 1180px);
}

.homepage-hero {
  padding: 4rem 0 0;
}

.site-global-footer .footer-content {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 24px;
}

.hero-card {
  max-width: 860px;
}

.hero-card .hero-badge {
  margin-bottom: 1.5rem;
}

.hero-card h1 {
  margin-bottom: 1rem;
}

.hero-card p {
  line-height: 1.85;
}

.homepage-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
}

.hero-card {
  border-radius: 2rem;
  padding: 3rem 2.25rem;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.09);
}

.hero-card .hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: #7c3aed;
  color: #ffffff;
  box-shadow: 0 20px 45px rgba(124, 58, 237, 0.18);
}

.hero-card h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.hero-card p {
  max-width: 54rem;
  margin: 0 auto;
}

.homepage-tools {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.site-nav a {
  padding: 9px 11px;
  border-radius: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  color: #5146df;
  background: #f3f1ff;
}

.site-global-footer {
  padding: 0;
}

.site-global-footer .footer-content {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-global-footer .footer-content > div:first-child {
  flex: 0 0 auto;
}

.site-global-footer .footer-content > div:first-child > p:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
}

.site-global-footer .footer-content > div:first-child > p:first-child::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f0efff url("/favicon.ico") center / 17px 17px no-repeat;
}

.site-global-footer .footer-content > div:first-child > p:last-child,
.site-global-footer .footer-content > div:nth-child(2),
.site-global-footer .footer-content > div:nth-child(3) > p {
  display: none;
}

.site-global-footer .footer-content > div:nth-child(3) ul {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-global-footer .footer-content > div:nth-child(3) li {
  margin: 0;
}

.site-global-footer .footer-content > div:nth-child(3) a {
  font-size: 12px;
  font-weight: 600;
}

.site-global-footer > div:last-of-type {
  border-top: 1px solid #eef1f6;
  padding: 14px 24px;
  color: transparent;
  font-size: 0;
  text-align: center;
}

.site-global-footer > div:last-of-type::before {
  content: "© 2026 KaSin TV. Free tools, fast and secure.";
  color: #8a94a6;
  font-size: 12px;
}

.site-global-footer .footer-links,
.site-global-footer .footer-block {
  display: grid;
  gap: 0.75rem;
}

.site-global-footer small {
  display: block;
  margin-top: 1.25rem;
  color: #94a3b8;
}

.page-hero {
  position: relative;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.14), transparent 26%),
    radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.09), transparent 20%);
  pointer-events: none;
}

.page-hero>* {
  position: relative;
}

@media (max-width: 1024px) {
  .homepage-main {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 768px) {
  .site-global-header > div {
    min-height: auto;
    padding: 10px 16px 8px;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .site-global-header > div > a img {
    width: 34px;
    height: 34px;
  }

  .site-global-header .site-nav {
    width: calc(100% + 32px);
    margin: 0 -16px;
    padding: 0 12px 4px;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-global-header .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    padding: 8px 9px;
    font-size: 12px;
  }

  .site-global-footer .footer-content {
    min-height: auto;
    padding: 24px 16px 18px;
    flex-direction: column;
    gap: 16px;
  }

  .site-global-footer .footer-content > div:nth-child(3) ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
  }

  .site-global-footer > div:last-of-type {
    padding: 12px 16px 18px;
  }
}

/* Unified site UI */
body {
  background:
    radial-gradient(circle at 12% 0%, rgba(109, 93, 252, 0.08), transparent 24rem),
    linear-gradient(180deg, #f8f9fd 0%, #f5f7fb 100%);
  color: #172033;
}

::selection {
  background: #dedaff;
  color: #292064;
}

h1,
h2,
h3 {
  color: #172033;
  letter-spacing: -0.025em;
}

p {
  line-height: 1.7;
}

button,
.btn,
input,
textarea,
select {
  font: inherit;
}

button,
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
textarea,
select {
  border-color: #dfe3ee;
  border-radius: 11px;
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #7567f8;
  box-shadow: 0 0 0 4px rgba(109, 93, 252, 0.12);
}

.gradient-bg {
  background: linear-gradient(135deg, #5547db 0%, #7665f8 52%, #8a70f7 100%) !important;
}

.card,
.tool-container,
.calculator-container,
.converter-container,
.color-picker-container,
.scanner-container,
.generator-container,
.contact-info,
.privacy-container,
.terms-container,
.disclaimer-container {
  border: 1px solid #e7e9f2;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 55px rgba(31, 38, 71, 0.08);
}

.tool-header,
.section-header {
  max-width: 780px;
  margin-right: auto;
  margin-bottom: 28px;
  margin-left: auto;
  text-align: center;
}

.tool-header h1,
.section-header h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.12;
}

.homepage-main {
  width: min(100%, 1240px);
  max-width: 1240px;
  padding: 42px 24px 56px;
  gap: 28px;
  align-items: stretch;
}

.homepage-main > section,
#toolCategories {
  width: 100%;
}

.homepage-hero {
  padding: 0;
  overflow: visible;
  background: transparent;
}

.hero-card {
  position: relative;
  max-width: none;
  padding: clamp(42px, 7vw, 78px) clamp(24px, 6vw, 72px);
  overflow: hidden;
  border: 1px solid #e5e2ff;
  border-radius: 28px;
  background:
    radial-gradient(circle at 84% 18%, rgba(109, 93, 252, 0.16), transparent 18rem),
    radial-gradient(circle at 12% 100%, rgba(139, 92, 246, 0.11), transparent 20rem),
    #ffffff;
  box-shadow: 0 24px 70px rgba(53, 45, 125, 0.1);
}

.hero-card .hero-badge {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7567f8, #5a49df);
}

.hero-card h1 {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  line-height: 1.02;
}

.hero-card > p:first-of-type {
  color: #596579;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

#toolCategories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

#toolCategories > .tool-category {
  height: 100%;
  margin-top: 0 !important;
  padding: 26px;
  border-color: #e6e8f1;
  border-radius: 22px;
  box-shadow: 0 12px 38px rgba(31, 38, 71, 0.06);
}

#toolCategories .tool-card {
  min-height: 58px;
  border-color: #eaecf3;
  background: #fbfbfe;
}

#toolCategories .tool-card:hover {
  border-color: #d9d4ff;
  background: #f7f5ff;
  box-shadow: 0 12px 28px rgba(75, 64, 160, 0.1);
}

body > article.fade-in,
body > section.fade-in {
  width: min(calc(100% - 48px), 1192px);
  margin-right: auto;
  margin-left: auto;
}

body > article.fade-in {
  margin-top: 0;
  margin-bottom: 32px;
  border-color: #e5e2ff;
  border-radius: 26px;
  background: linear-gradient(135deg, #f5f3ff, #faf9ff);
}

body > section.fade-in {
  margin-bottom: 56px;
}

body > section.fade-in details {
  border-color: #e7e9f2;
  box-shadow: 0 6px 20px rgba(31, 38, 71, 0.04);
}

@media (max-width: 900px) {
  #toolCategories {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .homepage-main {
    padding: 24px 14px 40px;
    gap: 18px;
  }

  .hero-card {
    padding: 38px 20px;
    border-radius: 22px;
  }

  .hero-card h1 {
    font-size: clamp(2.15rem, 12vw, 3.25rem);
  }

  #toolCategories {
    gap: 16px;
  }

  #toolCategories > .tool-category {
    padding: 20px 16px;
    border-radius: 18px;
  }

  body > article.fade-in,
  body > section.fade-in {
    width: calc(100% - 28px);
  }
}
