:root {
    --bg: #f7f2e7;
    --ink: #151514;
    --muted: #63615b;
    --line: #24221d;
    --panel: #fff9e8;
    --accent: #e6402c;
    --accent-dark: #9b251b;
    --blue: #236d95;
    --green: #527c31;
    --yellow: #f5c842;
    --cyan: #20a6b8;
    --pink: #e7699d;
    --shadow: 8px 8px 0 rgba(21, 21, 20, 0.15);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 18px 18px, rgba(21, 21, 20, 0.1) 1.2px, transparent 1.4px),
        linear-gradient(90deg, rgba(21, 21, 20, 0.045) 1px, transparent 1px),
        linear-gradient(0deg, rgba(21, 21, 20, 0.045) 1px, transparent 1px),
        var(--bg);
    background-size: 36px 36px, 36px 36px, 36px 36px, auto;
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration-color: rgba(180, 54, 45, 0.45);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--accent-dark);
}

.wrap {
    width: min(1120px, calc(100% - 32px));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -48px;
    z-index: 20;
    padding: 8px 12px;
    background: var(--ink);
    color: #fff;
}

.skip-link:focus {
    top: 16px;
}

.site-header {
    border-bottom: 2px solid var(--line);
    background: rgba(247, 242, 231, 0.92);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
}

.nav-wrap {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

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

.brand-mark {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    width: 48px;
    height: 48px;
    border: 2px solid var(--ink);
    color: var(--ink);
    font-weight: 800;
    letter-spacing: 0;
    background:
        linear-gradient(135deg, var(--yellow) 0 50%, var(--cyan) 50% 100%);
    box-shadow: 4px 4px 0 var(--ink);
    transform: rotate(-4deg);
}

.brand-mark span {
    display: grid;
    place-items: center;
    line-height: 1;
}

.brand-mark span + span {
    border-left: 2px solid var(--ink);
}

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

.brand strong {
    font-size: 1rem;
}

.brand small {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.site-nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.92rem;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    background: var(--yellow);
    box-shadow: 2px 2px 0 var(--ink);
    color: var(--ink);
}

.hero {
    padding: 78px 0 48px;
    border-bottom: 1px solid var(--line);
}

.hero-image {
    min-height: clamp(500px, 72svh, 680px);
    display: flex;
    align-items: end;
    position: relative;
    isolation: isolate;
    background-image:
        linear-gradient(90deg, rgba(6, 10, 14, 0.9) 0%, rgba(6, 10, 14, 0.72) 38%, rgba(6, 10, 14, 0.12) 76%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 7px),
        url("../images/atomic-workbench-hero.png");
    background-position: center;
    background-size: cover;
    color: #fff;
    border-bottom: 0;
}

.hero-image::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 18px;
    background: repeating-linear-gradient(90deg, var(--yellow) 0 16px, var(--ink) 16px 22px, var(--cyan) 22px 38px, var(--accent) 38px 48px);
    z-index: 0;
}

.hero-image .eyebrow {
    color: #f3c64f;
}

.hero-image .lede,
.hero-image .hero-panel p {
    color: rgba(255, 255, 255, 0.82);
}

.hero-image .button {
    border-color: #fff;
    background: #fff;
    color: #111416;
}

.hero-image .button.secondary {
    background: transparent;
    color: #fff;
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 48px;
    align-items: end;
    position: relative;
    z-index: 1;
}

.frequency-strip {
    width: min(360px, 75vw);
    height: 52px;
    display: flex;
    align-items: end;
    gap: 6px;
    margin-bottom: 18px;
}

.frequency-strip span {
    width: 18px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-bottom: 0;
    background: var(--yellow);
    box-shadow: 0 0 18px rgba(245, 200, 66, 0.3);
}

.frequency-strip span:nth-child(1) { height: 18px; background: var(--cyan); }
.frequency-strip span:nth-child(2) { height: 34px; }
.frequency-strip span:nth-child(3) { height: 25px; background: var(--accent); }
.frequency-strip span:nth-child(4) { height: 46px; }
.frequency-strip span:nth-child(5) { height: 16px; background: var(--pink); }
.frequency-strip span:nth-child(6) { height: 39px; background: var(--cyan); }
.frequency-strip span:nth-child(7) { height: 28px; }
.frequency-strip span:nth-child(8) { height: 50px; background: var(--accent); }
.frequency-strip span:nth-child(9) { height: 20px; background: var(--cyan); }
.frequency-strip span:nth-child(10) { height: 42px; }
.frequency-strip span:nth-child(11) { height: 31px; background: var(--pink); }
.frequency-strip span:nth-child(12) { height: 24px; }

.hero-copy {
    padding-bottom: 18px;
}

.eyebrow,
.kicker {
    margin: 0 0 12px;
    color: var(--accent-dark);
    font-weight: 750;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    line-height: 1.1;
    margin: 0;
}

