/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    line-height: 1.55;
    color: #e0dcd0;
    background-color: #1a1814;
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(180, 140, 80, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 90%, rgba(140, 100, 50, 0.04) 0%, transparent 60%);
}

/* ===== Skip Link ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 8px;
    background: #c4943c;
    color: #0d0c09;
    padding: 8px 16px;
    z-index: 1000;
    border-radius: 0 0 4px 4px;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* ===== Header ===== */
.site-header {
    border-bottom: 1px solid #3a3428;
    background-color: #141210;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    color: #c4943c;
    flex-shrink: 0;
}

.logo-text {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: #f0e8d4;
}

.site-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.site-nav a {
    color: #b8b09c;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: #e0d8c0;
    border-bottom-color: #c4943c;
}

/* ===== Main Layout ===== */
.main-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 32px;
}

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

/* ===== Generator Panel ===== */
.generator-panel {
    background-color: #1f1c16;
    border: 1px solid #3a3428;
    border-radius: 10px;
    padding: 28px 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.generator-panel h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f4ecd8;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.lead {
    color: #a09880;
    font-size: 1rem;
    margin-bottom: 24px;
}

/* ===== Form ===== */
.strip-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field-group {
    border: none;
}

.field-group legend {
    font-weight: 600;
    color: #c8c0a8;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.radio-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.radio-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 20px;
    border: 2px solid #3a3428;
    border-radius: 8px;
    cursor: pointer;
    background-color: #1a1814;
    transition: border-color 0.2s, background-color 0.2s;
    min-width: 120px;
}

.radio-card:hover {
    border-color: #5a4e38;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card input[type="radio"]:checked + .radio-label {
    color: #c4943c;
}

.radio-card:has(input:checked) {
    border-color: #c4943c;
    background-color: #252016;
}

.radio-label {
    font-weight: 600;
    font-size: 1rem;
    color: #d8d0b8;
}

.radio-detail {
    font-size: 0.8rem;
    color: #8a8070;
    margin-top: 2px;
}

.field-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-label {
    font-weight: 600;
    color: #c8c0a8;
    font-size: 0.9rem;
}

.field-row input[type="number"],
.field-row select {
    padding: 10px 12px;
    border: 1px solid #3a3428;
    border-radius: 6px;
    background-color: #141210;
    color: #e0dcd0;
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
    max-width: 200px;
    transition: border-color 0.2s;
}

.field-row input:focus,
.field-row select:focus {
    outline: none;
    border-color: #c4943c;
    box-shadow: 0 0 0 2px rgba(196, 148, 60, 0.2);
}

.field-hint {
    font-size: 0.8rem;
    color: #7a7260;
}

.preset-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px dashed #3a3428;
    border-bottom: 1px dashed #3a3428;
}

.preset-label {
    font-weight: 600;
    color: #a09880;
    font-size: 0.85rem;
    margin-right: 4px;
}

.preset-btn {
    padding: 6px 14px;
    border: 1px solid #4a4030;
    border-radius: 20px;
    background-color: #1a1814;
    color: #c8c0a8;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s;
}

.preset-btn:hover {
    background-color: #2a261c;
    border-color: #c4943c;
    color: #e0d8c0;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

/* ===== Buttons ===== */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #c4943c;
    color: #0d0c09;
    border-color: #c4943c;
}

.btn-primary:hover {
    background-color: #d4a44c;
}

.btn-primary:active {
    background-color: #b0842c;
}

.btn-secondary {
    background-color: #2a261c;
    color: #d8d0b8;
    border-color: #4a4030;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #3a3428;
    border-color: #6a5e48;
}

