/* ArtWorksIT, simple. Light/dark follows the system unless toggled (see site.js).
   System modelled on emilkowal.ski: one text size, two weights, warm grays,
   a narrow column, lots of air, and list rows that light up as soft cards. */

/* Inter, self-hosted: one variable file (latin) covers the weights we use. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("/fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Warm gray scale (Radix "sand"). Only a few steps are used:
   bg · hover card · selection/rules · underline · underline hover · muted · text */
:root {
    --bg: #fdfdfc;
    --card: #f5f4f4;
    --rule: #e2e1de;
    --line: #bcbbb5;
    --line-hover: #8d8d86;
    --muted: #63635e;
    --fg: #21201c;
    --strong: #21201c;
    --error: #b91c1c;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #111110;
        --card: #191918;
        --rule: #31312e;
        --line: #62605b;
        --line-hover: #6f6d66;
        --muted: #b5b3ad;
        --fg: #eeeeec;
        --strong: #fff;
        --error: #f87171;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #111110;
    --card: #191918;
    --rule: #31312e;
    --line: #62605b;
    --line-hover: #6f6d66;
    --muted: #b5b3ad;
    --fg: #eeeeec;
    --strong: #fff;
    --error: #f87171;
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-feature-settings: "cv01", "ss03";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
::selection {
    background: var(--rule);
}

h1,
h2,
p,
ul {
    margin: 0;
    padding: 0;
}
p {
    line-height: 1.65;
}
ul {
    list-style: none;
}
em {
    font-style: normal;
    color: var(--fg);
}
a {
    color: inherit;
    text-decoration: none;
}
/* Text links: a thin, quiet underline that darkens on hover. */
.link,
.lede a {
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-decoration-thickness: 0.08em;
    text-underline-position: from-font;
}
.link:hover,
.lede a:hover {
    text-decoration-color: var(--line-hover);
}
/* Keyboard focus: a clear ring on links and buttons (mouse clicks don't show it). */
:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 2px;
    border-radius: 6px;
}

.muted {
    color: var(--muted);
}

/* Frame */
.page {
    max-width: 692px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
}
.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3rem 0 0;
    margin-bottom: 5rem;
}
@media (min-width: 640px) {
    .top {
        padding-top: 5rem;
        margin-bottom: 7rem;
    }
}
.logo svg {
    display: block;
    width: 1.5rem;
    fill: currentColor;
}
/* Menu: plain links side by side; the current page is darker. */
.menu {
    display: flex;
    gap: 1.25rem;
}
.menu a {
    color: var(--muted);
    transition: color 0.15s ease;
}
.menu a:hover,
.menu a[aria-current="page"] {
    color: var(--strong);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}
main {
    padding-bottom: 6rem;
}
/* Footer: just the light/dark switch. */
.bottom {
    padding-bottom: 3rem;
}
.toggle {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s ease;
}
.toggle:hover {
    color: var(--strong);
}

/* Type: one size everywhere. Hierarchy comes from weight and color, not scale. */
.title,
.label,
.group h1,
.group h2 {
    display: block;
    font-size: inherit;
    line-height: 1.5;
    font-weight: 500;
    color: var(--strong);
}
.lede {
    margin-top: 1.25rem;
    color: var(--muted);
}

/* Groups: a label, then rows. Generous space between groups. */
.group {
    margin-top: 4rem;
}
section > .group:first-child {
    margin-top: 0;
}
.title + .group,
.title + .list,
.title + .form {
    margin-top: 1.25rem;
}
@media (min-width: 640px) {
    .group + .group {
        margin-top: 6rem;
    }
}
.group h1,
.group h2 {
    margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
    .group h1,
    .group h2 {
        margin-bottom: 1rem;
    }
}

/* Clients: names as one running sentence, comma-separated, same size as everything else. */
.names {
    color: var(--strong);
}
/* Keep each name on one line, so "Strand Life Sciences" never splits. */
.names span,
.names a {
    white-space: nowrap;
}
/* Linked names: no underline until hover. */
.names a {
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 0.06em;
    text-underline-offset: 0.15em;
    transition: text-decoration-color 0.15s ease;
}
@media (hover: hover) {
    .names a:hover {
        text-decoration-color: var(--line-hover);
    }
}

