/* =========================================================================
   punk.science — homepage. World: Cartridge Grey.
   Moulded console plastic, a printed label, an ink screen.
   Build Acid marks the selection and the primary action, nothing else.
   ========================================================================= */

:root {
    --plastic:    #D1CDC3;   /* renders near #C8C4BA once grain and lines sit on it */
    --label:      #F2EFE7;
    --ink:        #17150F;
    --ink-2:      #2A2620;
    --acid:       #D6FF3F;
    --screen-txt: #DCD8CD;
    --screen-dim: #A9A497;   /* 7.3:1 on ink */

    --display: 'Michroma', 'Arial Black', sans-serif;
    --text: 'Schibsted Grotesk', system-ui, sans-serif;
    --mark: 'JetBrains Mono', ui-monospace, monospace;

    --edge: clamp(1rem, 3.9vw, 3.5rem);
    --gap: clamp(1.5rem, 3.4vw, 3rem);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }
body {
    margin: 0;
    background-color: var(--plastic);
    /* moulding lines, with the matte grain of the plastic over them */
    background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 4px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    color: var(--ink);
    font: 400 1.0625rem/1.55 var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
}
::selection { background: var(--acid); color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.screen :focus-visible, .foot :focus-visible { outline-color: var(--acid); }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: normal; }
p { text-wrap: pretty; }

.nw { white-space: nowrap; }
html { scrollbar-color: var(--ink) var(--plastic); }

.skip {
    position: absolute; left: var(--edge); top: -4rem; z-index: 10;
    background: var(--acid); color: var(--ink); padding: 0.6rem 1rem; font-weight: 700;
}
.skip:focus { top: 0.75rem; }

/* ---- The mark (JetBrains Mono, three graded dots) -------------------- */
.mark {
    display: inline-flex; align-items: center;
    font: 700 1.25rem/1 var(--mark); letter-spacing: -0.015em;
    color: var(--ink); text-decoration: none; white-space: nowrap;
}
.mark__dots { display: inline-flex; margin-right: 0.45em; }
.mark__dots span {
    width: 0.66em; height: 0.66em; border-radius: 50%;
    background: currentColor; margin-right: 0.2em;
}
.mark__dots span:nth-child(2) { opacity: 0.6; }
.mark__dots span:nth-child(3) { opacity: 0.3; margin-right: 0; }

/* ---- Header --------------------------------------------------------- */
.top {
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
    padding: 1.5rem var(--edge);
}
.top__nav { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1.6rem; font-weight: 700; font-size: 0.95rem; }
.top__nav a { text-decoration: none; }
.top__nav a:hover { text-decoration: underline; }
.top__cta { background: var(--ink); color: var(--label); padding: 0.55rem 1rem; border-radius: 4px; font-weight: 700; font-size: 0.95rem; text-decoration: none; white-space: nowrap; }
.top__cta:hover { background: var(--acid); color: var(--ink); text-decoration: none !important; }

/* ---- The label (first viewport) ------------------------------------- */
.label {
    margin: 0 var(--edge);
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    min-height: min(44rem, calc(100svh - 10.5rem));
    background: var(--label);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.6), 0 1px 0 rgba(0,0,0,0.08), 0 18px 40px -24px rgba(0,0,0,0.45);
}
.label__side {
    display: flex; flex-direction: column;
    padding: clamp(1.75rem, 3.4vw, 3rem);
    border-right: 2px solid var(--ink);
}
.slogan {
    margin: 0;
    font: 400 clamp(1.7rem, 0.6rem + 2.5vw, 2.9rem)/1.18 var(--display);
    letter-spacing: 0.01em; text-transform: uppercase;
}
.label__who { margin: 1.25rem 0 2.5rem; font-size: 1.25rem; line-height: 1.45; max-width: 30ch; }
.label__who--lead { font-size: 1.45rem; font-weight: 500; line-height: 1.3; max-width: 24ch; }
.label__where { display: block; margin-top: 0.5rem; font-size: 1rem; font-weight: 500; }