.btn-ghost {
    background-color: transparent;
    color: #a09880;
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    color: #e0d8c0;
    background-color: rgba(196, 148, 60, 0.08);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* ===== Strip Output ===== */
.strip-output {
    margin-top: 28px;
    min-height: 120px;
    border: 1px dashed #3a3428;
    border-radius: 8px;
    padding: 20px;
    background-color: #141210;
    overflow-x: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #6a6250;
    text-align: center;
    padding: 20px 0;
}

.empty-state svg {
    color: #4a4030;
}

.strip-render {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.strip-svg {
    display: block;
    max-width: 100%;
    height: auto;
}

.strip-meta {
    font-size: 0.85rem;
    color: #8a8070;
    margin-top: 8px;
}

/* ===== History ===== */
.history-panel {
    margin-top: 24px;
    border-top: 1px solid #3a3428;
    padding-top: 20px;
}

.history-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #c8c0a8;
    margin-bottom: 12px;
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.history-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #1a1814;
    border-radius: 6px;
    border: 1px solid #2a261c;
    font-size: 0.9rem;
}

.history-list button {
    background: none;
    border: none;
    color: #c4943c;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 8px;
}

.history-list button:hover {
    text-decoration: underline;
}

/* ===== Reference Sidebar ===== */
.reference-sidebar {
    background-color: #1f1c16;
    border: 1px solid #3a3428;
    border-radius: 10px;
    padding: 24px 20px;
    align-self: start;
    position: sticky;
    top: 80px;
}

.reference-sidebar h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f0e8d4;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #3a3428;
}

.ref-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.ref-list dt {
    font-weight: 600;
    color: #a09880;
    font-size: 0.8rem;
}

.ref-list dd {
    color: #d8d0b8;
    font-size: 0.85rem;
}

.tip-box {
    margin-top: 20px;
    padding: 14px;
    background-color: #141210;
    border-radius: 6px;
    border-left: 3px solid #c4943c;
}

.tip-box h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #c4943c;
    margin-bottom: 6px;
}

.tip-box p {
    font-size: 0.85rem;
    color: #b8b09c;
    line-height: 1.5;
}

@media (max-width: 860px) {
    .reference-sidebar {
        position: static;
    }
}

/* ===== Supporting Content ===== */
.supporting-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.supporting-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f0e8d4;
    margin-bottom: 24px;
}

.support-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 700px) {
    .support-columns {
        grid-template-columns: 1fr;
    }
}

.support-col h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #d8d0b8;
    margin-bottom: 10px;
}

.support-col p {
    color: #b0a890;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.support-col ul {
    list-style: disc;
    padding-left: 20px;
    color: #b0a890;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.support-col li strong {
    color: #d8d0b8;
}

/* ===== Techniques Section ===== */
.techniques-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.techniques-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f0e8d4;
    margin-bottom: 20px;
}

.comparison-table-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #2a261c;
}

.comparison-table thead th {
    background-color: #1a1814;
    color: #c4943c;
    font-weight: 700;
    font-size: 0.9rem;
}

.comparison-table tbody th {
    color: #c8c0a8;
    font-weight: 600;
    background-color: #1a1814;
}

.comparison-table tbody td {
    color: #b0a890;
}

.comparison-table tbody tr:hover td,
.comparison-table tbody tr:hover th {
    background-color: #201c16;
}

.techniques-note {
    color: #a09880;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid #3a3428;
    background-color: #141210;
    padding: 24px 20px;
    margin-top: 20px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-legal a,
.footer-ecosystem a {
    color: #a09880;
    text-decoration: none;
}

.footer-legal a:hover,
.footer-ecosystem a:hover {
    color: #c4943c;
    text-decoration: underline;
}

.footer-legal {
    font-size: 0.9rem;
    color: #8a8070;
}

.footer-ecosystem {
    font-size: 0.85rem;
    color: #6a6250;
}

.footer-version {
    font-size: 0.8rem;
    color: #5a5440;
}

/* ===== Print Styles ===== */
@media print {
    body {
        background: white;
        color: black;
    }

    .site-header,
    .site-footer,
    .reference-sidebar,
    .supporting-content,
    .techniques-section,
    .preset-bar,
    .form-actions,
    .history-panel,
    .empty-state,
    .strip-meta {
        display: none;
    }

    .main-layout {
        display: block;
        padding: 0;
        max-width: none;
    }

    .generator-panel {
        border: none;
        box-shadow: none;
        background: white;
        padding: 0;
    }

    .strip-output {
        border: none;
        background: white;
        padding: 0;
    }

    .strip-svg {
        width: auto;
        height: auto;
    }

    h1, .lead, form {
        display: none;
    }
}

/* ===== Focus & Accessibility ===== */
:focus-visible {
    outline: 2px solid #c4943c;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: light) {
    /* Light mode is intentionally unsupported for the darkroom aesthetic.
       The palette is designed for low-light editing environments. */
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
