/* =========================================================
   The Code Mill — base styles
   Dark · modern · subtle industrial accents
   ========================================================= */

:root {
    --bg:           #0d0f12;
    --bg-elev:      #13161b;
    --bg-elev-2:    #181c22;
    --line:         #262b33;
    --line-soft:    #1c2027;
    --steel:        #3a4250;
    --text:         #e6e8ec;
    --text-mute:    #9aa3b0;
    --text-dim:     #6b7280;
    --accent:       #d97706;     /* amber — forge / mill */
    --accent-soft:  #b45309;
    --accent-glow:  rgba(217, 119, 6, .14);

    --radius:       4px;
    --radius-lg:    10px;
    --maxw:         1080px;
    --mono:         'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --sans:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 24px;
}

.mono, code, .footer-mono { font-family: var(--mono); }

/* ---------- industrial accents ---------- */

.rivet-line {
    height: 1px;
    width: 100%;
    background:
        repeating-linear-gradient(
            to right,
            var(--steel) 0 6px,
            transparent 6px 14px
        );
    opacity: .35;
}

.rivet {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #5a6473, #2a2f38);
    box-shadow: inset 0 0 2px rgba(0,0,0,.6);
}

/* ---------- topbar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(13, 15, 18, .85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: .02em;
}
.mark-cog {
    color: var(--accent);
    display: inline-flex;
    transition: transform .6s ease;
}
.mark:hover .mark-cog { transform: rotate(60deg); }
.mark-name { font-size: 18px; }

.nav { display: flex; gap: 28px; }
.nav-link {
    color: var(--text-mute);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    padding: 6px 0;
    transition: color .15s;
}
.nav-link:hover { color: var(--text); }
.nav-link::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease;
}
.nav-link:hover::after { transform: scaleX(1); }

.nav-cta { margin-left: 0; }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s ease;
}
.btn-primary {
    background: var(--accent);
    color: #1a1207;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: #f59e0b;
    box-shadow: 0 0 0 4px var(--accent-glow);
}
.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}
.btn-ghost:hover {
    border-color: var(--steel);
    background: var(--bg-elev);
}

/* ---------- generic section ---------- */

.section { padding: 72px 0; border-top: 1px solid var(--line-soft); }
.section:first-child { border-top: none; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 36px;
    gap: 16px;
    flex-wrap: wrap;
}
.eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent);
}
.section-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 6px 0 0;
}

/* ---------- footer ---------- */

.footer { margin-top: 40px; }
.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding: 56px 24px 40px;
}
.footer-mark {
    font-weight: 700;
    font-size: 17px;
}
.footer-tag {
    color: var(--text-mute);
    margin: 8px 0 4px;
    font-size: 14px;
}
.footer-mono {
    color: var(--text-dim);
    font-size: 12px;
    margin: 0;
}
.footer-head {
    font-size: 12px;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--text-dim);
    margin: 0 0 14px;
    font-weight: 500;
}
.donate-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 10px;
    transition: color .15s;
}
.donate-link:hover { color: var(--accent); }
.donate-icon { font-size: 16px; }
.donate-btc .donate-icon { color: #f7931a; }
.btc-addr {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dim);
    background: var(--bg-elev);
    border: 1px solid var(--line);
    padding: 6px 8px;
    border-radius: var(--radius);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 4px;
}
.footer-link {
    display: block;
    color: var(--text-mute);
    font-size: 14px;
    margin-bottom: 10px;
    transition: color .15s;
}
.footer-link:hover { color: var(--text); }
.footer-base {
    border-top: 1px solid var(--line-soft);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
}

/* ---------- messages ---------- */

.messages {
    position: fixed;
    bottom: 20px; right: 20px;
    list-style: none;
    margin: 0; padding: 0;
    z-index: 50;
}
.message {
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    animation: slide-in .25s ease;
}
@keyframes slide-in {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
    .footer-inner { grid-template-columns: 1fr; gap: 28px; padding: 40px 24px; }
    .nav { gap: 18px; }
    .nav-cta { display: none; }
    .section { padding: 56px 0; }
}


/* =========================================================
   HOME — hero, services, process
   ========================================================= */

/* ---------- hero ---------- */

.hero {
    position: relative;
    padding: 96px 0 64px;
    overflow: hidden;
}
.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
    opacity: .6;
    pointer-events: none;
}
.hero-inner { position: relative; }
.hero-title {
    font-size: clamp(34px, 6vw, 60px);
    line-height: 1.05;
    letter-spacing: -.02em;
    font-weight: 700;
    margin: 14px 0 0;
    max-width: 16ch;
}
.hero-title .accent { color: var(--accent); }
.hero-sub {
    color: var(--text-mute);
    font-size: 18px;
    max-width: 52ch;
    margin: 22px 0 28px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 56px;
    max-width: 280px;
}
.hero-strip-line {
    flex: 1;
    height: 1px;
    background: repeating-linear-gradient(to right, var(--steel) 0 6px, transparent 6px 14px);
    opacity: .4;
}

/* ---------- section aside / cards ---------- */

