/* ============================================================
   BODY & BASE
   ============================================================ */
body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-content {
    flex: 1;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 1.5rem;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-text);
    white-space: nowrap;
    flex-shrink: 0;
}

.site-name {
    color: var(--color-primary);
}

/* Main Nav */
.main-nav {
    margin-left: auto;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: block;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    padding: 0;
    flex-shrink: 0;
}

.hamburger-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(2) {
    opacity: 0;
}
.hamburger[aria-expanded="true"] .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #fff;
    padding: 5rem 0 4rem;
    text-align: center;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero-sub {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */
.page-header {
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    padding: 2.5rem 0 2rem;
}

.page-header-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.page-header-sub {
    color: var(--color-text-muted);
    font-size: 1rem;
    max-width: 640px;
}

/* ============================================================
   SECTION
   ============================================================ */
.section {
    padding: 3.5rem 0;
}

.section-alt {
    background: var(--color-bg-alt);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    letter-spacing: -0.01em;
}

.section-title-sm {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* ============================================================
   GRIDS
   ============================================================ */
.grid-tools {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.grid-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
    background: var(--color-bg-dark);
    color: #94a3b8;
    padding-top: 3rem;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding-bottom: 2.5rem;
}

.footer-heading {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    font-size: 0.9rem;
    color: #94a3b8;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: #fff;
}

.footer-brand .site-logo {
    color: #fff;
    margin-bottom: 0.75rem;
}

.footer-tagline {
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 0;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: #64748b;
}

.footer-logo img {
    filter: brightness(0) invert(1);
}

/* ============================================================
   ALIASES & SUPPLEMENTS
   ============================================================ */

/* Hero aliases */
.hero-inner    { max-width: 720px; margin-inline: auto; }
.hero-subtitle { font-size: 1.1rem; opacity: .9; max-width: 600px; margin: 0 auto 2rem; line-height: 1.7; }

/* Page header aliases */
.page-header h1     { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; letter-spacing: -.01em; margin-bottom: .5rem; }
.page-subtitle      { color: var(--color-text-muted); font-size: 1rem; max-width: 640px; }

/* Section BEM modifier alias */
.section--alt { background: var(--color-bg-alt); }

/* Tool page 2-col layout */
.tool-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
}
.tool-section  { padding: 2.5rem 0; }
.tool-content  { padding: 2rem 0 3rem; }
.tool-content-inner { max-width: 820px; }

/* Grid-3 alias */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.25rem; }

/* Stat box aliases used by tool pages */
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--color-primary); display: block; line-height: 1; margin-bottom: .3rem; }
.stat-label { font-size: .75rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat-box--large { grid-column: span 2; }

/* Tool control variants */
.tool-controls--top  { margin-bottom: 1rem; }
.tool-controls--col  { flex-direction: column; align-items: flex-start; }
.tool-controls--row  { flex-direction: row; flex-wrap: wrap; }

/* Inline form group */
.form-group--inline   { flex-direction: row; align-items: center; gap: .6rem; }
.form-control--sm     { width: auto; padding: .35rem .6rem; font-size: .88rem; }

/* Tool output row (output field + copy btn side by side) */
.tool-output-row { display: flex; gap: .5rem; align-items: flex-start; }
.tool-output-row .form-control,
.tool-output-row .tool-textarea { flex: 1; }

/* Password tool */
.pwd-output-row       { display: flex; gap: .5rem; margin-bottom: 1rem; }
.pwd-output           { flex: 1; font-family: var(--font-mono); font-size: 1.05rem; font-weight: 600; letter-spacing: .04em; }
.pwd-strength-wrap    { margin-bottom: 1.25rem; }
.pwd-strength-bar-track { height: 6px; background: var(--color-border); border-radius: 100px; overflow: hidden; margin-bottom: .4rem; }
.pwd-strength-bar     { height: 100%; border-radius: 100px; width: 0; transition: width .3s ease, background .3s ease; }
.pwd-strength-label   { font-size: .85rem; font-weight: 700; }

/* Range input */
.range-input  { width: 100%; accent-color: var(--color-primary); margin: .25rem 0; }
.range-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--color-text-muted); margin-top: -.2rem; }

/* Checkboxes / options */
.tool-options  { display: flex; flex-direction: column; gap: .6rem; margin: .75rem 0 1.25rem; }
.option-label  { display: flex; align-items: center; gap: .55rem; font-size: .9rem; cursor: pointer; user-select: none; }
.option-label input { accent-color: var(--color-primary); cursor: pointer; }

/* Username list */
.uname-list   { list-style: none; display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.uname-item   { display: flex; align-items: center; justify-content: space-between; padding: .65rem 1rem; background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius); }
.uname-text   { font-family: var(--font-mono); font-size: 1rem; }

/* Timestamp tool */
.ts-current-banner  { background: var(--color-primary-light); border: 1px solid var(--color-border); border-radius: var(--radius); padding: .75rem 1.25rem; display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; font-size: .9rem; }
.ts-current-value   { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; color: var(--color-primary); }
.ts-card            { background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem; }
.ts-card-title      { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.tool-output        { background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius); padding: .875rem 1rem; font-size: .9rem; line-height: 1.7; min-height: 3rem; margin-top: .75rem; }

