/* Absurd Industries — shared kraft design system
   Custom CSS only for what Tailwind can't express: feTurbulence torn
   edges, backdrop-filter menu band, marquee/showcase keyframes, and
   long-form prose (.legal). Utility styling lives in the markup. */

html,
body {
    overflow-x: hidden;
}

body {
    background-color: #d4b896;
    background-image: url("/hardware-devroom/images/kraft-paper.jpg");
    background-repeat: repeat;
    background-size: auto;
}

/* ── torn-paper cards (feTurbulence displacement) ── */
.torn-card {
    position: relative;
}

.torn-card > .torn-bg {
    position: absolute;
    inset: 0;
    background: #faf3e8;
    filter: url(#torn-edge-filter);
    z-index: 0;
}

.torn-card > .torn-bg-kraft {
    position: absolute;
    inset: 0;
    background: #e8d5b7;
    filter: url(#torn-edge-filter);
    z-index: 0;
}

.torn-card > .torn-bg-ink {
    position: absolute;
    inset: 0;
    background: #1a1a1a;
    filter: url(#torn-edge-filter);
    z-index: 0;
}

.torn-card > .torn-content {
    position: relative;
    z-index: 1;
}

.torn-grid > .torn-card:nth-child(3n + 2) > .torn-bg,
.torn-grid > .torn-card:nth-child(3n + 2) > .torn-bg-kraft,
.torn-grid > .torn-card:nth-child(3n + 2) > .torn-bg-ink {
    filter: url(#torn-edge-filter-2);
}

.torn-grid > .torn-card:nth-child(3n + 3) > .torn-bg,
.torn-grid > .torn-card:nth-child(3n + 3) > .torn-bg-kraft,
.torn-grid > .torn-card:nth-child(3n + 3) > .torn-bg-ink {
    filter: url(#torn-edge-filter-3);
}

.torn-divider {
    height: 10px;
    margin: 0 auto;
    max-width: 80%;
    background: #b8956a;
    filter: url(#torn-edge-filter);
    opacity: 0.5;
}

.tape-piece {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 32px;
    background-image: url("/hardware-devroom/images/paper-tape.webp");
    background-size: cover;
    background-position: center;
    z-index: 2;
    opacity: 0.9;
}

/* ── stamps + labels ── */
.stamp-label {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border: 2px solid #1a1a1a;
    color: #1a1a1a;
    font-family: "Space Mono", monospace;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: "Space Mono", monospace;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    padding: 0.35rem 0.75rem;
    background: #faf3e8;
}

.stat-chip i {
    color: #ff5900;
}

.postal-stamp {
    width: 104px;
    height: 104px;
    border: 3px solid #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0.4;
    outline: 2px solid #1a1a1a;
    outline-offset: 4px;
    font-family: "Space Mono", monospace;
    font-weight: 700;
    font-size: 0.58rem;
    text-transform: uppercase;
    color: #1a1a1a;
    letter-spacing: 0.1em;
    text-align: center;
    line-height: 1.3;
}

/* ── shipping-label buttons ── */
.label-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #faf3e8;
    border: 2px dashed #1a1a1a;
    padding: 0.85rem 1.5rem 0.85rem 2.75rem;
    font-family: "Space Mono", monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    color: #1a1a1a;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.label-btn::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid #1a1a1a;
    border-radius: 50%;
}

.label-btn:hover {
    transform: translateY(-3px);
    box-shadow: 3px 5px 0 rgba(0, 0, 0, 0.12);
}

.label-btn-primary {
    background: #1a1a1a;
    color: #faf3e8;
    border-color: #1a1a1a;
    border-style: solid;
}

.label-btn-primary::before {
    border-color: #faf3e8;
}

.label-btn-stamp {
    background: #ff5900;
    color: #faf3e8;
    border-color: #ff5900;
    border-style: solid;
}

.label-btn-stamp::before {
    border-color: #faf3e8;
}

.label-btn-big {
    padding: 1.1rem 2rem 1.1rem 3.25rem;
    font-size: 1.05rem;
}

.label-btn-big::before {
    left: 18px;
    width: 16px;
    height: 16px;
}

/* ── lift on hover ── */
.lift {
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.lift:hover {
    transform: translateY(-3px);
    box-shadow: 3px 5px 0 rgba(0, 0, 0, 0.1);
}

.checklist-item {
    border-left: 4px solid #ff5900;
}

/* ── header: big slanted corner logo + darkish-brown menu band in the right corner (NOT fixed) ── */
.site-header {
    position: relative;
    z-index: 30;
}

/* full-width strip: logo pops over its left at an angle, nav rides the right */
.menu-band {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 3.6rem;
    padding: 0.4rem 0.8rem 0.4rem 10rem;
    background: rgba(184, 149, 106, 0.55);
    border: 1px solid rgba(26, 26, 26, 0.12);
    border-radius: 99rem;
    backdrop-filter: saturate(1.2) blur(6px);
    -webkit-backdrop-filter: saturate(1.2) blur(6px);
    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.1);
}

.site-logo {
    position: absolute;
    left: 0.8rem;
    top: 28%;
    transform: translateY(-50%) rotate(-25deg);
    transform-origin: center;
    z-index: 40;
    display: block;
    line-height: 0;
}

.site-logo img {
    width: 250px;
    height: auto;
    filter: drop-shadow(2px 5px 7px rgba(26, 26, 26, 0.3));
}

@media (max-width: 767px) {
    .menu-band {
        min-height: 3rem;
        padding-left: 6.75rem;
    }
    .site-logo {
        left: 0.4rem;
        transform: translateY(-50%) rotate(-11deg);
    }
    .site-logo img {
        margin-top: 1em;
        margin-left: -0.5em;
        width: 164px;
        transform: rotate(-23deg);
    }
}

.top-nav a {
    font-family: "DM Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a1a;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    position: relative;
    transition: background 0.15s;
}

/* hover = orange line drawn under the link (text stays ink), undrawn on leave */
.top-nav a:not(.nav-discord)::after {
    content: "";
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.2rem;
    height: 2px;
    background: #ff5900;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s ease;
}

.top-nav a:not(.nav-discord):hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.top-nav a.nav-discord {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.4rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    background: #ff5900;
    color: #faf3e8;
    transition:
        background 0.15s,
        transform 0.15s;
}

.top-nav a.nav-discord:hover {
    background: #cc4700;
    color: #faf3e8;
    transform: translateY(-1px);
}

.nav-discord-mobile {
    font-family: "DM Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    margin-right: 0.1rem;
}

/* ── mobile bottom bar ── */
.mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    z-index: 50;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.mobile-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    color: #faf3e8;
    text-decoration: none;
    font-family: "Space Mono", monospace;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.15s;
}

.mobile-bar a:hover,
.mobile-bar a:active {
    color: #ff5900;
}

.mobile-bar a i {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.copyleft {
    display: inline-block;
    transform: rotate(180deg);
}

/* ── footer (ooru-style: light kraft band, icon links) ── */
.footer-wrap {
    background: rgba(184, 149, 106, 0.35);
    padding: 2.5rem 0 0;
    border-top: 1px solid rgba(26, 26, 26, 0.06);
    margin-top: 2rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 480px) {
    .footer-links {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }
    .footer-links .footer-col:last-child {
        grid-column: span 2;
    }
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.footer-heading {
    font-family: "Space Mono", monospace;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #4a3d2f;
    margin-bottom: 0.35rem;
}

.footer-col a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    padding: 0.3rem 0;
}

/* hover = orange line drawn under just the text label (not the icon or click area) */
.footer-col a span {
    position: relative;
}

.footer-col a span::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: #ff5900;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s ease;
}

.footer-col a:hover span::after {
    transform: scaleX(1);
    transform-origin: left;
}

.footer-col a i {
    font-size: 1.15rem;
    color: #4a3d2f;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.footer-bottom {
    border-top: 1px solid rgba(26, 26, 26, 0.08);
    margin-top: 1rem;
    padding: 1rem 0;
    text-align: center;
}

@media (max-width: 767px) {
    body {
        padding-bottom: 80px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .friends-marquee {
        animation: none;
    }

    .top-nav a:not(.nav-discord)::after,
    .footer-col a span::after,
    .legal a {
        transition: none;
    }
}

/* ── community emblem (à la ooru) ── */
.tools-emblem {
    position: absolute;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.cta-emblem {
    width: 330px;
    right: -30px;
    top: 50%;
    transform: translateY(-50%) rotate(30deg);
    opacity: 0.16;
}

/* ── video gallery + lightbox ── */
.video-card {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

/* scattered "cards on a table" layout */
.video-scatter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 1rem 0 2rem;
}

.video-scatter .video-card {
    width: clamp(180px, 26vw, 280px);
    max-width: 92vw;
    margin: 6px;
    position: relative;
    z-index: 1;
    transform: rotate(var(--rot, 0deg)) translateY(var(--ty, 0px));
    transition:
        transform 0.25s ease,
        filter 0.25s ease;
    filter: drop-shadow(2px 4px 7px rgba(26, 26, 26, 0.18));
}

.video-scatter .video-card:hover,
.video-scatter .video-card:focus-visible {
    transform: rotate(0deg) translateY(-8px) scale(1.07);
    z-index: 30;
    filter: drop-shadow(3px 8px 14px rgba(26, 26, 26, 0.3));
}

.video-scatter .p-4 {
    display: none;
}

/* ── buttons (ooru-style) ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.6rem;
    font-family: "DM Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    border-radius: 0.625rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-stamp {
    background: #ff5900;
    color: #faf3e8;
}

.btn-stamp:hover {
    box-shadow: 0 4px 12px rgba(255, 89, 0, 0.25);
}

/* ── friends marquee (à la ooru) ── */
.friends-marquee-wrapper {
    overflow: hidden;
    width: 100%;
    max-width: 64rem;
    margin-inline: auto;
    mask-image: linear-gradient(
        to right,
        transparent,
        black 5%,
        black 95%,
        transparent
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent,
        black 5%,
        black 95%,
        transparent
    );
}

.friends-marquee {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: marquee-scroll 25s linear infinite;
}

.friends-marquee:hover {
    animation-play-state: paused;
}

.friend-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.friend-item:hover {
    opacity: 1;
}

.friend-item img {
    border-radius: 6px;
}

@keyframes marquee-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* footer logo — slanted like the internal pages, no wordmark */
.footer-logo {
    display: inline-block;
    line-height: 0;
}

.footer-logo img {
    width: 204px;
    height: auto;
    transform: rotate(-14deg);
    filter: drop-shadow(2px 4px 6px rgba(26, 26, 26, 0.22));
}

.video-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(26, 26, 26, 0.88);
    padding: 1rem;
}

.video-modal.open {
    display: flex;
}

.video-modal-inner {
    position: relative;
    width: min(92vw, 920px);
}

.video-modal-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 3px solid #faf3e8;
}

.video-modal-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-modal-close {
    position: absolute;
    top: -2.8rem;
    right: 0;
    background: none;
    border: none;
    color: #faf3e8;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    font-family: "Space Mono", monospace;
}

/* ===== long-form (legal / product) prose ===== */
.legal h2 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 900;
    font-size: 1.6rem;
    line-height: 1.15;
    margin: 2rem 0 0.6rem;
    color: #1a1a1a;
}
.legal h3 {
    font-family: "DM Sans", system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    margin: 1.25rem 0 0.35rem;
    color: #1a1a1a;
}

.legal h4 {
    font-family: "DM Sans", system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    margin: 1.1rem 0 0.3rem;
    color: #1a1a1a;
}

.legal ol {
    list-style: decimal;
    padding-left: 1.4rem;
    margin: 0.5rem 0;
}

.legal ol li {
    margin: 0.35rem 0;
    line-height: 1.6;
    color: #3d3d3d;
}

.legal address {
    font-style: normal;
    line-height: 1.7;
    color: #3d3d3d;
    margin: 0.6rem 0;
}

.legal iframe {
    width: 100%;
    border: 2px solid #1a1a1a;
    margin-top: 1rem;
}

.legal p {
    margin: 0.6rem 0;
    line-height: 1.7;
    color: #3d3d3d;
}

.legal ul {
    list-style: disc;
    padding-left: 1.3rem;
    margin: 0.6rem 0;
}

.legal li {
    margin: 0.45rem 0;
    line-height: 1.6;
    color: #3d3d3d;
}

/* inline links: orange line drawn under on hover (retracts on leave); handles line wraps */
.legal a {
    color: #1a1a1a;
    text-decoration: none;
    background-image: linear-gradient(#ff5900, #ff5900);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 2px;
    padding-bottom: 1px;
    transition: background-size 0.25s ease;
}

.legal a:hover {
    background-size: 100% 2px;
}

.legal strong {
    color: #1a1a1a;
}

.legal hr {
    border: none;
    border-top: 1px dashed rgba(26, 26, 26, 0.25);
    margin: 2.25rem 0;
}

/* Topic cards */
.topic-card {
    transition: transform 0.15s ease;
}

.topic-card:hover {
    transform: translateY(-2px);
}

/* Postal stamp */
.postal-stamp {
    width: 110px;
    height: 110px;
    border: 3px solid #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0.35;
    outline: 2px solid #1a1a1a;
    outline-offset: 4px;
    font-family: "Space Mono", monospace;
    font-weight: 700;
    font-size: 0.6rem;
    text-transform: uppercase;
    color: #1a1a1a;
    letter-spacing: 0.1em;
    text-align: center;
    line-height: 1.3;
}

/* Hardware showcase rotation */
.hardware-showcase {
    position: relative;
    height: 280px;
}

.showcase-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: showcase-fade 15s infinite;
}

.showcase-item:nth-child(1) {
    animation-delay: 0s;
}

.showcase-item:nth-child(2) {
    animation-delay: 3s;
}

.showcase-item:nth-child(3) {
    animation-delay: 6s;
}

.showcase-item:nth-child(4) {
    animation-delay: 9s;
}

.showcase-item:nth-child(5) {
    animation-delay: 12s;
}

@keyframes showcase-fade {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    3% {
        opacity: 1;
        transform: translateY(0);
    }
    17% {
        opacity: 1;
        transform: translateY(0);
    }
    20% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 0;
    }
}

/* Carousel */
.carousel-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease;
}

.carousel-card:hover {
    transform: translateY(-3px);
}

@media (max-width: 640px) {
    .carousel-card {
        flex: 0 0 250px;
    }
}

.carousel-nav-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #1a1a1a;
    background: #faf3e8;
    font-family: "Space Mono", monospace;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.carousel-nav-btn:hover {
    background: #1a1a1a;
    color: #faf3e8;
}

/* Project links */
.project-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.1);
}

/* Community logo links */
.community-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 8rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease;
}

@media (min-width: 768px) {
    .community-logo {
        width: 11rem;
    }
}

.community-logo:hover {
    transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
    .showcase-item {
        animation: none;
    }
    .showcase-item:nth-child(1) {
        opacity: 1;
    }
}
