:root {
  --bg: #f3f6fb;
  --bg-accent: #e8eefc;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-muted: #f8fafc;
  --ink: #0f172a;
  --muted: #475569;
  --line: rgba(148, 163, 184, 0.28);
  --line-strong: rgba(37, 99, 235, 0.22);
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --accent: #0ea5e9;
  --success: #166534;
  --success-soft: rgba(22, 101, 52, 0.12);
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.1);
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.09);
  --shadow-strong: 0 24px 60px rgba(15, 23, 42, 0.14);
  --radius: 0px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 24rem),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 22rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.page-shell {
  width: min(1520px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.page-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 180px;
  gap: 1.5rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 1rem;
}

.ad-block {
  padding: 1rem;
  border-radius: 0;
}

.ad-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ad-code {
  display: grid;
  place-items: center;
  min-height: 12rem;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.6;
}

.sidebar-adsense {
  width: 100%;
  min-width: 120px;
  min-height: 600px;
}

.ad-fallback {
  display: grid;
  gap: 0.6rem;
  text-align: center;
}

.ad-fallback strong {
  color: var(--ink);
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  z-index: 200;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: "Fraunces", "Iowan Old Style", serif;
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 2.9rem;
  height: 2.9rem;
  flex: 0 0 auto;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.site-nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  z-index: 210;
}

.site-nav a,
.site-nav-button {
  padding: 0.78rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
  font: inherit;
  color: inherit;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active,
.site-nav-button:hover,
.site-nav-button:focus-visible,
.site-nav-button.is-active {
  border-color: rgba(148, 163, 184, 0.42);
  background: #eef4ff;
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.site-nav-dropdown {
  position: relative;
  z-index: 220;
}

.site-nav-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
}

.site-nav-button::-webkit-details-marker {
  display: none;
}

.site-nav-dropdown[open] > .site-nav-button,
.site-nav-dropdown[open] > .site-nav-button.is-active {
  border-color: rgba(148, 163, 184, 0.42);
  background: #eef4ff;
  color: var(--primary-dark);
}

.site-nav-button::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 160ms ease;
}

.site-nav-dropdown[open] > .site-nav-button::after {
  transform: rotate(-135deg) translateY(-1px);
}

.site-nav-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  display: none;
  width: min(1100px, calc(100vw - 2rem));
  max-width: 1100px;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-strong);
  transform: translateY(0);
  z-index: 230;
}

.site-nav-dropdown[open] > .site-nav-menu {
  display: block;
}

.site-nav-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.site-nav-group {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.site-nav-group-title {
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.site-nav-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid transparent;
  background: transparent;
}

.site-nav-item:hover,
.site-nav-item:focus-visible,
.site-nav-item.is-active {
  border-color: rgba(148, 163, 184, 0.28);
  background: #eff6ff;
}

.site-nav-item-label {
  font-weight: 800;
  color: var(--ink);
}

.site-nav-item-copy {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: rgba(100, 116, 139, 0.55);
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible {
  color: var(--primary-dark);
}

.breadcrumbs [aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}

.hero,
.panel {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 1.5rem;
  padding: 2rem;
  overflow: hidden;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.77rem;
  font-weight: 800;
}

.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 2px;
  border-radius: 0;
  background: currentColor;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", serif;
  font-weight: 600;
  line-height: 1.08;
  color: var(--ink);
}

h1 {
  margin-top: 0.9rem;
  font-size: clamp(2.65rem, 6vw, 4.8rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  color: var(--muted);
  line-height: 1.72;
}

.hero-copy p {
  max-width: 60ch;
  font-size: 1.02rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.9rem 1.25rem;
  border-radius: 0;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

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

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

.button-secondary,
.button-ghost {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #fff;
  color: var(--ink);
}

.feature-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.8rem;
  padding: 1.5rem;
  border-radius: 0;
  border: 1px solid rgba(191, 219, 254, 0.85);
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.metric {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: 0.55rem;
  margin-bottom: 0.55rem;
  padding: 0.68rem 0.95rem;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(191, 219, 254, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack {
  display: grid;
  gap: 1rem;
}

.panel {
  padding: 1.5rem;
}

.quote {
  padding: 1.4rem;
  border-radius: 0;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 1);
}

.quote strong {
  display: block;
  margin-top: 0.8rem;
}

.tool-input,
.output-box,
.html-preview {
  width: 100%;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

.tool-input {
  min-height: 18rem;
  padding: 1.15rem 1.2rem;
  border: 2px solid rgba(148, 163, 184, 0.24);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.04),
    0 10px 28px rgba(15, 23, 42, 0.06);
  font: inherit;
  font-size: 1rem;
  line-height: 1.65;
  resize: vertical;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.tool-input::placeholder {
  color: #94a3b8;
}

.tool-input-small {
  min-height: auto;
  width: 9rem;
}

.tool-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.62);
  box-shadow:
    0 0 0 5px rgba(37, 99, 235, 0.12),
    0 16px 34px rgba(37, 99, 235, 0.1);
  background: #fff;
}

.tool-page .hero {
  grid-template-columns: minmax(0, 1fr);
  padding: 1.35rem 1.4rem;
  gap: 1rem;
}

.tool-page .hero h1 {
  margin-top: 0.55rem;
  font-size: clamp(1.95rem, 4vw, 3rem);
  max-width: 16ch;
}

.tool-page .hero-copy p {
  max-width: 58ch;
  font-size: 0.98rem;
}

.tool-page .feature-card {
  padding: 1.2rem;
}

.tool-page .panel {
  background: rgba(255, 255, 255, 0.95);
}

.tool-page .tool-input,
.tool-page .output-box,
.tool-page .html-preview {
  border: 2px solid rgba(96, 165, 250, 0.34);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.04),
    0 16px 36px rgba(15, 23, 42, 0.07);
}

.tool-page .tool-input {
  min-height: 22rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 0.98));
}

