/* ==========================================================================
   Nirmata by dEdge - design system
   Palette sampled from the dEdge identity: black, ember orange, warm bone.
   ========================================================================== */

:root {
    --ink: #08090b;
    --ink-raised: #0e1013;
    --ink-card: #12151a;
    --hairline: rgba(255, 255, 255, .09);
    --hairline-strong: rgba(255, 255, 255, .16);

    --ember: #fc7a09;
    --ember-deep: #c83f00;
    --ember-glow: rgba(252, 122, 9, .22);

    --bone: #dfded5;
    --text: #f4f5f6;
    --muted: #969ba5;
    --faint: #6b7280;

    --ok: #3ecf8e;
    --warn: #f5b74e;
    --bad: #f0574d;

    --radius: 14px;
    --radius-lg: 22px;
    --shell: 1180px;
    --ease: cubic-bezier(.22, .68, 0, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: 'Segoe UI Variable Text', 'Segoe UI', Inter, system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Two ember auroras behind everything, so the black never reads as flat. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(900px 620px at 78% -8%, rgba(252, 122, 9, .16), transparent 62%),
        radial-gradient(760px 520px at 4% 8%, rgba(200, 63, 0, .12), transparent 60%);
}

img { max-width: 100%; display: block; }
a { color: var(--ember); text-decoration: none; }
a:hover { color: #ff9a3d; }

h1, h2, h3, h4 {
    font-family: 'Segoe UI Variable Display', 'Segoe UI', Inter, system-ui, sans-serif;
    line-height: 1.12;
    letter-spacing: -.022em;
    margin: 0 0 .5em;
    font-weight: 640;
}

h1 { font-size: clamp(2.4rem, 5.6vw, 4.1rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1.05em; }

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: 26px;
}

/* --- Header --------------------------------------------------------------- */

.top {
    position: sticky;
    top: 0;
    z-index: 50;

    /* Opaque rather than frosted, because the logo below is blended against this colour. */
    background: var(--ink);
    border-bottom: 1px solid var(--hairline);
}

.top-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 0 14px;
    transition: padding .28s var(--ease);
}

.brand { display: flex; align-items: center; }

.brand img {
    height: 72px;
    width: auto;

    /* The supplied logo is white-on-black artwork on a solid black plate. Screen blending drops
       that plate to the surrounding colour and keeps the letter anti-aliasing clean, which
       keying the black out of the PNG would not. */
    mix-blend-mode: screen;
    transition: height .28s var(--ease);
}

.top nav {
    display: flex;
    gap: 26px;
    align-items: center;
    font-size: .93rem;
}

/* A stacked logo is tall, so the bar condenses once the page scrolls. */
.top.compact .top-inner { padding: 9px 0 7px; }
.top.compact .brand img { height: 40px; }

.top nav a { color: var(--muted); font-weight: 500; transition: color .18s; }
.top nav a:hover, .top nav a.active { color: var(--text); }

/* --- Buttons -------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 22px;
    border-radius: 11px;
    border: 1px solid transparent;
    font: inherit;
    font-size: .95rem;
    font-weight: 590;
    cursor: pointer;
    transition: transform .16s var(--ease), box-shadow .2s, background .2s, border-color .2s;
    white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--ember), var(--ember-deep));
    color: #fff;
    box-shadow: 0 8px 26px -10px var(--ember-glow);
}

.btn-primary:hover {
    color: #fff;
    box-shadow: 0 14px 34px -10px rgba(252, 122, 9, .45);
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(255, 255, 255, .045);
    border-color: var(--hairline-strong);
    color: var(--text);
}

.btn-ghost:hover { background: rgba(255, 255, 255, .09); color: #fff; }

.btn-sm { padding: 7px 14px; font-size: .84rem; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* --- Hero ----------------------------------------------------------------- */

.hero { padding: clamp(70px, 11vw, 132px) 0 clamp(50px, 7vw, 86px); }
.hero-grid { display: grid; gap: 54px; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: .74rem;
    font-weight: 640;
    letter-spacing: .19em;
    text-transform: uppercase;
    color: var(--ember);
    margin-bottom: 22px;
}

.eyebrow::before {
    content: '';
    width: 30px;
    height: 1px;
    background: linear-gradient(90deg, var(--ember), transparent);
}

.hero h1 .accent {
    background: linear-gradient(120deg, var(--ember) 10%, var(--ember-deep) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lede { font-size: clamp(1.03rem, 1.7vw, 1.2rem); color: var(--bone); max-width: 60ch; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }

/* Frosted blueprint panel next to the hero copy. */
.hero-panel {
    position: relative;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 30px;
    background:
        linear-gradient(160deg, rgba(252, 122, 9, .085), transparent 55%),
        var(--ink-card);
    overflow: hidden;
}

.hero-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--hairline) 1px, transparent 1px),
        linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
    background-size: 34px 34px;
    opacity: .5;
    mask-image: radial-gradient(140% 100% at 100% 0%, #000 20%, transparent 72%);
    pointer-events: none;
}

.hero-panel h3 { position: relative; font-size: 1rem; letter-spacing: .01em; }
.hero-panel ol { position: relative; margin: 0; padding-left: 20px; color: var(--muted); font-size: .94rem; }
.hero-panel ol li { margin-bottom: 12px; }
.hero-panel ol li strong { color: var(--text); font-weight: 600; }

/* --- Sections ------------------------------------------------------------- */

section { padding: clamp(52px, 7vw, 92px) 0; }
.section-head { max-width: 62ch; margin-bottom: 44px; }
.section-head p { color: var(--muted); }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--hairline), transparent); border: 0; margin: 0; }

