/* ==========================================================================
   SAFEBYTE Anticheat — main stylesheet
   ========================================================================== */

/* Font (self-hosted variable font, Latin subset, SIL Open Font License)
   ========================================================================== */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Design tokens
   ========================================================================== */

:root {
    color-scheme: dark;

    /* Brand */
    --c-accent:         #AF5D63;
    --c-accent-hover:   #BE6B71;
    --c-accent-light:   #C98A8F;   /* accent for small text and icons on dark */
    --c-accent-dark:    #94494F;   /* accent for small text on light */
    --c-silver:         #D1D1D1;

    /* Dark surfaces */
    --c-bg:             #221E22;
    --c-bg-deep:        #1A171A;
    --c-surface:        #2A252A;
    --c-border:         #3B353B;
    --c-border-subtle:  #2E292E;
    --c-input-line:     #5A535A;

    /* Text on dark */
    --c-heading:        #FFFFFF;
    --c-text:           var(--c-silver);
    --c-text-muted:     #A39DA2;

    /* Light section */
    --c-light-bg:       #EBEAEA;
    --c-light-text:     #221E22;
    --c-light-muted:    #5E585D;
    --c-light-rule:     #C9C7C8;

    /* Type */
    --font-fallback: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-sans: "Inter", var(--font-fallback);
    --fs-small: 0.875rem;
    --fs-lead:  1.1875rem;
    --fs-h2:    clamp(1.875rem, 1.4rem + 1.5vw, 2.5rem);
    --fs-h1:    clamp(2.375rem, 1.5rem + 3.2vw, 4.125rem);

    /* Layout */
    --container: 1200px;
    --gutter: clamp(1rem, 4vw, 2rem);
    --section-space: clamp(4.5rem, 3rem + 5vw, 7.5rem);
    --header-height: 80px;
    --radius: 6px;
    --radius-sm: 4px;
    --transition: 0.2s ease;
}

/* Base
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

svg {
    display: block;
}

h1, h2, h3 {
    margin: 0 0 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--c-heading);
}

h1 { font-size: var(--fs-h1); line-height: 1.1; letter-spacing: -0.025em; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.02em; }
h3 { font-size: 1.1875rem; letter-spacing: -0.01em; }

p {
    margin: 0 0 1rem;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--c-accent-light);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #fff;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

:focus-visible {
    outline: 2px solid var(--c-accent-light);
    outline-offset: 3px;
}

::selection {
    background: var(--c-accent);
    color: #fff;
}

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

/* Utilities
   ========================================================================== */

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 200;
    padding: 0.75rem 1rem;
    background: var(--c-accent);
    color: #fff;
    border-radius: var(--radius-sm);
}

.skip-link:focus {
    top: 1rem;
    color: #fff;
}

.icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

/* Eyebrow label */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-accent-light);
}

.eyebrow::before {
    content: "";
    width: 1.5rem;
    height: 2px;
    background: currentColor;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.link-arrow .icon {
    width: 1.125rem;
    height: 1.125rem;
    transition: transform var(--transition);
}

.link-arrow:hover .icon {
    transform: translateX(3px);
}

/* Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8125rem 1.5rem;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.btn--sm {
    padding: 0.5625rem 1.125rem;
    font-size: 0.875rem;
}

.btn--primary {
    background: var(--c-accent);
    color: #fff;
}

.btn--primary:hover {
    background: var(--c-accent-hover);
    color: #fff;
}

.btn--outline {
    border-color: #4D464D;
    color: #fff;
}

.btn--outline:hover {
    border-color: var(--c-silver);
    color: #fff;
}

/* Header
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(34, 30, 34, 0.97);
    border-bottom: 1px solid var(--c-border-subtle);
}

@supports (backdrop-filter: blur(8px)) {
    .site-header {
        background: rgba(34, 30, 34, 0.85);
        backdrop-filter: blur(8px);
    }
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    height: var(--header-height);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
}

.logo:hover {
    color: #fff;
}

.logo__mark {
    width: 2.625rem;
    height: 2rem;
}

.logo__text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo__name {
    font-size: 1.1875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.logo__sub {
    margin-top: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-nav__link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--c-silver);
}

.site-nav .btn {
    margin-left: 0.25rem;
}

/* Sections
   ========================================================================== */

.section {
    padding-block: var(--section-space);
}

/* Light section: invert text colours */
.section--light {
    background: var(--c-light-bg);
    color: var(--c-light-text);
}

.section--light h2,
.section--light h3 {
    color: var(--c-light-text);
}

.section--light .eyebrow,
.section--light .link-arrow {
    color: var(--c-accent-dark);
}

.section--light .link-arrow:hover {
    color: var(--c-light-text);
}

/* Hero
   ========================================================================== */

.hero {
    overflow: hidden;
    padding-block: clamp(4.5rem, 3rem + 5vw, 8rem);
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 760px) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero__lede {
    max-width: 580px;
    font-size: var(--fs-lead);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2.5rem;
}

.hero__visual {
    position: relative;
    justify-self: end;
    width: 100%;
    max-width: 400px;
    margin-right: -1.5rem;
    isolation: isolate;
}

/* Faint accent glow behind the mark */
.hero__visual::before {
    content: "";
    position: absolute;
    inset: -20%;
    z-index: -1;
    background: radial-gradient(closest-side, rgba(175, 93, 99, 0.18), transparent);
}

.hero__mark {
    width: 100%;
    height: auto;
}

/* What we do
   ========================================================================== */

.services {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 720px);
    justify-content: space-between;
    gap: 3rem;
    align-items: start;
}

