/* =====================================================
   Lightrion — refined technical aesthetic
   Serif display (Fraunces) + Monospaced body (JetBrains Mono)
   Light theme, high contrast, generous negative space
   ===================================================== */

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

img, svg {
    display: block;
    max-width: 100%;
}

button, input, textarea {
    font: inherit;
    color: inherit;
}

/* ------- Fonts ------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..600;1,9..144,300..400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ------- Tokens ------- */
:root {
    /* Color palette — paper + ink, single rust accent */
    --paper:        #faf8f3;     /* warm off-white */
    --paper-deep:   #f3efe5;     /* card / band backgrounds */
    --ink:          #1a1814;     /* primary text */
    --ink-soft:     #45413a;     /* secondary text */
    --ink-faint:    #8a857a;     /* meta / captions */
    --rule:         #d4cfc1;     /* hairlines */
    --accent:       #b04a2c;     /* rust / oxide — the only color */
    --accent-soft:  #f0e1d8;     /* tinted accent background */
    --code-bg:      #1a1814;     /* terminal black */
    --code-fg:      #f3efe5;     /* terminal text */

    /* Typography */
    --font-serif: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
    --font-mono:  "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

    /* Type scale (modular, ratio ~1.333) */
    --t-xs:   0.75rem;
    --t-sm:   0.875rem;
    --t-base: 1rem;
    --t-md:   1.125rem;
    --t-lg:   1.333rem;
    --t-xl:   1.777rem;
    --t-2xl:  2.369rem;
    --t-3xl:  3.157rem;
    --t-4xl:  4.209rem;
    --t-5xl:  5.61rem;

    /* Spacing */
    --s-1: 0.25rem;
    --s-2: 0.5rem;
    --s-3: 0.75rem;
    --s-4: 1rem;
    --s-5: 1.5rem;
    --s-6: 2rem;
    --s-8: 3rem;
    --s-10: 4rem;
    --s-12: 6rem;
    --s-16: 8rem;
    --s-20: 10rem;

    /* Layout */
    --content-max: 64rem;          /* 1024px */
    --content-narrow: 42rem;        /* 672px */

    /* Motion */
    --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ------- Base ------- */
html, body {
    background: var(--paper);
    color: var(--ink);
}

body {
    font-family: var(--font-mono);
    font-size: var(--t-base);
    line-height: 1.6;
    font-weight: 400;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: var(--ink);
    text-decoration-color: var(--rule);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: text-decoration-color 0.2s var(--ease), color 0.2s var(--ease);
}
a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

::selection {
    background: var(--accent);
    color: var(--paper);
}

/* ------- Layout helpers ------- */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--s-6);
}

.container-narrow {
    width: 100%;
    max-width: var(--content-narrow);
    margin: 0 auto;
    padding: 0 var(--s-6);
}

.band {
    padding-block: var(--s-12);
    border-top: 1px solid var(--rule);
}

.band--deep {
    background: var(--paper-deep);
}

.band--first {
    border-top: none;
    padding-top: var(--s-8);
}

/* ------- Typography ------- */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
}

h1 {
    font-size: clamp(2.5rem, 6vw, var(--t-5xl));
    font-variation-settings: "opsz" 144;
    margin-bottom: var(--s-5);
}

h2 {
    font-size: clamp(1.8rem, 4vw, var(--t-2xl));
    font-variation-settings: "opsz" 96;
    margin-bottom: var(--s-5);
}

h3 {
    font-size: var(--t-lg);
    font-weight: 500;
    margin-bottom: var(--s-3);
}

p, ul, ol {
    margin-bottom: var(--s-4);
    max-width: 65ch;
}

p.lead {
    font-size: var(--t-md);
    color: var(--ink-soft);
    max-width: 50ch;
}

.eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: var(--s-4);
    font-weight: 500;
}

.eyebrow::before {
    content: "— ";
    color: var(--ink-faint);
}

small, .meta {
    font-size: var(--t-sm);
    color: var(--ink-faint);
}

/* ------- Header ------- */
.site-header {
    border-bottom: 1px solid var(--rule);
    padding-block: var(--s-4);
    background: var(--paper);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
    background: rgba(250, 248, 243, 0.9);
}