.modes { margin-top: auto; display: flex; flex-direction: column; }
.mode {
    position: relative;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    width: 100%; text-align: left;
    padding: 1rem 0.9rem 1rem 2.4rem;
    font: 400 clamp(0.82rem, 0.62rem + 0.5vw, 1.05rem)/1.3 var(--display);
    letter-spacing: 0.02em; text-transform: uppercase;
    color: var(--ink); background: none;
    border: 0; border-top: 2px solid var(--ink);
    cursor: pointer;
    transition: background-color 0.25s var(--ease);
}
.mode:last-child { border-bottom: 2px solid var(--ink); }
.mode::before {   /* the cursor */
    content: ""; position: absolute; left: 0.9rem; top: 50%;
    border-left: 0.8rem solid var(--ink);
    border-block: 0.5rem solid transparent;
    transform: translate(-0.4rem, -50%); opacity: 0;
    transition: transform 0.3s var(--ease), opacity 0.15s;
}
.mode__p { font: 700 0.8rem/1 var(--text); letter-spacing: 0.06em; }
.mode:hover { background: rgba(23,21,15,0.06); }
.mode[aria-selected="true"] { background: var(--acid); }
.mode[aria-selected="true"]::before { opacity: 1; transform: translate(0, -50%); }

.screen {
    display: flex; flex-direction: column;
    background: var(--ink); color: var(--screen-txt);
}
.screen__img {
    width: 100%; flex: 1 1 auto; min-height: 16rem; height: 0;
    object-fit: cover; display: block;
}
.screen__copy {
    padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.75rem, 3.6vw, 3.25rem) clamp(1.75rem, 3.4vw, 3rem);
    display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0.5rem 2rem;
}
.screen__copy .btn { grid-row: 1 / span 2; grid-column: 2; }
.screen__title {
    margin: 0; color: var(--label);
    font: 400 clamp(1.25rem, 0.85rem + 1vw, 1.85rem)/1.2 var(--display);
    letter-spacing: 0.01em; text-transform: uppercase;
    max-width: 18ch;
}
.screen__body { margin: 0; font-size: 1.1rem; line-height: 1.5; max-width: 40ch; }
.screen [data-f] { transition: opacity 0.18s ease, transform 0.35s var(--ease); }
.screen__img[data-f] { transition: opacity 0.25s ease; }
.screen.is-swapping [data-f] { opacity: 0; transform: translateY(6px); }
.screen.is-swapping .screen__img { transform: none; }

.btn {
    display: inline-block;
    padding: 1rem 1.5rem;
    font: 400 0.9rem/1.3 var(--display);
    letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--ink); background: var(--acid);
    border: 0; border-radius: 4px; text-decoration: none; cursor: pointer;
    transition: background-color 0.2s, transform 0.3s var(--ease);
}
.btn:hover { background: var(--label); }
.btn:active { transform: translateY(2px); }
.btn--ink { background: var(--ink); color: var(--label); }
.btn--ink:hover { background: var(--acid); color: var(--ink); }

/* ---- The manual: one page per service ------------------------------- */
.manual { margin: clamp(4rem, 8vw, 6.5rem) var(--edge) 0; display: grid; gap: 1.25rem; }
.service {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--label); border-radius: 6px; overflow: hidden;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.6), 0 1px 0 rgba(0,0,0,0.08);
}
.service__img { width: 100%; height: 100%; min-height: 22rem; object-fit: cover; border-right: 2px solid var(--ink); }
.service--flip .service__img { order: 2; border-right: 0; border-left: 2px solid var(--ink); }
.service__body { padding: clamp(1.75rem, 3.6vw, 3.25rem); display: flex; flex-direction: column; justify-content: center; position: relative; transition: background-color 0.3s var(--ease); }
.service__body h2 { margin: 0; font: 400 clamp(1.25rem, 0.85rem + 1vw, 1.75rem)/1.25 var(--display); letter-spacing: 0.01em; text-transform: uppercase; }
.service__body h2 .service__p { font: 700 0.8rem/1 var(--text); letter-spacing: 0.06em; vertical-align: 0.6em; margin-left: 0.4rem; }
.service__lead { margin: 1rem 0 1.5rem; font-size: 1.2rem; line-height: 1.45; max-width: 34ch; }
.service__lead a { font-weight: 700; }
.service:target .service__body { background: var(--acid); }
.ticks { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; max-width: 30rem; }
.ticks li { padding: 0.55rem 0 0.55rem 1.1rem; border-top: 1px solid rgba(23,21,15,0.18); position: relative; font-weight: 500; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: 0.45rem; height: 0.45rem; background: var(--ink); }
.service__body .btn { align-self: flex-start; }

