/* ==========================================================================
   Anglesey Digital
   Main Site Stylesheet

   This file is organised into the following sections:

   1.  Root variables / design tokens
   2.  Reset and base elements
   3.  Accessibility helpers
   4.  Layout helpers
   5.  Header and navigation
   6.  Hero / landing page
   7.  Search / service selector
   8.  Buttons
   9.  Shared cards / content blocks
   10. Services section
   11. Contact page
   12. Work page
   13. Footer
   14. Utility classes / animation
   15. Responsive behaviour
   16. Reduced motion support
   ========================================================================== */


/* ==========================================================================
   1. Root variables / design tokens
   ========================================================================== */

:root {
    --bg-deep: #05101d;
    --bg-main: #081120;
    --bg-soft: #0b1830;

    --panel: rgba(10, 21, 40, 0.72);
    --panel-strong: rgba(8, 18, 34, 0.82);
    --panel-soft: rgba(255, 255, 255, 0.04);

    --text: #f5f7fb;
    --text-muted: #a8b7cf;
    --text-soft: rgba(245, 247, 251, 0.78);

    --line: rgba(255, 255, 255, 0.12);
    --line-soft: rgba(255, 255, 255, 0.08);

    --accent: #72e6ff;
    --accent-strong: #4cc7ff;
    --accent-soft: rgba(114, 230, 255, 0.12);

    --success-bg: rgba(22, 163, 74, 0.12);
    --success-line: rgba(22, 163, 74, 0.35);
    --success-text: #d4ffe5;

    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-line: rgba(239, 68, 68, 0.35);
    --danger-text: #ffe1e1;

    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 20px 60px rgba(0, 0, 0, 0.24);
    --shadow-sm: 0 16px 40px rgba(0, 0, 0, 0.22);

    --radius-xl: 28px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --radius-pill: 999px;

    --container-width: 1180px;
    --container-narrow: 780px;

    --header-height: 78px;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.35s ease;
    --transition-slow: 0.7s ease;
}


/* ==========================================================================
   2. Reset and base elements
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--text);
    line-height: 1.6;
    background:
        radial-gradient(circle at top, rgba(76, 199, 255, 0.12), transparent 30%),
        linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-main) 100%);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
    background: none;
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.1;
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(2.8rem, 7vw, 5.8rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: 1.2rem;
}

p {
    margin-bottom: 0;
}


/* ==========================================================================
   3. Accessibility helpers
   ========================================================================== */

.skip-link,
.sr-only,
.honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    white-space: nowrap;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.skip-link:focus {
    width: auto;
    height: auto;
    margin: 1rem;
    padding: 0.75rem 1rem;
    clip: auto;
    background: #ffffff;
    color: #000000;
    z-index: 1000;
}


/* ==========================================================================
   4. Layout helpers
   ========================================================================== */

.container {
    width: min(calc(100% - 2rem), var(--container-width));
    margin-inline: auto;
}

.container-narrow,
.narrow {
    width: min(calc(100% - 2rem), var(--container-narrow));
    margin-inline: auto;
}

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

.eyebrow {
    margin: 0 0 1rem;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}


/* ==========================================================================
   5. Header and navigation
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(18px);
    background: rgba(6, 12, 22, 0.58);
    border-bottom: 1px solid var(--line-soft);
}

.header-inner {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-weight: 700;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 16px;
    background: linear-gradient(
        135deg,
        rgba(76, 199, 255, 0.92),
        rgba(114, 230, 255, 0.45)
    );
    color: #03111d;
    box-shadow: 0 0 30px rgba(114, 230, 255, 0.22);
}

.brand-text {
    font-size: 1.05rem;
}

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

.site-nav a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
    color: var(--text);
}


/* ==========================================================================
   6. Hero / landing page
   ========================================================================== */

.hero,
.inner-hero {
    position: relative;
    isolation: isolate;
}

.hero {
    min-height: calc(100svh - var(--header-height));
    display: flex;
    align-items: center;
    overflow: clip;
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-slide,
.hero-grid,
.hero-glow {
    position: absolute;
    inset: 0;
}

.hero-slide {
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 0.55s ease, transform 0.7s ease;
}

.hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.hero-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), transparent 90%);
}