.services__intro > p:not(.eyebrow) {
    font-size: 1.0625rem;
    color: var(--c-light-muted);
}

.services__intro .link-arrow {
    margin-top: 1.5rem;
}

.service-list li {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 360px);
    align-items: baseline;
    gap: 0.5rem 1.5rem;
    padding-block: 1.625rem 1.75rem;
    border-top: 1px solid var(--c-light-rule);
}

.service-list li:last-child {
    border-bottom: 1px solid var(--c-light-rule);
}

.service-list__number {
    font-size: var(--fs-small);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--c-accent-dark);
}

.service-list h3 {
    margin: 0;
}

.service-list p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--c-light-muted);
}

/* Contact
   ========================================================================== */

.contact {
    display: grid;
    grid-template-columns: minmax(0, 440px) minmax(0, 640px);
    justify-content: space-between;
    gap: 3.5rem;
    align-items: start;
}

.contact__intro > p:not(.eyebrow) {
    font-size: 1.0625rem;
    color: var(--c-text-muted);
}

.contact-email {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-top: 2.5rem;
    padding-block: 1rem;
    border-block: 1px solid var(--c-border);
}

.contact-email .icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--c-accent-light);
}

.contact-email a {
    font-weight: 500;
    color: var(--c-silver);
}

.contact-email a:hover {
    color: #fff;
}

.required {
    color: var(--c-accent-light);
}

/* Form (underline style) */
.form {
    display: grid;
    gap: 2.25rem;
}

.form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.25rem 2.5rem;
}

.form__field > label:not(.checkbox) {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}

.form input[type="text"],
.form input[type="email"],
.form textarea {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    font: inherit;
    color: #fff;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--c-input-line);
    border-radius: 0;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form textarea {
    resize: vertical;
    min-height: 7.5rem;
}

.form input:hover,
.form textarea:hover {
    border-bottom-color: #7A727A;
}

.form input:focus,
.form textarea:focus {
    outline: none;
    border-bottom-color: var(--c-accent-light);
    box-shadow: 0 1px 0 var(--c-accent-light);
}

/* Keep browser autofill on-theme */
.form input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 100px var(--c-bg) inset;
    -webkit-text-fill-color: #fff;
}

.form [aria-invalid="true"] {
    border-bottom-color: #E0716A;
}

.form-error {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: #F2A19B;
}

.checkbox {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--c-text-muted);
    cursor: pointer;
}

.checkbox input {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0.125rem 0 0;
    accent-color: var(--c-accent);
}

.form .btn {
    justify-self: start;
}

/* Honeypot */
.form__hp {
    position: absolute;
    left: -9999px;
}

/* Alerts */
.alert {
    display: flex;
    gap: 0.875rem;
    margin-bottom: 2rem;
    padding: 1rem 1.25rem;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
}

.alert .icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
}

.alert p {
    margin: 0.125rem 0 0;
}

.alert--success {
    background: rgba(47, 122, 85, 0.15);
    border-color: rgba(127, 199, 159, 0.35);
    color: #9AD3B2;
}

.alert--error {
    background: rgba(179, 38, 30, 0.15);
    border-color: rgba(240, 138, 132, 0.4);
    color: #F2A19B;
}

/* Footer
   ========================================================================== */

.site-footer {
    background: var(--c-bg-deep);
    border-top: 1px solid var(--c-border-subtle);
    font-size: 0.8125rem;
    color: var(--c-text-muted);
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    padding-block: 1.75rem;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    color: var(--c-text-muted);
}

.site-footer a:hover {
    color: #fff;
}

/* Privacy policy dialog
   ========================================================================== */

body:has(.modal[open]) {
    overflow: hidden;
}

.modal {
    width: calc(100% - 2rem);
    max-width: 640px;
    max-height: min(85vh, 760px);
    padding: 0;
    color: var(--c-text);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.6);
}

.modal[open] {
    display: flex;
    flex-direction: column;
}

.modal::backdrop {
    background: rgba(12, 10, 12, 0.75);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem 1.25rem 2rem;
    border-bottom: 1px solid var(--c-border);
}

.modal__header h2 {
    margin: 0;
    font-size: 1.375rem;
}

.modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    color: var(--c-text-muted);
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}

.modal__close:hover {
    color: #fff;
    border-color: var(--c-border);
}

.modal__close .icon {
    width: 1.25rem;
    height: 1.25rem;
}

.modal__body {
    overflow-y: auto;
    padding: 1.5rem 2rem 2rem;
    font-size: 0.9375rem;
}

.modal__body h3 {
    margin: 1.75rem 0 0.375rem;
    font-size: 1rem;
}

.modal__body p {
    color: var(--c-text);
}

.modal__body .modal__meta {
    font-size: 0.8125rem;
    color: var(--c-text-muted);
}

/* Responsive
   ========================================================================== */

@media (max-width: 1080px) {
    .hero__visual {
        max-width: 300px;
        margin-right: 0;
    }

    .service-list li {
        grid-template-columns: 3rem minmax(0, 1fr);
    }

    .service-list p {
        grid-column: 2;
    }
}

@media (max-width: 960px) {
    .hero__grid,
    .services,
    .contact {
        grid-template-columns: 1fr;
    }

    .hero__visual {
        display: none;
    }
}

@media (max-width: 720px) {
    .form__row {
        grid-template-columns: 1fr;
    }

    .hero__actions .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 560px) {
    .site-nav__link {
        display: none;
    }
}