/* ---- Products page: one label, the product on its screen ------------ */
.product {
    margin: 0 var(--edge);
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    min-height: min(32rem, calc(100svh - 14rem));
    background: var(--label); border-radius: 6px; overflow: hidden;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.6), 0 1px 0 rgba(0,0,0,0.08), 0 18px 40px -24px rgba(0,0,0,0.45);
}
.product__side { padding: clamp(1.75rem, 3.4vw, 3rem); border-right: 2px solid var(--ink); }
.product__screen {
    display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 1rem;
    padding: clamp(1.75rem, 3.6vw, 3.25rem); background: var(--ink); color: var(--screen-txt);
}
.product__name { margin: 0; color: var(--label); font: 400 clamp(1.5rem, 1rem + 1.4vw, 2.3rem)/1.2 var(--display); letter-spacing: 0.01em; }
.product__body { margin: 0 0 0.75rem; font-size: 1.2rem; line-height: 1.5; max-width: 36ch; }
.top__nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.3em; }

/* ---- Tech Briefs ---------------------------------------------------- */
.briefs {
    margin: clamp(4rem, 8vw, 6.5rem) var(--edge) 0;
    display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: var(--gap); align-items: start;
}
.briefs__head h2 { margin: 0; font: 400 clamp(1.4rem, 0.9rem + 1.4vw, 2.2rem)/1.2 var(--display); letter-spacing: 0.01em; text-transform: uppercase; }
.briefs__all { margin: 1rem 0 0; font-weight: 700; }
.briefs__card {
    display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: end;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    background: var(--ink); color: var(--screen-txt); border-radius: 6px; text-decoration: none;
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.briefs__card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -20px rgba(0,0,0,0.6); }
.briefs__card > div { display: flex; flex-direction: column; }
.briefs__no { order: 3; margin-top: 1rem; font-size: 0.9rem; color: var(--screen-dim); }
.briefs__title { margin: 0 0 0.75rem; color: var(--label); font: 400 clamp(1.1rem, 0.8rem + 0.8vw, 1.5rem)/1.25 var(--display); letter-spacing: 0.01em; text-transform: uppercase; }
.briefs__deck { margin: 0; max-width: 56ch; }
.briefs__cta { font-weight: 800; color: var(--label); white-space: nowrap; border-bottom: 2px solid var(--label); }