/* Rows: borderless; linked rows get a soft card on hover that bleeds past the column edge. */
.list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
@media (min-width: 640px) {
    .list {
        gap: 0.25rem;
    }
}
.list li {
    position: relative;
}
.row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 0 -1rem;
    padding: 0 1rem;
    border-radius: 6px;
}
@media (min-width: 640px) {
    .row {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}
@media (hover: hover) {
    a.row:hover,
    .team li:hover .row {
        background: var(--card);
    }
}
.row .side {
    text-align: right;
}

/* Work rows: name over description, category on the right. */
.row.work {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name cat" "side cat";
    gap: 0 1.5rem;
}
.row.work > :first-child {
    grid-area: name;
}
.row.work .cat {
    grid-area: cat;
}
.row.work .side {
    grid-area: side;
    text-align: left;
}
/* Outbound rows get a small arrow that nudges on hover. */
a.row.work > :first-child::after {
    content: "↗";
    display: inline-block;
    margin-left: 0.25rem;
    color: var(--muted);
    opacity: 0;
    transform: translate(-2px, 2px);
    transition: opacity 0.15s ease, transform 0.2s var(--ease-out);
}
@media (hover: hover) {
    a.row.work:hover > :first-child::after {
        opacity: 1;
        transform: none;
    }
}

/* Team hover photo: follows the cursor (site.js sets --x/--y) */
.photo {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    width: 8rem;
    height: auto;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease-out), scale 0.2s var(--ease-out);
    scale: 0.96;
    transform: translate(var(--x, 0px), var(--y, 0px)) translate(-50%, calc(var(--anchor, 100%) * -1)) translateY(-8px);
}
li:hover > .photo {
    opacity: 1;
    scale: 1;
}
/* Touch screens can't hover: show each photo as a small portrait beside the name instead. */
@media (hover: none) {
    .team li {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    .team .row {
        flex: 1;
        margin: 0;
        padding: 0;
    }
    .photo {
        position: static;
        order: -1;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        object-fit: cover;
        object-position: top;
        opacity: 1;
        scale: 1;
        transform: none;
    }
}

/* Contact: fields are soft cards (same fill and radius as hovered rows), no hard lines. */
.form {
    display: grid;
    gap: 1.25rem;
}
.form label span {
    color: var(--muted);
}
.field {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--card);
    border: 1px solid transparent;
    border-radius: 6px;
    color: inherit;
    font: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field:hover {
    border-color: var(--rule);
}
.field:focus,
.field:focus-visible {
    outline: none;
    border-color: var(--line);
    box-shadow: 0 0 0 3px var(--rule);
}
textarea.field {
    resize: vertical;
    min-height: 7.5rem;
}
.hp {
    display: none;
}
/* Turnstile: collapsed (no height, no gap) unless Cloudflare asks this visitor to click (site.js adds .ask).
   Not display:none, so the check keeps running in the background. */
.turnstile:not(.ask) {
    height: 0;
    overflow: hidden;
    margin-top: -1.25rem;
}
/* The one solid button on the site: inverted colors, presses down slightly. */
.send {
    justify-self: start;
    margin-top: 0.25rem;
    padding: 0.5rem 1.125rem;
    border: 0;
    border-radius: 6px;
    background: var(--fg);
    color: var(--bg);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s var(--ease-out);
}
@media (hover: hover) {
    .send:hover {
        opacity: 0.88;
    }
}
.send:active {
    transform: scale(0.97);
}
.send:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}
/* Error shows when site.js adds .show, or without JS when the Worker redirects to /contact#error. */
.error {
    display: none;
    color: var(--error);
}
.error.show,
.error:target {
    display: block;
}
/* The email/phone message sits right under its field, not a full gap away. */
#reach-error {
    margin-top: -0.75rem;
}
.thanks:not(:empty) {
    margin-top: 1.25rem;
}

/* Page entrance: content rises in, one block after another. Short, and off for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
    main > section > * {
        animation: enter 0.6s var(--ease-out) both;
    }
    main > section > :nth-child(2) { animation-delay: 60ms; }
    main > section > :nth-child(3) { animation-delay: 120ms; }
    main > section > :nth-child(4) { animation-delay: 180ms; }
    main > section > :nth-child(n + 5) { animation-delay: 240ms; }
}
@keyframes enter {
    from {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(4px);
    }
}