.section-aside {
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .1em;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    position: relative;
    transition: border-color .2s, transform .2s;
}
.card::before {
    content: '';
    position: absolute;
    top: 14px; right: 14px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #5a6473, #2a2f38);
    box-shadow: inset 0 0 2px rgba(0,0,0,.6);
}
.card:hover {
    border-color: var(--steel);
    transform: translateY(-2px);
}
.card-icon {
    color: var(--accent);
    display: inline-flex;
    padding: 12px;
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 18px;
}
.card-title {
    font-size: 19px;
    margin: 0 0 8px;
    font-weight: 600;
}
.card-body {
    color: var(--text-mute);
    font-size: 14px;
    margin: 0 0 16px;
}
.card-tags {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.card-tags li {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dim);
    background: var(--bg-elev-2);
    border: 1px solid var(--line);
    padding: 3px 8px;
    border-radius: 3px;
}

/* ---------- process steps ---------- */

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    list-style: none;
    margin: 0; padding: 0;
    counter-reset: step;
}
.step {
    position: relative;
    padding: 24px 20px 24px 0;
    border-left: 1px solid var(--line);
    padding-left: 22px;
}
.step-num {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent);
    letter-spacing: .1em;
    display: block;
    margin-bottom: 10px;
}
.step-title {
    font-size: 17px;
    margin: 0 0 8px;
    font-weight: 600;
}
.step-body {
    color: var(--text-mute);
    font-size: 14px;
    margin: 0;
}

/* ---------- CTA band ---------- */

.cta-band { padding: 56px 0; }
.cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px;
    flex-wrap: wrap;
}
.cta-inner::before {
    content: '';
    display: block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    position: absolute;
    margin-top: -2px;
}
.cta-title {
    font-size: 22px;
    margin: 0 0 6px;
    font-weight: 700;
}
.cta-sub { color: var(--text-mute); margin: 0; }
.cta-btn { flex-shrink: 0; }

@media (max-width: 900px) {
    .cards { grid-template-columns: 1fr; }
    .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .steps { grid-template-columns: 1fr; }
    .cta-inner { flex-direction: column; align-items: flex-start; }
}


/* =========================================================
   PAGE-LEVEL (about / contact)
   ========================================================= */

.page-head {
    padding: 80px 0 40px;
    border-bottom: 1px solid var(--line-soft);
}
.page-title {
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.1;
    letter-spacing: -.02em;
    font-weight: 700;
    margin: 12px 0 0;
    max-width: 18ch;
}
.page-title .accent { color: var(--accent); }
.page-lead {
    color: var(--text-mute);
    font-size: 18px;
    max-width: 56ch;
    margin: 20px 0 0;
}

/* ---------- prose (about) ---------- */

.prose { max-width: 760px; }
.prose-h {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 36px 0 12px;
}
.prose p {
    color: var(--text-mute);
    font-size: 16px;
    margin: 0 0 16px;
}
.prose p:first-of-type { margin-top: 0; }

.principles {
    list-style: none;
    margin: 24px 0; padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.principles li {
    display: flex;
    gap: 16px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.principle-num {
    font-family: var(--mono);
    color: var(--accent);
    font-size: 13px;
    letter-spacing: .1em;
    flex-shrink: 0;
}
.principles h3 {
    font-size: 15px;
    margin: 0 0 6px;
    font-weight: 600;
}
.principles p {
    font-size: 14px;
    margin: 0;
    color: var(--text-mute);
}

.cta-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    flex-wrap: wrap;
}

/* ---------- contact form ---------- */

.contact-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    align-items: start;
}

/* Signal contact card */

.signal-card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.signal-qr {
    flex-shrink: 0;
    background: #fff;
    padding: 14px;
    border-radius: var(--radius);
    line-height: 0;
}
.signal-qr svg { width: 220px; height: 220px; display: block; }
.signal-meta { flex: 1; min-width: 200px; }
.signal-logo {
    display: inline-flex;
    color: var(--accent);
    margin-bottom: 10px;
}
.signal-handle {
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px;
    word-break: break-all;
}
.signal-note {
    color: var(--text-mute);
    font-size: 14px;
    margin: 0;
    max-width: 40ch;
}

.aside-text {
    color: var(--text-mute);
    font-size: 14px;
    margin: 0;
    line-height: 1.65;
}
.aside-text .aside-link { color: var(--accent); }

@media (max-width: 820px) {
    .contact-grid { grid-template-columns: 1fr; gap: 28px; }
    .signal-card { flex-direction: column; align-items: flex-start; gap: 24px; }
    .signal-qr svg { width: 180px; height: 180px; }
}

/* ---------- contact form (legacy, kept for reference) ---------- */
.contact-form { display: grid; gap: 18px; max-width: 560px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.field-label {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.optional { opacity: .6; text-transform: lowercase; }
.field {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 12px 14px;
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: 15px;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
.field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.field-area { resize: vertical; min-height: 140px; }

/* Honeypot — visually hidden but present in the DOM for bots to find */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}
.field-err {
    color: #f87171;
    font-size: 12px;
    font-family: var(--mono);
}
.form-submit { justify-self: start; margin-top: 4px; }

.contact-aside { display: grid; gap: 28px; }
.aside-block { display: grid; gap: 10px; }
.aside-link {
    color: var(--text);
    font-size: 14px;
    word-break: break-all;
    transition: color .15s;
}
.aside-link:hover { color: var(--accent); }

@media (max-width: 820px) {
    .contact-grid { grid-template-columns: 1fr; gap: 32px; }
    .principles { grid-template-columns: 1fr; }
}
