/* =============================================================
   Ruwaid Bibi — handwritten styles
   Sections:
     1. Reset
     2. Design tokens
     3. Page base
     4. Hero
     5. Experience grid
     6. Contact modal
     7. Mobile breakpoints
   ============================================================= */


/* 1. Reset --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
h1, h2, h3, p, figure { margin: 0; }


/* 2. Design tokens ------------------------------------------ */
:root {
    --bg:            rgb(2, 2, 2);
    --fg:            #ffffff;
    --fg-muted:      rgba(255, 255, 255, 0.7);

    --font-sans:     "DM Sans", system-ui, -apple-system, "Segoe UI",
                     Roboto, Helvetica, Arial, sans-serif;
}


/* 3. Page base ---------------------------------------------- */
body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* 4. Hero ---------------------------------------------------- */
/* Hero is a vertically-centered flex column holding the title +
   subtitle (`.hero__content`) and the experience/founded grid
   (`.marquee`), with the WebGL shader (`.hero__shader`) layered
   behind everything. `min-height: 100svh` keeps the hero exactly one
   viewport tall on mobile without jumping when the URL bar collapses. */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;          /* avoids URL-bar jump on mobile Safari/Chrome */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    overflow: hidden;
    text-align: center;
}

/* WebGL canvas, drawn behind the text. The 25px blur softens hard
   edges. Mask splits the viewport in half: full-strength shader in the
   top half, solid black in the bottom half, with a soft ~12% feather
   centered on the midline so the transition reads as a gentle dissolve.
   The experience grid lives in the lower (black) half so it can sit on
   a clean readable surface. */