/* --- Cards ---------------------------------------------------------------- */

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); }

.card {
    position: relative;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    background: var(--ink-card);
    padding: 28px;
    transition: transform .28s var(--ease), border-color .28s, box-shadow .28s;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent, var(--ember)), transparent);
    opacity: 0;
    transition: opacity .3s;
}

.card:hover { transform: translateY(-4px); border-color: var(--hairline-strong); box-shadow: 0 26px 60px -34px rgba(0, 0, 0, .9); }
.card:hover::before { opacity: 1; }

.card-link { display: block; color: inherit; }
.card-link:hover { color: inherit; }

.card h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.card .tagline { color: var(--bone); font-size: .97rem; margin-bottom: 20px; }

/* --- Badges --------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: .69rem;
    font-weight: 640;
    letter-spacing: .1em;
    text-transform: uppercase;
    border: 1px solid var(--hairline-strong);
    color: var(--muted);
    background: rgba(255, 255, 255, .04);
    white-space: nowrap;
}

.badge-stage { color: var(--ember); border-color: rgba(252, 122, 9, .38); background: rgba(252, 122, 9, .1); }
.badge-ok { color: var(--ok); border-color: rgba(62, 207, 142, .35); background: rgba(62, 207, 142, .1); }
.badge-warn { color: var(--warn); border-color: rgba(245, 183, 78, .35); background: rgba(245, 183, 78, .1); }
.badge-bad { color: var(--bad); border-color: rgba(240, 87, 77, .35); background: rgba(240, 87, 77, .1); }

/* --- Metrics -------------------------------------------------------------- */

.metrics { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.metric {
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 16px 18px;
    background: rgba(255, 255, 255, .022);
}

.metric .value {
    font-family: 'Segoe UI Variable Display', 'Segoe UI', Inter, system-ui, sans-serif;
    font-size: clamp(1.3rem, 2.1vw, 1.75rem);
    font-weight: 660;
    letter-spacing: -.02em;
    line-height: 1.1;
    white-space: nowrap;
    background: linear-gradient(120deg, var(--ember), var(--ember-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.metric .value .unit { font-size: .82rem; font-weight: 600; letter-spacing: 0; margin-left: 3px; }
.metric .label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .085em; margin-top: 5px; }
.metric .note { font-size: .78rem; color: var(--faint); margin-top: 7px; line-height: 1.45; }

/* --- Prose ---------------------------------------------------------------- */

.prose { color: var(--bone); max-width: 72ch; }
.prose h4 { color: var(--text); margin-top: 1.6em; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: .5em; }
.prose strong { color: var(--text); }

/* --- Gate ----------------------------------------------------------------- */

.gate {
    border: 1px dashed rgba(252, 122, 9, .42);
    border-radius: var(--radius-lg);
    padding: 32px;
    background: linear-gradient(150deg, rgba(252, 122, 9, .075), transparent 70%);
    text-align: center;
}

.gate h3 { margin-bottom: 8px; }
.gate p { color: var(--muted); max-width: 56ch; margin-inline: auto; }
.gate .btn { margin-top: 8px; }

.lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(252, 122, 9, .14);
    border: 1px solid rgba(252, 122, 9, .3);
    margin-bottom: 14px;
    font-size: 1.2rem;
}

/* --- Auth ----------------------------------------------------------------- */

.auth-wrap { min-height: calc(100vh - 74px); display: grid; place-items: center; padding: 48px 0; }

.auth-card {
    width: min(480px, 100%);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    background: var(--ink-card);
    padding: 40px;
    box-shadow: 0 40px 90px -50px #000;
}

.auth-card h1 { font-size: 1.9rem; }
.auth-card > p { color: var(--muted); font-size: .96rem; }

.provider-list { display: grid; gap: 12px; margin: 28px 0 18px; }

.provider {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--hairline-strong);
    background: rgba(255, 255, 255, .045);
    color: var(--text);
    font: inherit;
    font-weight: 560;
    cursor: pointer;
    transition: background .18s, border-color .18s, transform .16s var(--ease);
}

.provider:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .28); transform: translateY(-1px); color: #fff; }
.provider[aria-disabled='true'] { opacity: .4; cursor: not-allowed; transform: none; }
.provider svg { width: 20px; height: 20px; flex: none; }
.provider .hint { margin-left: auto; font-size: .72rem; color: var(--faint); font-weight: 500; }