.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--s-5);
}

.brand {
    font-family: var(--font-serif);
    font-size: var(--t-lg);
    font-weight: 500;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--ink);
}

.brand:hover { color: var(--accent); }

.brand sup {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: var(--ink-faint);
    margin-left: 4px;
    font-weight: 400;
    letter-spacing: 0;
}

.nav {
    display: flex;
    gap: var(--s-5);
    font-size: var(--t-sm);
}

.nav a {
    text-decoration: none;
    color: var(--ink-soft);
}
.nav a:hover {
    color: var(--accent);
}

/* ------- Hero ------- */
.hero {
    padding-block: clamp(var(--s-10), 12vw, var(--s-16)) var(--s-12);
    position: relative;
}

.hero h1 {
    margin-bottom: var(--s-6);
}

.hero h1 em {
    font-style: italic;
    color: var(--accent);
}

.hero-lead {
    font-family: var(--font-mono);
    font-size: var(--t-md);
    color: var(--ink-soft);
    max-width: 38em;
    margin-bottom: var(--s-8);
    line-height: 1.55;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-6) var(--s-8);
    margin-top: var(--s-8);
    padding-top: var(--s-5);
    border-top: 1px solid var(--rule);
    font-size: var(--t-sm);
}

.hero-meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}

.hero-meta-item .label {
    font-size: var(--t-xs);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-faint);
}

.hero-meta-item .value {
    font-family: var(--font-mono);
    font-size: var(--t-base);
    color: var(--ink);
}

/* ------- Buttons ------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-5);
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    line-height: 1;
}

.btn--primary {
    background: var(--ink);
    color: var(--paper);
}

.btn--primary:hover {
    background: var(--accent);
    color: var(--paper);
}

.btn--ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--rule);
}

.btn--ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn--lg {
    padding: var(--s-4) var(--s-6);
    font-size: var(--t-base);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    margin-top: var(--s-5);
}

/* ------- Code blocks ------- */
pre, code, kbd {
    font-family: var(--font-mono);
    font-feature-settings: "calt" 0;
}

code {
    font-size: 0.92em;
    background: var(--paper-deep);
    padding: 0.1em 0.4em;
    border: 1px solid var(--rule);
    color: var(--ink);
    white-space: nowrap;
}

pre {
    background: var(--code-bg);
    color: var(--code-fg);
    padding: var(--s-5);
    overflow-x: auto;
    font-size: var(--t-sm);
    line-height: 1.55;
    margin-block: var(--s-5);
    border-left: 3px solid var(--accent);
    position: relative;
}

pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    white-space: pre;
}

/* Terminal-style prompt for code blocks */
pre[data-prompt]::before {
    content: attr(data-prompt);
    color: var(--accent);
    font-weight: 500;
    user-select: none;
    margin-right: 0.5em;
}

/* ------- Sections ------- */
.section-head {
    margin-bottom: var(--s-8);
    max-width: var(--content-narrow);
}

.what-list {
    list-style: none;
    counter-reset: tool;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-6);
    margin-top: var(--s-8);
}

