:root {
  --main-bg: #0f172a;        /* slightly richer dark */
  --card-bg: #111827;
  --accent: #f97373;         /* softer red-pink */
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --input-bg: #111827;
  --input-border: #1f2937;
  --btn-radius: 9px;
  --shadow: 0 16px 50px rgba(0,0,0,0.55);
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  background: radial-gradient(circle at top, #1f2937 0, #020617 55%);
  color: var(--text-main);
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
}

/* Stars */
.stars-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
}
.star {
  position: absolute;
  border-radius: 999px;
  background: rgba(255,255,255,0.65);
  opacity: .7;
  animation: star-float linear infinite;
}
@keyframes star-float {
  to { transform: translateY(102vh); }
}

/* Header */
.site-header {
  position: relative;
  z-index: 2;
  padding: 16px 5vw 6px;
}
.site-header-inner {
  max-width: 1150px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97373, #fb923c);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.logo {
  max-width: 38px;
  max-height: 38px;
  display: block;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f9fafb;
  letter-spacing: 0.04em;
}
.brand-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.main-nav a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.main-nav a:hover,
.main-nav a.active {
  background: rgba(249,115,115,0.2);
  color: #f9fafb;
  transform: translateY(-1px);
}

/* Hero */
.hero {
  max-width: 900px;
  margin: 28px auto 4px auto;
  padding: 0 5vw;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: 2.3rem;
  margin: 0 0 10px 0;
  color: #f9fafb;
}
.hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Top tools row */
nav.tool-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin: 26px 0 0 0;
  position: relative;
  z-index: 1;
}
nav.tool-nav a {
  color: var(--text-main);
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(148,163,184,0.35);
  padding: 10px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.96em;
  transition: background .13s, color .14s, box-shadow .12s, transform .12s;
}
nav.tool-nav a:hover {
  color: #f9fafb;
  background: #f97373;
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(249,115,115,0.35);
  transform: translateY(-1px);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  gap: 30px;
  max-width: 1150px;
  margin: 40px auto 36px auto;
  padding: 0 5vw;
  position: relative;
  z-index: 1;
}
.tool-card {
  background: var(--card-bg);
  color: var(--text-main);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 30px 24px 24px 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: box-shadow 0.13s, background 0.15s, transform 0.12s, border-color 0.12s;
  border: 1px solid rgba(15,23,42,0.9);
}
.tool-card h2 {
  color: var(--accent);
  margin: 0 0 10px 0;
  font-size: 1.12em;
  font-weight: 700;
}
.tool-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94em;
}
.tool-card:hover {
  box-shadow: 0 16px 46px rgba(15,23,42,0.9);
  background: #020617;
  border-color: rgba(249,115,115,0.7);
  transform: translateY(-3px);
}

/* Shared tool-page layout (unchanged from you, kept for other pages) */
.main-card {
  background: var(--card-bg);
  border-radius: 18px;
  max-width: 1100px;
  margin: 44px auto 40px auto;
  padding: 36px 4vw 44px 4vw;
  box-shadow: var(--shadow);
  z-index: 2;
}
.main-card h2 {
  color: var(--accent);
  font-size: 1.43em;
  text-align:center;
  font-weight: 700;
}
.main-card p {
  color: var(--text-muted);
  text-align: center;
  font-size: 1.12em;
}
.tool-io-wrapper {
  display: flex;
  gap: 38px;
  flex-wrap: nowrap;
  margin-top: 32px;
  justify-content: space-between;
}
.io-box {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  background: var(--input-bg);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  height: 520px;
  box-sizing: border-box;
  padding: 0;
}
.io-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 18px 7px 18px;
}
.io-header h3 {
  color: var(--accent);
  margin: 0 0 2px 0;
  font-size: 1.07em;
  font-weight: 700;
}
textarea,
pre {
  width: 100%;
  height: 420px;
  min-height: 120px;
  max-height: 100%;
  box-sizing: border-box;
  resize: vertical;
  margin: 0;
  border-radius: 7px;
  padding: 11px 14px;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  color: var(--text-main);
  font-family: 'JetBrains Mono', 'Consolas', 'Menlo', monospace;
  font-size: 1.09em;
}
pre {
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
pre.error {
  background: #33131d;
  color: #f97373;
  font-weight: 700;
  font-size: 1.02em;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Buttons */
.btn-bar {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 36px 0 0 0;
}
button, .btn {
  background: var(--accent);
  color:#fff;
  font-size: 1.12em;
  font-weight: 600;
  border: none;
  border-radius: var(--btn-radius);
  padding: 12px 32px;
  cursor: pointer;
  margin-top: 14px;
  box-shadow: 0 2px 8px 0 rgba(249,115,115,0.25);
  transition: opacity 0.13s, background .14s, transform 0.1s;
}
button:hover, .btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--input-bg);
  color: var(--accent);
  border: 2px solid var(--accent);
  font-weight: 600;
}
.btn-secondary:hover { background: #020617; }
.btn-bar .btn-red {
  background: #111827;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-bar .btn-red:hover {
  background: var(--accent);
  color: #fff;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(148,163,184,0.25);
  margin-top: 48px;
  padding: 22px 5vw 26px;
  color: var(--text-muted);
  font-size: 0.86rem;
  position: relative;
  z-index: 2;
  background: rgba(2,6,23,0.97);
}

.footer-inner {
  max-width: 1150px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: flex-start;
}

/* left: logo + tagline */
.footer-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo-wrap {
  background: linear-gradient(135deg, #f97373, #fb923c);
}

.footer-copy {
  margin: 0;
  color: var(--text-muted);
}

/* right: heading + multi-column links */
.footer-right {
  text-align: left;
}

.footer-right h4 {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f9fafb;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 4px 24px;
}

.footer-links-grid a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.5;
  transition: color 0.15s;
}

.footer-links-grid a:hover {
  color: var(--accent);
}

/* mobile */
@media (max-width: 720px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-links-grid {
    grid-template-columns: 1fr;
  }
}


/* mobile */
@media (max-width: 720px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* Responsive */
@media (max-width: 950px) {
  .tool-io-wrapper { flex-direction: column; gap: 20px; }
  .io-box { height: 350px; }
  textarea, pre { height: 220px; }
}
@media (max-width: 720px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero {
    text-align: left;
  }
}
@media (max-width: 600px) {
  .main-card { padding: 9px 2vw; }
  .io-box { height: 210px; }
  textarea, pre { height: 115px; font-size: 0.97em; }
  .btn-bar { flex-direction: column; gap: 9px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-thumb { background:#1f2937; border-radius:10px; }