h1 {
    font-size: clamp(2.4rem, 6vw, 5.4rem);
    max-width: 920px;
}

h2 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
}

h3 {
    font-size: 1.2rem;
}

.lede {
    color: #33363a;
    font-size: clamp(1.08rem, 1.8vw, 1.35rem);
    max-width: 760px;
    margin: 22px 0 0;
}

.hero-panel {
    border-left: 4px solid var(--accent);
    padding: 4px 0 4px 22px;
}

.hero-image .hero-panel {
    border-color: #f3c64f;
    position: relative;
}

.hero-image .hero-panel::before {
    content: "field note";
    position: absolute;
    top: -32px;
    left: 18px;
    padding: 3px 9px;
    border: 2px solid #fff;
    color: #111416;
    background: var(--pink);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transform: rotate(3deg);
}

.hero-panel p {
    margin: 0 0 16px;
    color: var(--muted);
}

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

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 4px 4px 0 rgba(21, 21, 20, 0.28);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0 rgba(21, 21, 20, 0.3);
}

.button.secondary {
    background: transparent;
    color: var(--ink);
}

.section {
    padding: 54px 0;
    position: relative;
}

.section + .section {
    border-top: 2px solid var(--line);
}

.section-lab {
    background:
        linear-gradient(135deg, rgba(32, 166, 184, 0.11) 0 25%, transparent 25% 50%, rgba(230, 64, 44, 0.08) 50% 75%, transparent 75%),
        rgba(255, 249, 232, 0.45);
    background-size: 42px 42px;
}

.section-wave {
    background:
        radial-gradient(circle at 12% 20%, rgba(245, 200, 66, 0.3), transparent 22%),
        linear-gradient(90deg, rgba(35, 109, 149, 0.09), rgba(231, 105, 157, 0.12));
}

.section-projects {
    background:
        repeating-linear-gradient(-3deg, rgba(21, 21, 20, 0.055) 0 2px, transparent 2px 16px),
        rgba(247, 242, 231, 0.7);
}

.section-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    margin-bottom: 24px;
}

.section-header p {
    max-width: 560px;
    margin: 8px 0 0;
    color: var(--muted);
}

.text-link {
    font-weight: 750;
    white-space: nowrap;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.empty-state {
    max-width: 620px;
    margin: 0;
    padding: 22px;
    border: 2px dashed var(--line);
    border-radius: 8px;
    background: rgba(255, 249, 232, 0.82);
    color: var(--muted);
    box-shadow: 6px 6px 0 rgba(21, 21, 20, 0.1);
}

.card {
    position: relative;
    overflow: hidden;
    min-height: 235px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 22px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
    transform: rotate(var(--tilt, 0deg));
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.card:hover {
    transform: rotate(0deg) translate(-2px, -2px);
    box-shadow: 12px 12px 0 rgba(21, 21, 20, 0.18);
}

.card:nth-child(3n + 1) {
    --tilt: -0.7deg;
}

.card:nth-child(3n + 2) {
    --tilt: 0.8deg;
}

.card:nth-child(3n) {
    --tilt: -0.2deg;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 9px;
    background: var(--tone, var(--accent));
}

.card-tone-0 { --tone: var(--accent); }
.card-tone-1 { --tone: var(--cyan); }
.card-tone-2 { --tone: var(--yellow); }
.card-tone-3 { --tone: var(--green); }
.card-tone-4 { --tone: var(--pink); }

.card-signal {
    position: absolute;
    right: 14px;
    top: 18px;
    width: 52px;
    height: 28px;
    opacity: 0.22;
    background:
        linear-gradient(var(--ink), var(--ink)) 0 75% / 7px 25% no-repeat,
        linear-gradient(var(--ink), var(--ink)) 15px 45% / 7px 55% no-repeat,
        linear-gradient(var(--ink), var(--ink)) 30px 15% / 7px 85% no-repeat,
        linear-gradient(var(--ink), var(--ink)) 45px 60% / 7px 40% no-repeat;
}

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

.card p {
    margin: 0;
    color: var(--muted);
}

.card .status {
    color: var(--blue);
    font-weight: 750;
}

.note-list {
    display: grid;
    gap: 18px;
    max-width: 880px;
}

.note-card {
    position: relative;
    padding: 24px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(245, 200, 66, 0.28), transparent 34%),
        var(--panel);
    box-shadow: var(--shadow);
}

.note-card::before {
    content: "";
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 2px solid var(--line);
    border-radius: 50%;
    background:
        radial-gradient(circle, var(--accent) 0 4px, transparent 5px),
        conic-gradient(from 20deg, var(--yellow), var(--cyan), var(--pink), var(--yellow));
    opacity: 0.8;
}

.note-card h2 {
    max-width: 720px;
    margin-top: 8px;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.note-card h2 a {
    text-decoration: none;
}

.note-card p {
    max-width: 680px;
    margin: 12px 0 0;
    color: var(--muted);
}

.note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.note-meta span,
.note-meta time {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.46);
}

.note-article {
    padding: 30px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 249, 232, 0.92);
    box-shadow: var(--shadow);
}