@media (min-width: 720px) {
    .what-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.what-list li {
    counter-increment: tool;
    padding: var(--s-5);
    background: var(--paper);
    border: 1px solid var(--rule);
    position: relative;
}

.what-list li::before {
    content: counter(tool, decimal-leading-zero);
    position: absolute;
    top: var(--s-3);
    right: var(--s-4);
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: var(--ink-faint);
    letter-spacing: 0.1em;
}

.what-list h3 {
    font-family: var(--font-mono);
    font-size: var(--t-base);
    font-weight: 500;
    color: var(--accent);
    margin-bottom: var(--s-3);
}

.what-list p {
    color: var(--ink-soft);
    font-size: var(--t-sm);
    line-height: 1.6;
    margin: 0;
}

/* ------- Steps (How to use) ------- */
.steps {
    list-style: none;
    counter-reset: step;
    margin-top: var(--s-6);
}

.steps > li {
    counter-increment: step;
    position: relative;
    padding-left: var(--s-12);
    padding-bottom: var(--s-8);
    border-left: 1px solid var(--rule);
    margin-left: var(--s-3);
}

.steps > li:last-child {
    border-left: 1px solid transparent;
    padding-bottom: 0;
}

.steps > li::before {
    content: counter(step);
    position: absolute;
    left: calc(-1 * var(--s-3) - 0.85em);
    top: 0;
    background: var(--ink);
    color: var(--paper);
    width: 1.7em;
    height: 1.7em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    font-weight: 500;
}

.steps h3 {
    font-family: var(--font-serif);
    font-weight: 500;
    margin-bottom: var(--s-2);
}

/* ------- Form ------- */
.form {
    margin-top: var(--s-6);
    display: grid;
    gap: var(--s-5);
    max-width: 36rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.field label {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-soft);
}

.field label .required {
    color: var(--accent);
    margin-left: 2px;
}

.field input,
.field textarea {
    background: var(--paper);
    border: 1px solid var(--rule);
    padding: var(--s-3) var(--s-4);
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    color: var(--ink);
    transition: border-color 0.2s var(--ease);
    width: 100%;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--ink);
}

.field textarea {
    resize: vertical;
    min-height: 6em;
    line-height: 1.5;
}

.field-checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--s-3);
}

.field-checkbox input[type="checkbox"] {
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.2em;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.field-checkbox label {
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    color: var(--ink-soft);
    line-height: 1.5;
}

.form-feedback {
    padding: var(--s-3) var(--s-4);
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    border-left: 3px solid;
    display: none;
}

.form-feedback.show { display: block; }
.form-feedback--success {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--ink);
}
.form-feedback--error {
    background: #fbe8e3;
    border-color: #b04a2c;
    color: var(--ink);
}

/* ------- Footer ------- */
.site-footer {
    border-top: 1px solid var(--rule);
    padding-block: var(--s-8);
    background: var(--paper);
    margin-top: var(--s-16);
    font-size: var(--t-sm);
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
}

@media (min-width: 720px) {
    .site-footer__inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.site-footer__brand {
    color: var(--ink-soft);
    max-width: 36rem;
    line-height: 1.6;
}

.site-footer__brand strong {
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--ink);
}

.site-footer__links {
    display: flex;
    gap: var(--s-5);
    flex-wrap: wrap;
}

.site-footer__links a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: var(--t-sm);
}

.site-footer__links a:hover { color: var(--accent); }

/* ------- Page-level utilities ------- */
.page {
    padding-block: var(--s-10) var(--s-12);
    max-width: var(--content-narrow);
    margin: 0 auto;
    padding-inline: var(--s-6);
}

.page h1 {
    font-size: clamp(2rem, 5vw, var(--t-3xl));
    margin-bottom: var(--s-6);
}

.page h2 {
    font-size: var(--t-xl);
    margin-top: var(--s-8);
    margin-bottom: var(--s-4);
}

.page p, .page li {
    color: var(--ink-soft);
    line-height: 1.7;
}

.page ul, .page ol {
    margin-left: var(--s-5);
    margin-bottom: var(--s-5);
}

.page li {
    margin-bottom: var(--s-2);
}

.page .meta-block {
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    color: var(--ink-faint);
    padding-bottom: var(--s-5);
    margin-bottom: var(--s-8);
    border-bottom: 1px solid var(--rule);
}

/* ------- Decorative grid line in hero ------- */
.hero::after {
    content: "";
    position: absolute;
    right: var(--s-6);
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: var(--rule);
    opacity: 0.5;
    pointer-events: none;
    display: none;
}

@media (min-width: 1100px) {
    .hero::after { display: block; }
}

/* ------- Subtle reveal animation ------- */
@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1, .hero .hero-lead, .hero .btn-row, .hero .hero-meta {
    animation: reveal 0.7s var(--ease) backwards;
}
.hero .hero-lead { animation-delay: 0.1s; }
.hero .btn-row { animation-delay: 0.2s; }
.hero .hero-meta { animation-delay: 0.3s; }

/* ------- Print-friendly ------- */
@media print {
    .site-header, .site-footer, .btn-row { display: none; }
}
