:root {
    color-scheme: light;
    --ink: #172026;
    --muted: #5f6d73;
    --line: #dce4e6;
    --paper: #f7faf9;
    --surface: #ffffff;
    --teal: #0f766e;
    --teal-dark: #0b4f4a;
    --amber: #d68a1f;
    --rose: #b6425c;
    --blue: #2563eb;
    --shadow: 0 18px 55px rgba(23, 32, 38, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
    padding: 14px clamp(18px, 4vw, 58px);
    background: rgba(247, 250, 249, 0.94);
    border-bottom: 1px solid rgba(220, 228, 230, 0.8);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
}

.main-nav {
    display: flex;
    gap: 22px;
    align-items: center;
    color: var(--muted);
    font-size: 15px;
}

.main-nav a {
    text-decoration: none;
}

.main-nav a:hover {
    color: var(--teal-dark);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px;
}

.nav-toggle span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--ink);
}

.hero-section {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: min(760px, calc(100vh - 72px));
    padding: clamp(58px, 8vw, 108px) clamp(18px, 4vw, 58px) 40px;
    background-image:
        linear-gradient(90deg, rgba(247, 250, 249, 0.98) 0%, rgba(247, 250, 249, 0.9) 38%, rgba(247, 250, 249, 0.34) 68%, rgba(247, 250, 249, 0.1) 100%),
        url("../images/sam4s-nr-330.jpg");
    background-position: center right;
    background-repeat: no-repeat;
    background-size: min(980px, 64vw) auto;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--teal);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    max-width: 840px;
    font-size: clamp(42px, 7vw, 78px);
    line-height: 0.98;
    letter-spacing: 0;
}

h2 {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: 0;
}

h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
}

.hero-lead {
    margin: 24px 0 0;
    max-width: 680px;
    color: var(--muted);
    font-size: 19px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 800;
    text-decoration: none;
}

.button.primary {
    background: var(--teal);
    color: #fff;
}

.button.secondary {
    border: 1px solid var(--line);
    background: var(--surface);
}

.process-section {
    padding: 0 clamp(18px, 4vw, 58px) 42px;
    margin-top: -18px;
    background: var(--paper);
}

.hero-visual {
    max-width: 1320px;
    margin: 0 auto;
}

.system-board {
    position: relative;
    display: grid;
    gap: 22px;
    align-content: center;
    padding: clamp(18px, 3vw, 28px);
    min-height: 340px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(15, 118, 110, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(15, 118, 110, 0.08) 1px, transparent 1px),
        #eef6f4;
    background-size: 34px 34px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.flow-row {
    position: relative;
    z-index: 2;
    display: grid;
    align-items: stretch;
    gap: 12px;
}

.submit-flow {
    grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr) 58px minmax(0, 1fr);
}

.status-flow {
    grid-template-columns: minmax(0, 1.4fr) 74px minmax(130px, 0.6fr);
    align-items: center;
    margin-top: 8px;
}

.node {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 142px;
    padding: 18px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
}

.node span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
}

.node strong {
    display: block;
    font-size: 17px;
    line-height: 1.25;
}

.node small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.server-node {
    border-color: rgba(214, 138, 31, 0.35);
}

.controller-node {
    border-color: rgba(37, 99, 235, 0.28);
}

.status-node {
    min-height: 126px;
    border-color: rgba(182, 66, 92, 0.3);
}

.flow-arrow {
    display: grid;
    place-items: center;
    align-self: center;
    min-height: 42px;
    border-radius: 8px;
    background: var(--teal);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.flow-arrow::after {
    content: "";
    width: 18px;
    height: 2px;
    margin-left: 3px;
    background: #fff;
}

.return-arrow {
    background: var(--rose);
}

.receipt-preview {
    position: relative;
    width: 100%;
    min-height: 176px;
    padding: 24px 16px 18px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(23, 32, 38, 0.18);
    text-align: center;
}

.paper-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: repeating-linear-gradient(135deg, #fff, #fff 8px, #edf2f2 8px, #edf2f2 16px);
}

.receipt-preview p {
    margin: 0 0 6px;
    font-weight: 900;
}

.receipt-preview small {
    color: var(--muted);
}

.receipt-preview div {
    height: 8px;
    margin-top: 14px;
    border-radius: 3px;
    background: #dce4e6;
}

.metrics-section {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 0 clamp(18px, 4vw, 58px);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--line);
}

.metrics-section div {
    padding: 22px;
    background: var(--surface);
}

.metrics-section strong {
    display: block;
    font-size: 28px;
}

.metrics-section span {
    color: var(--muted);
}

.section {
    padding: clamp(62px, 9vw, 112px) clamp(18px, 4vw, 58px);
}

.section-heading {
    max-width: 790px;
    margin-bottom: 34px;
}

.app-preview {
    display: grid;
    grid-template-columns: minmax(320px, 0.72fr) minmax(260px, 0.28fr);
    gap: 22px;
    align-items: center;
    margin: 0 0 28px;
}

.app-preview-frame {
    max-height: 520px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef3f1;
    box-shadow: var(--shadow);
}