/* ---- Enquiry -------------------------------------------------------- */
.enquire {
    margin: clamp(4rem, 8vw, 6.5rem) var(--edge) 0;
    display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    background: var(--ink); color: var(--screen-txt); border-radius: 6px; overflow: hidden;
}
.enquire__intro { padding: clamp(1.75rem, 3.4vw, 3rem); border-right: 2px solid var(--ink-2); }
.enquire__intro h2 { margin: 0; color: var(--label); font: 400 clamp(1.4rem, 0.9rem + 1.4vw, 2.2rem)/1.2 var(--display); letter-spacing: 0.01em; text-transform: uppercase; }
.enquire__intro p { margin: 1.25rem 0 0; font-size: 1.1rem; max-width: 34ch; }
.enquire__alt a { color: var(--label); }
.form {
    padding: clamp(1.75rem, 3.4vw, 3rem);
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.5rem; align-content: start;
}
.form__offer { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.form__offer legend { padding: 0; margin-bottom: 0.6rem; font-weight: 800; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--screen-dim); }
.form__offer label { position: relative; }
.form__offer input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.form__offer span {
    display: block; padding: 0.7rem 1rem; border: 2px solid var(--screen-dim); border-radius: 4px;
    font-weight: 700; color: var(--label); transition: background-color 0.2s, border-color 0.2s;
}
.form__offer input:checked + span { background: var(--acid); border-color: var(--acid); color: var(--ink); }
.form__offer input:focus-visible + span { outline: 3px solid var(--acid); outline-offset: 3px; }
.form__field { display: flex; flex-direction: column; gap: 0.4rem; font-weight: 700; font-size: 0.95rem; }
.form__field--wide { grid-column: 1 / -1; }
.form__field input, .form__field textarea {
    width: 100%; min-width: 0;
    font: 400 1.05rem/1.4 var(--text); color: var(--label);
    background: var(--ink-2); border: 2px solid #4A453C; border-radius: 4px; padding: 0.75rem 0.85rem;
    caret-color: var(--acid);
}
.form__field input:focus, .form__field textarea:focus { outline: none; border-color: var(--acid); }
.form__field textarea { resize: vertical; min-height: 7rem; }
.form .btn { justify-self: start; }
.form__note { align-self: center; margin: 0; font-size: 0.9rem; color: var(--screen-dim); }

/* ---- Footer --------------------------------------------------------- */
.foot {
    margin-top: clamp(4rem, 8vw, 6.5rem);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
    padding: 2rem var(--edge) 2.5rem; border-top: 2px solid var(--ink);
    font-size: 0.95rem;
}
.foot p { margin: 0; }

/* ---- Small screens -------------------------------------------------- */
@media (max-width: 900px) {
    .top { flex-wrap: wrap; gap: 0.75rem 1rem; }
    .top__nav { order: 3; width: 100%; }
    .label, .service, .briefs, .enquire, .product { grid-template-columns: minmax(0, 1fr); }
    .product__side { border-right: 0; border-bottom: 2px solid var(--ink); }
    .product { min-height: 0; }
    .product__screen { min-height: 18rem; }
    .service__img, .service--flip .service__img { order: 0; min-height: 0; aspect-ratio: 16 / 10; border: 0; border-bottom: 2px solid var(--ink); }
    .screen__img { height: auto; aspect-ratio: 16 / 10; flex: none; min-height: 0; }
    .label { min-height: 0; }
    .label__side, .enquire__intro { border-right: 0; border-bottom: 2px solid var(--ink); }
    .enquire__intro { border-bottom-color: var(--ink-2); }
}
@media (max-width: 560px) {
    .top { padding-block: 1rem 0.75rem; }
    .top__nav { gap: 0.4rem 1.1rem; font-size: 0.9rem; }
    .top__nav a { white-space: nowrap; }
    .top__wide { display: none; }
    .top__cta { padding: 0.35rem 0.7rem; }
    .label__side, .screen__copy { padding: 1.4rem 1.25rem; }
    .screen__copy { grid-template-columns: 1fr; }
    .screen__img { order: 2; aspect-ratio: 16 / 9; }
    .screen__copy .btn { grid-row: auto; grid-column: auto; justify-self: start; margin-top: 0.75rem; }
    .slogan { font-size: 1.6rem; }
    .label__who { font-size: 1.05rem; margin: 0.9rem 0 1.4rem; }
    .mode { padding-block: 0.8rem; font-size: 0.8rem; }
    .screen__title { margin-top: 0.8rem; font-size: 1.15rem; }
    .screen__body { margin-top: 0.75rem; font-size: 1rem; }
    .ticks, .form { grid-template-columns: 1fr; }
    .briefs__card { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}