.fine { font-size: .8rem; color: var(--faint); line-height: 1.6; }

/* --- Forms ---------------------------------------------------------------- */

.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.field label .req { color: var(--ember); }

input[type='text'], input[type='email'], input[type='tel'], input[type='number'], select, textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: 11px;
    border: 1px solid var(--hairline-strong);
    background: rgba(255, 255, 255, .035);
    color: var(--text);
    font: inherit;
    font-size: .95rem;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--ember);
    background: rgba(255, 255, 255, .06);
    box-shadow: 0 0 0 3px rgba(252, 122, 9, .16);
}

textarea { resize: vertical; min-height: 118px; line-height: 1.6; }
select option { background: var(--ink-raised); color: var(--text); }

.check { display: flex; gap: 11px; align-items: flex-start; font-size: .9rem; color: var(--bone); }
.check input { margin-top: 4px; accent-color: var(--ember); width: 17px; height: 17px; flex: none; }

.alert { padding: 13px 17px; border-radius: 11px; font-size: .9rem; margin-bottom: 20px; border: 1px solid; }
.alert-error { color: #ffb4ad; border-color: rgba(240, 87, 77, .4); background: rgba(240, 87, 77, .1); }
.alert-ok { color: #9beecb; border-color: rgba(62, 207, 142, .4); background: rgba(62, 207, 142, .1); }
.alert-info { color: var(--bone); border-color: var(--hairline-strong); background: rgba(255, 255, 255, .045); }

/* --- Tables (admin) ------------------------------------------------------- */

.table-wrap { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: auto; background: var(--ink-card); }

table { width: 100%; border-collapse: collapse; font-size: .89rem; }

th {
    text-align: left;
    padding: 13px 16px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--faint);
    font-weight: 640;
    border-bottom: 1px solid var(--hairline);
    white-space: nowrap;
    background: rgba(255, 255, 255, .022);
}

td { padding: 13px 16px; border-bottom: 1px solid rgba(255, 255, 255, .05); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .028); }

.mono { font-family: 'Cascadia Mono', 'Consolas', ui-monospace, monospace; font-size: .84em; }
.nowrap { white-space: nowrap; }
.dim { color: var(--muted); }
.tiny { font-size: .78rem; }

.score { display: inline-flex; align-items: baseline; gap: 3px; font-weight: 680; }
.score span { font-size: .72rem; color: var(--faint); font-weight: 500; }

/* --- Tabs ----------------------------------------------------------------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); margin-bottom: 30px; overflow-x: auto; }

.tab {
    padding: 12px 18px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font: inherit;
    font-size: .93rem;
    font-weight: 560;
    cursor: pointer;
    white-space: nowrap;
    transition: color .18s, border-color .18s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--ember); border-bottom-color: var(--ember); }
.panel[hidden] { display: none; }

/* --- Footer --------------------------------------------------------------- */

/* Opaque so the blended logo has a predictable backdrop here too. */
footer { border-top: 1px solid var(--hairline); padding: 44px 0; margin-top: 40px; background: var(--ink); }
.foot-inner { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.foot-brand { display: flex; align-items: center; gap: 14px; }
.foot-brand img { height: 58px; width: auto; mix-blend-mode: screen; }
footer .fine a { color: var(--muted); }
footer .fine a:hover { color: var(--ember); }

/* --- Utilities ------------------------------------------------------------ */

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.mt-0 { margin-top: 0; }
.mt-3 { margin-top: 26px; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.hidden { display: none !important; }

.skeleton {
    border-radius: var(--radius);
    background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .085), rgba(255, 255, 255, .04));
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
    min-height: 150px;
}

@keyframes shimmer {
    to { background-position: -200% 0; }
}

/* Cards fade up as they are inserted, which hides the fetch latency. */
.reveal { animation: reveal .55s var(--ease) both; }

@keyframes reveal {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: 38px; }
    .top nav { gap: 16px; font-size: .87rem; }
    .top nav .desk-only { display: none; }
    .brand img { height: 54px; }
    .top.compact .brand img { height: 36px; }
    .foot-brand img { height: 46px; }
    .auth-card { padding: 30px 24px; }
}