.hero__shader {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: blur(25px);
    -webkit-mask: linear-gradient(to top, transparent 0%, transparent 47.5%, #000 62.5%, #000 100%);
            mask: linear-gradient(to top, transparent 0%, transparent 47.5%, #000 62.5%, #000 100%);
}

/* The text-block sizes / widths are matched to oxe.framer.website screenshots
   at ~1024px viewport: title ~56–60px, subtitle ~14–15px, container clamps
   the 2-line subtitle to about 360–400px wide. */
.hero__content {
    position: relative;
    z-index: 1;
    max-width: 32rem;
    padding: 0 2rem;
}

.hero__title {
    font-size: clamp(2.25rem, 5.5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 1.25rem;
}

.hero__subtitle {
    font-size: 0.9375rem;       /* 15px */
    line-height: 1.5;
    color: var(--fg-muted);
    max-width: 26rem;            /* ~416px — keeps the 2-line wrap */
    margin-left: auto;
    margin-right: auto;
}

/* Contact CTA — pill-shaped frosted-glass button that sits in the
   empty lower band of the hero, below the experience grid, and opens
   the contact modal. Same visual language as the (since-disabled)
   card hover state so the page reads as one coherent surface. */
.hero__cta {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.75rem;
    padding: 0.625rem 1.25rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--fg);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9999px;
    cursor: pointer;
    -webkit-backdrop-filter: blur(14px) saturate(140%);
            backdrop-filter: blur(14px) saturate(140%);
    transition: background-color 0.2s ease,
                border-color 0.2s ease,
                transform 0.2s ease;
}

.hero__cta:hover,
.hero__cta:focus-visible {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.hero__cta:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .hero__cta:hover,
    .hero__cta:focus-visible {
        transform: none;
    }
}


/* 5. Experience grid --------------------------------------- */
/* Markup is two <section>s ("experience" / "founded"), each with an
   <h2> label and a <ul> of cards. On desktop we use `display: contents`
   on the sections and lists so all cards become direct grid items
   of .marquee and lay out as one flat single-row grid. The <h2>
   labels are visually hidden via .visually-hidden — they don't take a
   grid cell because `position: absolute` removes them from grid
   auto-placement. */
.marquee {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 48rem;
    margin: 2.5rem auto 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem 0.25rem;
    justify-items: center;
}

.experience-group {
    display: contents;
}

.marquee__group-list {
    display: contents;
    list-style: none;
    padding: 0;
    margin: 0;
}

.integration-card {
    position: relative;
    width: 100%;
    max-width: 11rem;
    padding: 0.5rem 0.75rem;
}

.integration-card__name {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.integration-card__desc {
    font-size: 0.8125rem;        /* 13px */
    line-height: 1.5;
    color: var(--fg-muted);
}

/* Hover glass treatment disabled — re-enable when the click-to-open
   modal is ready so visual click-affordance and real interactivity
   ship together. Spec:
     @media (hover: hover) {
         .integration-card { border-radius: 0.625rem;
             transition: background 0.2s ease, box-shadow 0.2s ease,
                         transform 0.2s ease; }
         .integration-card:hover {
             background: linear-gradient(145deg,
                 rgba(255,255,255,0.09) 0%, rgba(255,255,255,0.02) 60%);
             box-shadow: inset 0 1px 0 rgba(255,255,255,0.16),
                         0 12px 32px rgba(0,0,0,0.45);
             backdrop-filter: blur(14px) saturate(140%);
             transform: translateY(-1px);
         }
     }
     @media (prefers-reduced-motion: reduce) {
         .integration-card:hover { transform: none; }
     } */

/* Standard "visually hidden but still in the a11y tree" pattern.
   Applied to the experience/founded <h2> labels on desktop, where the
   grouping is implicit visually but should remain audible to screen
   readers. The mobile breakpoint below un-hides them. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* 6. Contact modal ----------------------------------------- */
/* Native <dialog> element styled to match the page aesthetic:
   frosted-glass panel, dimmed/blurred backdrop, dark rounded inputs,
   pill submit button. The dialog handles focus trapping, Escape-to-
   close, and inert background for free; backdrop click + close
   button are wired up in contact-modal.js. */
.modal {
    position: relative;
    margin: auto;
    padding: 0;
    width: 100%;
    max-width: min(28rem, calc(100vw - 2rem));
    color: var(--fg);
    background: rgba(12, 12, 14, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
            backdrop-filter: blur(20px) saturate(140%);
    overflow: hidden;

    /* Hidden state — applies both when the dialog is closed AND
       during the exit transition (held in place by allow-discrete
       so the animation can play out before display flips to none). */
    opacity: 0;
    transform: translateY(8px) scale(0.97);
    transition:
        opacity 220ms ease-out,
        transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
        overlay 240ms ease-out allow-discrete,
        display 240ms ease-out allow-discrete;
}

/* Open state — what the dialog settles to after the entry transition. */
.modal[open] {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Starting state for the entry transition. The browser snapshots
   these values the moment [open] is applied, then animates toward
   the .modal[open] values above. */
@starting-style {
    .modal[open] {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }
}

.modal::backdrop {
    /* Blur stays constant (cheap on GPU); only the dim color animates. */
    background: rgba(0, 0, 0, 0);
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
    transition:
        background-color 220ms ease-out,
        overlay 240ms ease-out allow-discrete,
        display 240ms ease-out allow-discrete;
}

.modal[open]::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

@starting-style {
    .modal[open]::backdrop {
        background: rgba(0, 0, 0, 0);
    }
}

/* Lock page scroll while any dialog is open. */
body:has(dialog[open]) {
    overflow: hidden;
}

.modal__close {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: var(--fg-muted);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
    z-index: 1;
}

.modal__close:hover,
.modal__close:focus-visible {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.08);
}

.modal__close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.75rem;
}

.contact-form__field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-form__label {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--fg-muted);
}

.contact-form__input {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    font-size: 1rem;             /* 16px keeps iOS from auto-zooming */
    color: var(--fg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.625rem;
    padding: 0.75rem 1rem;
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.contact-form__input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.contact-form__input:hover {
    background: rgba(255, 255, 255, 0.06);
}

.contact-form__input:focus-visible {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.contact-form__input--textarea {
    min-height: 6rem;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.contact-form__submit {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--fg-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    padding: 0.875rem 1.25rem;
    margin-top: 0.5rem;
    cursor: pointer;
    transition: color 0.15s ease,
                background-color 0.15s ease,
                border-color 0.15s ease,
                transform 0.15s ease;
}

.contact-form__submit:hover:not(:disabled),
.contact-form__submit:focus-visible:not(:disabled) {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.contact-form__submit:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.contact-form__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.contact-form__status {
    margin: 0;
    min-height: 1.25rem;
    font-size: 0.8125rem;
    text-align: center;
    color: var(--fg-muted);
}

/* Collapse the status entirely when there's no message, so the
   idle form hugs its content. When JS sets textContent the element
   re-enters the flex flow (and reserves its min-height to keep
   success/error text on a stable single line). */
.contact-form__status:empty {
    display: none;
}

.contact-form__status--success { color: #6ee7b7; }
.contact-form__status--error   { color: #fca5a5; }

@media (prefers-reduced-motion: reduce) {
    .modal__close,
    .contact-form__input,
    .contact-form__submit { transition: none; }
    .contact-form__submit:hover { transform: none; }

    /* Skip the entry/exit animation — show / hide instantly. */
    .modal,
    .modal[open],
    .modal::backdrop,
    .modal[open]::backdrop { transition: none; }
    .modal { transform: none; }
}


/* 7. Mobile breakpoints ------------------------------------- */
/* On phone-sized viewports the 3-column grid feels cramped and the
   longer descriptions wrap into too-tight columns. Switch to a
   two-column flex layout where each <section> is its own column with
   the <h2> label visible above three stacked cards. */
@media (max-width: 40em) {
    .marquee {
        display: flex;
        gap: 1rem;
        padding: 0 1rem;
        margin-top: 2rem;
    }

    .experience-group {
        display: flex;
        flex: 1;
        flex-direction: column;
        gap: 0.25rem;
    }

    .marquee__group-list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Override .visually-hidden for the labels so they reappear above
       each mobile column. */
    .marquee__group-label {
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
        border: 0;
        font-size: 0.6875rem;       /* 11px */
        font-weight: 500;
        letter-spacing: 0.06em;
        text-transform: lowercase;
        color: var(--fg-muted);
    }
}