.tool-page .tool-input-small {
  min-height: auto;
  width: 9rem;
}

.tool-page .tool-input + .muted-note,
.tool-page .panel .muted-note {
  margin-top: 0.2rem;
}

.validation-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.95rem;
}

.validation-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.65rem;
  padding: 0.7rem 0.95rem;
  border-radius: 0;
  border: 1px solid rgba(191, 219, 254, 0.92);
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.92rem;
  font-weight: 800;
}

.tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border-radius: 0;
  font-weight: 800;
  border: 1px solid transparent;
}

.status-valid {
  background: var(--success-soft);
  border-color: rgba(22, 101, 52, 0.14);
  color: var(--success);
}

.status-error {
  background: var(--danger-soft);
  border-color: rgba(180, 35, 24, 0.14);
  color: var(--danger);
}

.error-panel {
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.98), rgba(255, 255, 255, 1));
  box-shadow: 0 12px 30px rgba(180, 35, 24, 0.08);
}

.error-panel h3 {
  margin-bottom: 0.45rem;
  color: #991b1b;
  font-size: 1.35rem;
}

.error-panel p {
  margin: 0;
  color: #7f1d1d;
}

.error-code {
  display: block;
  margin-top: 0.8rem;
  padding: 0.9rem 0.95rem;
  border-radius: 0;
  background: rgba(254, 226, 226, 0.9);
  color: #7f1d1d;
  font: 600 0.92rem/1.5 "SFMono-Regular", "SF Mono", Monaco, Consolas, monospace;
}

.output-box {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 2px solid rgba(148, 163, 184, 0.2);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 500 0.95rem/1.6 "SFMono-Regular", "SF Mono", Monaco, Consolas, monospace;
}

.html-preview {
  padding: 1rem 1.1rem;
  border: 2px solid rgba(148, 163, 184, 0.2);
}

.html-preview h1,
.html-preview h2,
.html-preview h3 {
  margin-top: 0;
}

.html-preview p,
.html-preview li {
  color: var(--ink);
}

.helper-grid {
  display: grid;
  gap: 1rem;
}

.helper-card {
  padding: 1.2rem;
  border: 1px solid rgba(226, 232, 240, 1);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 1));
}

.helper-card h3 {
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
}

.seo-section {
  display: grid;
  gap: 1.25rem;
}

.faq-list {
  display: grid;
  gap: 1rem;
}

.faq-item {
  padding: 1.15rem;
  border: 1px solid rgba(226, 232, 240, 1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 1));
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  font-weight: 700;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--primary-dark);
}

.muted-note {
  font-size: 0.95rem;
  color: var(--muted);
}

.stat-card {
  text-align: center;
}

.stat-card h2 {
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  color: var(--primary-dark);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 700ms ease forwards;
}

.reveal-delay-1 {
  animation-delay: 100ms;
}

.reveal-delay-2 {
  animation-delay: 180ms;
}

.reveal-delay-3 {
  animation-delay: 260ms;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 900px) {
  .hero,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .site-header,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .site-nav a,
  .site-nav-dropdown,
  .site-nav-button {
    width: 100%;
  }

  .site-nav-button {
    justify-content: center;
  }

  .site-nav-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    padding: 0.75rem;
    max-height: 70vh;
    overflow: auto;
  }

  .site-nav-menu-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .site-nav-group {
    gap: 0.2rem;
  }

  .site-nav-item {
    padding: 0.6rem 0.65rem;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
  }

  .site-nav-item-copy {
    display: none;
  }

  .site-nav-group-title {
    padding-bottom: 0.35rem;
    font-size: 0.78rem;
  }

  .site-nav-item-label {
    font-size: 0.92rem;
  }

  .page-shell {
    width: min(100% - 1rem, 1520px);
  }

  h1 {
    font-size: clamp(2.1rem, 12vw, 3.5rem);
  }

  .tool-page .tool-input {
    min-height: 18rem;
  }
}