.hero-glow-a {
    background: radial-gradient(circle at 20% 20%, rgba(76, 199, 255, 0.26), transparent 30%);
}

.hero-glow-b {
    background: radial-gradient(circle at 80% 80%, rgba(114, 230, 255, 0.18), transparent 25%);
}

.hero-content,
.inner-hero-content,
.section-heading,
.contact-layout {
    padding-block: 5rem;
}

.hero h1 {
    max-width: 12ch;
}

.hero-intro,
.hero-summary,
.inner-hero p,
.section-heading p {
    max-width: 64ch;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.hero-summary {
    margin-top: 1.25rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2rem;
}


/* ==========================================================================
   7. Search / service selector
   ========================================================================== */

.service-search {
    position: relative;
    width: min(100%, 760px);
    margin-top: 2rem;
}

.search-display,
.search-dropdown,
.service-card,
.contact-panel,
.form-panel,
.work-card,
.work-cta-box {
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
}

.search-display {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius-pill);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.search-icon {
    width: 1.2rem;
    height: 1.2rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-typed {
    flex: 1;
    min-height: 1.5em;
    font-weight: 600;
}

.search-typed::after {
    content: "";
    display: inline-block;
    width: 0.08em;
    height: 1.1em;
    margin-left: 0.14em;
    background: var(--accent);
    vertical-align: -0.15em;
    animation: blink 1s step-end infinite;
}

.search-caret {
    width: 0.8rem;
    height: 0.8rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg) translateY(-2px);
    flex-shrink: 0;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
    z-index: 15;
}

.search-option {
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 1rem 1.2rem;
    cursor: pointer;
}

.search-option:first-child {
    border-top: 0;
}

.search-option:hover,
.search-option.is-active {
    background: rgba(114, 230, 255, 0.08);
}

.option-title {
    display: block;
    font-weight: 600;
}

.option-summary {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}


/* ==========================================================================
   8. Buttons
   ========================================================================== */

.button,
.primary-button,
.button-primary,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.25rem;
    padding: 0.85rem 1.35rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    transition:
        transform var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

.primary-button,
.button-primary {
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    color: #03111d;
    border: 1px solid transparent;
}

.button-secondary {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
}

.button:hover,
.primary-button:hover,
.button-primary:hover,
.button-secondary:hover {
    transform: translateY(-1px);
}

.button-full {
    width: 100%;
}


/* ==========================================================================
   9. Shared cards / content blocks
   ========================================================================== */

.service-card,
.contact-panel,
.form-panel {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.service-card h3,
.contact-panel h2,
.form-panel h2 {
    margin-bottom: 0.75rem;
}

.service-card p,
.contact-panel p,
.form-panel p {
    color: var(--text-muted);
}


/* ==========================================================================
   10. Services section
   ========================================================================== */

.services-overview {
    padding-bottom: 5rem;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}


/* ==========================================================================
   11. Contact page
   ========================================================================== */

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
    align-items: start;
}

.contact-points {
    margin: 1.5rem 0 0;
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.form-alert {
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.form-alert-success {
    background: var(--success-bg);
    border-color: var(--success-line);
    color: var(--success-text);
}

.form-alert-error {
    background: var(--danger-bg);
    border-color: var(--danger-line);
    color: var(--danger-text);
}

.contact-form {
    display: grid;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-group {
    display: grid;
    gap: 0.5rem;
}

label {
    color: var(--text-muted);
}

input,
textarea,
select {
    width: 100%;
    padding: 0.9rem 1rem;
    color: var(--text);
    background: rgba(5, 14, 26, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
}

textarea {
    resize: vertical;
    min-height: 11rem;
}


/* ==========================================================================
   12. Work page
   ========================================================================== */

/*
   Work page hero section.
   This is independent from the homepage hero to avoid style collisions.
*/
.work-hero {
    position: relative;
    padding: 7rem 0 3rem;
}

.work-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top center, rgba(92, 208, 255, 0.16), transparent 42%),
        linear-gradient(180deg, rgba(5, 16, 32, 0.85), rgba(5, 16, 32, 0.35));
    pointer-events: none;
}

.work-hero .container,
.work-section .container,
.work-cta .container {
    position: relative;
    z-index: 1;
}

.work-eyebrow {
    margin: 0 0 1rem;
    color: #66d7ff;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.work-lead {
    max-width: 760px;
    color: var(--text-soft);
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    line-height: 1.7;
}

.work-section {
    padding: 1rem 0 5rem;
}

.work-grid {
    display: grid;
    gap: 2rem;
}

/*
   Project cards.
   Two-column on desktop, stacked on tablet/mobile.
*/
.work-card {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2rem;
    align-items: center;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    background: rgba(10, 21, 40, 0.72);
    box-shadow: var(--shadow-md);
}

.work-card--reverse {
    grid-template-columns: 1fr 1.1fr;
}

.work-card--reverse .work-card-media {
    order: 2;
}

.work-card--reverse .work-card-content {
    order: 1;
}

.work-tag {
    display: inline-block;
    margin: 0 0 0.9rem;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-pill);
    background: rgba(113, 215, 255, 0.12);
    color: #7ce3ff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.work-card-content h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.work-card-content p {
    margin: 0 0 1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.75;
}

.work-points {
    margin: 0;
    padding-left: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.work-points li + li {
    margin-top: 0.6rem;
}

/*
   Work page image shell.
   The aspect-ratio and object-fit rules are what fix the oversized
   mobile images and keep screenshots visually consistent.
*/
.work-image-shell {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(
        180deg,
        rgba(14, 30, 54, 0.96),
        rgba(8, 18, 35, 0.96)
    );
    box-shadow: var(--shadow-work);
    aspect-ratio: 16 / 10;
}

.work-image-shell::before {
    content: "";
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle, rgba(90, 204, 255, 0.14), transparent 50%);
    pointer-events: none;
}

.work-image-shell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/*
   Floating effect for project visuals.
*/
.work-image-shell--float {
    animation: workFloat 7s ease-in-out infinite;
}

.work-cta {
    padding: 0 0 5rem;
}

.work-cta-box {
    padding: 2rem;
    border-radius: var(--radius-xl);
    text-align: center;
    border: 1px solid rgba(113, 215, 255, 0.18);
    background: linear-gradient(
        135deg,
        rgba(15, 35, 63, 0.95),
        rgba(18, 51, 92, 0.95)
    );
    box-shadow: var(--shadow-sm);
}

.work-cta-box h2 {
    margin: 0 0 1rem;
}

.work-cta-box p {
    max-width: 760px;
    margin: 0 auto 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.75;
}


/* ==========================================================================
   13. Footer
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--line-soft);
    background: rgba(5, 12, 20, 0.74);
}

.footer-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

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

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--text);
}


/* ==========================================================================
   14. Utility classes / animation
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity var(--transition-slow),
        transform var(--transition-slow);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@keyframes workFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}


/* ==========================================================================
   15. Responsive behaviour
   ========================================================================== */

@media (max-width: 980px) {
    .service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .work-card,
    .work-card--reverse {
        grid-template-columns: 1fr;
    }

    .work-card--reverse .work-card-media,
    .work-card--reverse .work-card-content {
        order: initial;
    }
}

@media (max-width: 720px) {
    .site-nav {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .hero-content,
    .inner-hero-content,
    .section-heading,
    .contact-layout {
        padding-block: 4rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container,
    .container-narrow,
    .narrow {
        width: min(calc(100% - 1.5rem), var(--container-width));
    }

    .header-inner,
    .footer-inner {
        min-height: auto;
        padding-block: 1rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .hero {
        min-height: auto;
    }

    .hero-content,
    .inner-hero-content,
    .section-heading,
    .contact-layout {
        padding-block: 3.5rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-display {
        padding: 0.95rem 1rem;
    }

    .service-card,
    .contact-panel,
    .form-panel,
    .work-card,
    .work-cta-box {
        padding: 1rem;
        border-radius: 22px;
    }

    .work-hero {
        padding: 6rem 0 2rem;
    }

    .work-image-shell {
        aspect-ratio: 16 / 9;
        border-radius: 18px;
    }

    .work-card-content h2 {
        font-size: 1.8rem;
    }

    .work-cta-box {
        padding: 1.5rem;
    }
}


/* ==========================================================================
   16. Reduced motion support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-slide {
        transition: none;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}