.app-preview img {
    display: block;
    width: 100%;
    height: auto;
    margin: -1px 0 -1px;
}

.app-preview figcaption {
    color: var(--muted);
    font-size: 17px;
}

.section-heading p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 18px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.feature-card {
    min-height: 245px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.feature-card span {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--rose);
    font-size: 13px;
    font-weight: 800;
}

.feature-card p,
.job-detail p,
.timeline p {
    color: var(--muted);
}

.split-section {
    background: #eef3f1;
}

.job-browser {
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
    gap: 18px;
}

.job-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.job-tab,
.endpoint-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.job-tab {
    min-height: 52px;
    padding: 12px;
    font-weight: 800;
}

.job-tab.active,
.endpoint-button.active {
    border-color: var(--teal);
    background: #dff1ee;
    color: var(--teal-dark);
}

.job-detail {
    min-height: 320px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.job-detail h3 {
    margin-bottom: 12px;
    font-size: 34px;
}

.job-api {
    display: grid;
    gap: 14px;
    margin: 22px 0 0;
}

.job-api div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf9;
}

.job-api dt {
    margin-bottom: 6px;
    color: var(--teal-dark);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.job-api dd {
    margin: 0;
}

.job-api code {
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.integration-section {
    background: var(--ink);
    color: #f8fbfa;
}

.integration-section .section-heading p:last-child,
.integration-section .eyebrow {
    color: #b7d9d4;
}

.code-layout {
    display: grid;
    grid-template-columns: minmax(260px, 370px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.endpoint-list {
    display: grid;
    gap: 10px;
}

.endpoint-button {
    min-height: 66px;
    padding: 14px 16px;
}

.endpoint-button span {
    display: inline-flex;
    min-width: 48px;
    color: var(--rose);
    font-weight: 900;
}

.code-panel {
    margin: 0;
    min-height: 270px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: #0b1114;
    color: #d7f7ef;
    overflow: auto;
    white-space: pre-wrap;
}

.code-panel code {
    font-family: Consolas, Monaco, monospace;
    font-size: 15px;
}

.rules-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
    gap: 24px;
}

.rule-list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: rules;
}

.rule-list li {
    counter-increment: rules;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.rule-list li::before {
    content: counter(rules);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--amber);
    color: #fff;
    font-weight: 900;
}

.timeline {
    border-left: 2px solid var(--line);
}

.timeline article {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 16px;
    padding: 0 0 26px 22px;
}

.timeline article > span {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: var(--teal);
    color: #fff;
    font-weight: 900;
}

.timeline h3 {
    margin-bottom: 6px;
}

.timeline p {
    margin: 0;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 28px clamp(18px, 4vw, 58px);
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.contact-section {
    padding-top: 0;
}

.contact-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
    gap: 24px;
    align-items: center;
    padding: clamp(26px, 5vw, 44px);
    border-radius: 8px;
    background: var(--teal-dark);
    color: #fff;
}

.contact-panel .eyebrow,
.contact-panel p {
    color: #c7ebe5;
}

.contact-panel p {
    max-width: 650px;
    margin-bottom: 0;
}

.contact-card {
    display: grid;
    gap: 8px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    font-style: normal;
}

.contact-card strong {
    font-size: 24px;
}

.contact-card span,
.contact-card a {
    color: #e7fffb;
}

.contact-card a {
    text-decoration: none;
}

.contact-card a:hover {
    text-decoration: underline;
}

.site-footer p {
    margin: 0;
}

@media (max-width: 1120px) {
    .job-browser,
    .code-layout,
    .rules-layout {
        grid-template-columns: 1fr;
    }

    .hero-section {
        min-height: 640px;
        padding-top: 42px;
        background-size: min(740px, 92vw) auto;
        background-position: center bottom 20px;
        align-items: flex-start;
    }

    .hero-section::after {
        content: "";
        position: absolute;
        inset: auto 0 0;
        z-index: -1;
        height: 45%;
        background: linear-gradient(180deg, rgba(247, 250, 249, 0), var(--paper));
    }

    .system-board {
        min-height: 0;
    }

    .submit-flow,
    .status-flow {
        grid-template-columns: 1fr;
    }

    .flow-arrow {
        justify-self: center;
        width: min(100%, 180px);
    }

    .flow-arrow::after {
        display: none;
    }

    .app-preview {
        grid-template-columns: 1fr;
    }

    .contact-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .feature-grid,
    .metrics-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .main-nav {
        position: absolute;
        top: 72px;
        left: 18px;
        right: 18px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        box-shadow: var(--shadow);
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a {
        padding: 14px 16px;
        border-bottom: 1px solid var(--line);
    }

    .main-nav a:last-child {
        border-bottom: 0;
    }

    .nav-toggle {
        display: block;
    }

    .hero-section {
        padding-left: 16px;
        padding-right: 16px;
        min-height: 690px;
        background-size: 620px auto;
        background-position: center bottom 26px;
    }

    .feature-grid,
    .metrics-section,
    .job-tabs {
        grid-template-columns: 1fr;
    }

    .metrics-section {
        margin-left: 16px;
        margin-right: 16px;
    }

    .site-footer {
        flex-direction: column;
    }
}