/* JSON status */
.tool-status        { font-size: .875rem; font-weight: 600; padding: .4rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; min-height: 2rem; display: block; }
.tool-status--ok    { background: #f0fdf4; color: var(--color-success); border: 1px solid #bbf7d0; }
.tool-status--error { background: #fef2f2; color: var(--color-error); border: 1px solid #fecaca; }

/* Sidebar box */
.sidebar-box  { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.25rem; }
.sidebar-box h3 { font-size: .9rem; font-weight: 700; margin-bottom: .75rem; }
.sidebar-tips { display: flex; flex-direction: column; gap: .4rem; padding-left: 1.1rem; font-size: .875rem; line-height: 1.5; color: var(--color-text-muted); }

/* Utility */
.font-mono  { font-family: var(--font-mono) !important; }
.tool-hint  { font-size: .85rem; color: var(--color-text-muted); margin: .4rem 0; min-height: 1.2em; }

/* Progress bar (char counter) */
.progress-bar-wrap  { height: 8px; background: var(--color-border); border-radius: 100px; overflow: hidden; margin: .75rem 0 .25rem; }
.progress-bar       { height: 100%; border-radius: 100px; background: var(--color-primary); width: 0; transition: width .2s ease, background .2s ease; }

/* Content block */
.content-block { margin-bottom: 2.5rem; }
.content-block h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: .75rem; padding-top: .5rem; border-top: 1px solid var(--color-border); margin-top: .5rem; }
.content-block p  { font-size: .95rem; line-height: 1.75; color: var(--color-text-muted); margin-bottom: 1rem; }
.content-block code { font-family: var(--font-mono); background: var(--color-bg-alt); padding: .15em .4em; border-radius: 4px; font-size: .88em; }

/* Tools filter bar */
.tools-filter-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.75rem; }

/* Contact page */
.contact-layout    { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; align-items: start; }
.contact-form-wrap { min-width: 0; }
.contact-aside     { display: flex; flex-direction: column; gap: 1.25rem; }
.contact-form      { display: flex; flex-direction: column; gap: 1.25rem; }

/* Prose (about page) */
.prose h2         { font-size: 1.2rem; font-weight: 700; margin: 2rem 0 .75rem; }
.prose p          { font-size: .95rem; line-height: 1.8; color: var(--color-text-muted); margin-bottom: 1rem; }
.prose a          { color: var(--color-primary); }
.prose a:hover    { text-decoration: underline; }

/* Badge category aliases */
.badge-developer { background: #eff6ff; color: #1d4ed8; }
.badge-generator { background: #fdf4ff; color: #7e22ce; }

/* ============================================================
   V2: AD SLOT
   ============================================================ */
.ad-slot {
    padding: 0.5rem 0;
    text-align: center;
}

/* When an ad loads inside, the min-height gives it space.
   When empty the slot collapses cleanly — no broken-box look. */
.ad-slot:not(:empty) {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Wrapper-level ad slot that needs a container */
.ad-slot--contained {
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* ============================================================
   V2: SEO INTRO BLOCK
   ============================================================ */
.section--intro {
    padding-top: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.intro-block {
    max-width: 820px;
}

.intro-block p {
    font-size: 0.975rem;
    line-height: 1.8;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.intro-block p:last-child {
    margin-bottom: 0;
}

/* ============================================================
   V2: CATEGORY SHOWCASE (homepage)
   ============================================================ */
.category-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.category-showcase-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.category-showcase-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #bfdbfe;
}

.category-showcase-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
}

.category-showcase-header:hover .category-showcase-name {
    color: var(--color-primary);
}

.category-showcase-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.category-showcase-name {
    flex: 1;
    transition: color var(--transition);
}

.category-showcase-arrow {
    color: var(--color-text-muted);
    font-size: 1rem;
    transition: transform var(--transition);
}

.category-showcase-header:hover .category-showcase-arrow {
    transform: translateX(3px);
    color: var(--color-primary);
}

.category-showcase-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0;
}

.category-tool-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-top: 1px solid var(--color-border);
    padding-top: 0.75rem;
}

.category-tool-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    color: var(--color-text);
    padding: 0.25rem 0;
    transition: color var(--transition);
    text-decoration: none;
}

.category-tool-link:hover {
    color: var(--color-primary);
}

.category-tool-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.category-showcase-more {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: auto;
    padding-top: 0.5rem;
    text-decoration: none;
    transition: color var(--transition);
}

.category-showcase-more:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ============================================================
   V2: BENEFITS GRID (Why Use HNH Lab?)
   ============================================================ */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.benefit-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: box-shadow var(--transition);
}

.benefit-card:hover {
    box-shadow: var(--shadow-md);
}

.benefit-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.benefit-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--color-text);
}

.benefit-desc {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin: 0;
}

.benefit-desc a {
    color: var(--color-primary);
}