.note-article .note-meta {
    margin-bottom: 24px;
}

.note-article h2 {
    margin-top: 34px;
    font-size: clamp(1.45rem, 2.2vw, 2rem);
}

.note-article p {
    font-size: 1.05rem;
}

.tool-gallery {
    max-width: 960px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.gallery-item {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    cursor: zoom-in;
    font: inherit;
    text-align: left;
    box-shadow: var(--shadow);
    transform: rotate(-0.5deg);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.gallery-item:nth-child(even) {
    transform: rotate(0.5deg);
}

.gallery-item:hover,
.gallery-item:focus-visible {
    transform: rotate(0deg) translate(-2px, -2px);
    box-shadow: 12px 12px 0 rgba(21, 21, 20, 0.18);
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 2px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.gallery-item span {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 750;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(10, 10, 10, 0.82);
}

.gallery-modal[hidden] {
    display: none;
}

.gallery-modal figure {
    width: min(1080px, 100%);
    margin: 0;
}

.gallery-modal img {
    display: block;
    width: 100%;
    max-height: 78svh;
    object-fit: contain;
    border: 3px solid #fff;
    border-radius: 8px;
    background: #fff;
}

.gallery-modal figcaption {
    margin-top: 12px;
    color: #fff;
    font-weight: 750;
    text-align: center;
}

.gallery-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
}

.modal-open {
    overflow: hidden;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0;
    margin: auto 0 0;
    list-style: none;
}

.tag-list li {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 9px;
    color: #343431;
    background: rgba(245, 200, 66, 0.22);
    font-size: 0.78rem;
    line-height: 1.2;
}

.tag-list-large {
    margin-top: 24px;
}

.page-hero {
    padding: 58px 0 38px;
    border-bottom: 2px solid var(--line);
    background:
        radial-gradient(circle at 12% 16%, rgba(230, 64, 44, 0.16), transparent 18%),
        radial-gradient(circle at 82% 8%, rgba(32, 166, 184, 0.18), transparent 18%),
        rgba(255, 249, 232, 0.65);
}

.maintenance-page {
    min-height: 100svh;
    display: grid;
    align-items: center;
}

.maintenance-page .page-hero {
    border-block: 2px solid var(--line);
}

.detail-hero {
    padding-bottom: 50px;
}

.prose {
    max-width: 760px;
}

.prose p,
.prose li {
    color: #3d4045;
}

.prose ul {
    padding-left: 1.2rem;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 36px;
}

.note-block {
    border-left: 4px solid var(--green);
    padding-left: 18px;
    color: var(--muted);
    font-size: 1.05rem;
}

.contact-form {
    display: grid;
    gap: 18px;
    max-width: 680px;
    padding: 24px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(245, 200, 66, 0.22), transparent 44%),
        var(--panel);
    box-shadow: var(--shadow);
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field label {
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.form-field input,
.form-field textarea {
    width: 100%;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: #fffef8;
    color: var(--ink);
    font: inherit;
    padding: 11px 12px;
}

.form-field textarea {
    resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: 3px solid rgba(32, 166, 184, 0.35);
    outline-offset: 2px;
}

.field-error {
    margin: 0;
    color: var(--accent-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.field-honey {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-alert {
    max-width: 680px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 2px solid var(--line);
    border-radius: 8px;
    box-shadow: 5px 5px 0 rgba(21, 21, 20, 0.12);
}

.form-alert p {
    margin: 4px 0 0;
    color: var(--muted);
}

.form-alert.success {
    background: rgba(82, 124, 49, 0.16);
}

.form-alert.error {
    background: rgba(230, 64, 44, 0.16);
}

.site-footer {
    border-top: 2px solid var(--line);
    padding: 34px 0;
    background:
        repeating-linear-gradient(90deg, rgba(21, 21, 20, 0.08) 0 1px, transparent 1px 20px),
        #eee2c8;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.site-footer p {
    margin: 6px 0 0;
    color: var(--muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
}

@media (max-width: 860px) {
    .nav-wrap,
    .footer-grid,
    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .hero-content,
    .split {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .note-card::before {
        display: none;
    }
}

@media (max-width: 620px) {
    .wrap {
        width: min(100% - 22px, 1120px);
    }

    .hero {
        padding-top: 46px;
    }

    .brand {
        min-width: 0;
    }

    .site-nav a {
        padding-inline: 8px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .note-article,
    .note-card {
        padding: 20px;
    }
}
