/* ==========================================================================
   ANGLESEY DIGITAL — style.css
   Amber terminal / CRT aesthetic, Alien / Weyland-Yutani inspired
   ========================================================================== */

/* ── CUSTOM PROPERTIES ─────────────────────────────────────────────────────── */
:root {
    --bg-primary:        #080808;
    --bg-secondary:      #0c0c0c;
    --bg-card:           #101010;
    --bg-card-hover:     #161616;

    --amber:             #e8a020;
    --amber-dim:         #b07818;
    --amber-bright:      #ffb840;
    --amber-glow:        rgba(232, 160, 32, 0.12);
    --amber-glow-mid:    rgba(232, 160, 32, 0.22);
    --amber-glow-strong: rgba(232, 160, 32, 0.35);

    --text-primary:      #c89018;
    --text-secondary:    #9a7318;
    --text-dim:          #6e5214;

    --green-live:        #40c060;
    --green-glow:        rgba(64, 192, 96, 0.4);

    --border:            rgba(232, 160, 32, 0.18);
    --border-strong:     rgba(232, 160, 32, 0.45);

    --font-mono:         'Share Tech Mono', 'Courier New', Courier, monospace;
    --font-display:      'Orbitron', 'Courier New', monospace;

    --touch-target:      44px; /* minimum accessible touch target */
    --transition:        0.2s ease;
}

/* ── RESET ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── BASE ───────────────────────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* Disable smooth scroll for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── SKIP LINK (keyboard / screen reader navigation) ────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 10000;
    background: var(--amber);
    color: #000;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    transition: top 0.1s;
}

.skip-link:focus {
    top: 1rem;
    outline: 3px solid var(--amber-bright);
    outline-offset: 2px;
}

/* ── GLOBAL SCANLINE OVERLAY ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    body::after {
        content: '';
        position: fixed;
        inset: 0;
        background: repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.12) 2px,
            rgba(0, 0, 0, 0.12) 4px
        );
        pointer-events: none;
        z-index: 9998;
        animation: scanlines-drift 12s linear infinite;
    }

    @keyframes scanlines-drift {
        0%   { background-position: 0 0; }
        100% { background-position: 0 40px; }
    }

    body::before {
        content: '';
        position: fixed;
        inset: 0;
        pointer-events: none;
        z-index: 9999;
        animation: crt-flicker 10s infinite;
    }

    @keyframes crt-flicker {
        0%, 92%, 94%, 96%, 100% { opacity: 1; }
        93%                      { opacity: 0.96; }
        95%                      { opacity: 0.98; }
    }
}

/* Static scanlines for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
    body::after {
        content: '';
        position: fixed;
        inset: 0;
        background: repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.10) 2px,
            rgba(0, 0, 0, 0.10) 4px
        );
        pointer-events: none;
        z-index: 9998;
    }
}

/* ── SCROLLBAR ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar            { width: 6px; }
::-webkit-scrollbar-track      { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb      { background: var(--amber-dim); }
::-webkit-scrollbar-thumb:hover{ background: var(--amber); }

/* ── SELECTION ──────────────────────────────────────────────────────────────── */
::selection {
    background: var(--amber);
    color: #000;
}

/* ==========================================================================
   INTRO SEQUENCE
   ========================================================================== */

#intro {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 1.4s ease;
}

#intro.fade-out {
    opacity: 0;
    pointer-events: none;
}

#intro-inner {
    text-align: center;
    padding: 2rem;
    user-select: none;
}

.intro-line {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5.5vw, 5rem);
    font-weight: 900;
    color: var(--amber);
    letter-spacing: 0.35em;
    text-shadow:
        0 0 20px var(--amber),
        0 0 60px rgba(232, 160, 32, 0.35),
        0 0 120px rgba(232, 160, 32, 0.1);
    min-height: 1.3em;
    white-space: nowrap;
}

.intro-tagline {
    font-size: clamp(0.7rem, 1.8vw, 1.1rem);
    font-family: var(--font-mono);
    font-weight: 400;
    letter-spacing: 0.55em;
    color: var(--text-secondary);
    text-shadow: 0 0 12px var(--amber-dim);
    margin-top: 0.5rem;
}

#intro-divider {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--amber), transparent);
    margin: 1.8rem auto;
    box-shadow: 0 0 10px var(--amber);
    transition: width 0.9s ease;
}

#intro-divider.expanded { width: 65%; }

#intro-skip {
    margin-top: 3.5rem;
    font-size: 0.6rem;
    letter-spacing: 0.35em;
    color: var(--text-dim);
    animation: blink-cursor 1.4s step-end infinite;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.hidden { display: none !important; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo-block {
    text-decoration: none;
    line-height: 1.2;
    min-height: var(--touch-target);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-block:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 4px;
}

.logo-main {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.28em;
    color: var(--amber-bright);
    text-shadow: 0 0 18px rgba(255, 184, 64, 0.4);
}

.logo-tagline {
    font-size: 0.9rem;
    letter-spacing: 0.45em;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 3px;
}

/* ── HAMBURGER BUTTON ────────────────────────────────────────────────────────── */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    min-height: var(--touch-target);
    min-width: var(--touch-target);
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--amber);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

header.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
header.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
header.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── NAV ─────────────────────────────────────────────────────────────────────── */
nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    padding: 0.75rem 0.5rem;
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
    transition: color var(--transition), text-shadow var(--transition);
}

nav a:hover {
    color: var(--amber);
    text-shadow: 0 0 10px var(--amber);
}

nav a:focus-visible {
    color: var(--amber);
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

/* ==========================================================================
   HERO
   ========================================================================== */

#hero {
    position: relative;
    min-height: 90dvh;
    min-height: 90vh; /* fallback for browsers without dvh */
    display: flex;
    align-items: center;
    padding: 5rem 0;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 55%, rgba(232, 160, 32, 0.05) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(232, 160, 32, 0.03) 0%, transparent 45%);
    pointer-events: none;
}

.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 1px,
        rgba(232, 160, 32, 0.015) 1px,
        rgba(232, 160, 32, 0.015) 2px
    );
    pointer-events: none;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.terminal-label {
    font-size: 0.68rem;
    color: var(--text-dim);
    letter-spacing: 0.14em;
    margin-bottom: 1.5rem;
    border-left: 2px solid var(--amber-dim);
    padding-left: 0.8rem;
}

#hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4vw, 3.6rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.15;
    color: var(--amber-bright);
    text-shadow: 0 0 40px rgba(255, 184, 64, 0.25);
    margin-bottom: 1.5rem;
}

.accent {
    color: var(--amber-bright);
    text-shadow: 0 0 25px rgba(255, 184, 64, 0.5);
}

.hero-sub {
    color: var(--text-secondary);
    max-width: 540px;
    margin-bottom: 2.5rem;
    font-size: 0.92rem;
    line-height: 1.85;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── BUTTONS ─────────────────────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-target);
    padding: 0.75rem 2rem;
    background: var(--amber);
    color: #000;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 0.22em;
    border: none;
    cursor: pointer;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    transition: background var(--transition), box-shadow var(--transition);
    /* Focus style via background change (outline is clipped by clip-path) */
}

.btn-primary:hover {
    background: var(--amber-bright);
    box-shadow: 0 0 22px rgba(255, 184, 64, 0.55);
}

.btn-primary:focus-visible {
    background: var(--amber-bright);
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-target);
    padding: 0.75rem 2rem;
    background: transparent;
    color: var(--amber);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.22em;
    border: 1px solid var(--amber-dim);
    cursor: pointer;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.btn-secondary:hover {
    background: var(--amber-glow);
    border-color: var(--amber);
    box-shadow: 0 0 16px var(--amber-glow-mid);
}

.btn-secondary:focus-visible {
    background: var(--amber-glow-mid);
    border-color: var(--amber-bright);
    outline: 3px solid var(--amber-bright);
    outline-offset: 3px;
}

/* ── HERO READOUT ────────────────────────────────────────────────────────────── */
.hero-readout {
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 1.5rem;
    min-width: 230px;
    position: relative;
}

.readout-header {
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
}

.readout-list {
    list-style: none;
}

.readout-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    padding: 0.38rem 0;
    border-bottom: 1px solid rgba(232, 160, 32, 0.06);
}

.readout-line:last-child { border-bottom: none; }

.readout-line dt {
    color: var(--text-secondary);
    font-weight: normal;
}

.readout-line dd {
    text-align: right;
}

.readout-line .accent,
.readout-line dd.accent {
    font-size: 0.9rem;
    color: var(--amber-bright);
    text-shadow: 0 0 8px rgba(255, 184, 64, 0.3);
}

/* ==========================================================================
   SECTIONS — shared
   ========================================================================== */

section {
    padding: 6rem 0;
    border-top: 1px solid var(--border);
}

.section-header { margin-bottom: 3rem; }

.section-label {
    font-size: 0.63rem;
    letter-spacing: 0.32em;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.8vw, 2.4rem);
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--amber);
    margin-bottom: 0.75rem;
}

.section-sub {
    color: var(--text-secondary);
    max-width: 520px;
    font-size: 0.9rem;
}

/* ==========================================================================
   SERVICES GRID
   ========================================================================== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}

.service-card {
    background: var(--bg-card);
    padding: 2rem;
    transition: background var(--transition);
    position: relative;
}

.service-card:hover { background: var(--bg-card-hover); }

.service-card:hover .service-icon {
    color: var(--amber-bright);
    text-shadow: 0 0 14px var(--amber);
}

.service-icon {
    font-size: 1.4rem;
    color: var(--amber-dim);
    margin-bottom: 1rem;
    display: block;
    transition: color var(--transition), text-shadow var(--transition);
}

.service-card h3 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--amber);
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.85;
}

/* ==========================================================================
   WORK / PORTFOLIO
   ========================================================================== */

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
}

.work-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

/* Corner accent marks */
.work-card::before,
.work-card::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--amber-dim);
    border-style: solid;
    transition: border-color var(--transition);
}
.work-card::before { top: 6px;    left: 6px;  border-width: 1px 0 0 1px; }
.work-card::after  { bottom: 6px; right: 6px; border-width: 0 1px 1px 0; }

.work-card:hover {
    border-color: var(--amber-dim);
    box-shadow: 0 0 24px var(--amber-glow), inset 0 0 24px rgba(232, 160, 32, 0.03);
}

.work-card:hover::before,
.work-card:hover::after { border-color: var(--amber); }

.work-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.work-label {
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    color: var(--text-dim);
}

.work-status {
    font-size: 0.9rem;
    letter-spacing: 0.16em;
    color: var(--green-live);
    text-shadow: 0 0 8px var(--green-glow);
}

.work-card h3 {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--amber);
    margin-bottom: 1rem;
}

.work-card p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.85;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    list-style: none;
}

.work-tags li {
    font-size: 0.9rem;
    letter-spacing: 0.16em;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.18rem 0.6rem;
}

.work-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
}

.work-link {
    font-size: 0.9rem;
    letter-spacing: 0.22em;
    color: var(--amber-dim);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color var(--transition);
}

.work-link:hover { color: var(--amber); }

.work-link:focus-visible {
    color: var(--amber-bright);
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

.work-card:hover .work-link { color: var(--amber); }

.work-gallery-btn {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.18em;
    color: var(--text-secondary);
    background: none;
    border: 1px solid var(--border);
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
    min-height: 32px;
    flex-shrink: 0;
}

.work-gallery-btn:hover {
    color: var(--amber);
    border-color: var(--amber-dim);
}

.work-gallery-btn:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
    color: var(--amber);
}

/* ==========================================================================
   CONTACT — MAILTO LINK
   ========================================================================== */

.contact-panel {
    max-width: 680px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-mailto {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    text-decoration: none;
    padding: 1.5rem 2rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    min-height: var(--touch-target);
}

/* Corner accent */
.contact-mailto::before {
    content: '';
    position: absolute;
    top: 6px; left: 6px;
    width: 14px; height: 14px;
    border-top: 1px solid var(--amber-dim);
    border-left: 1px solid var(--amber-dim);
}

.contact-mailto:hover {
    border-color: var(--amber-dim);
    background: var(--bg-card-hover);
    box-shadow: 0 0 24px var(--amber-glow);
}

.contact-mailto:focus-visible {
    outline: 2px solid var(--amber-bright);
    outline-offset: 3px;
    border-color: var(--amber);
}

.contact-mailto-icon {
    color: var(--amber-dim);
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: color var(--transition), text-shadow var(--transition);
}

.contact-mailto:hover .contact-mailto-icon {
    color: var(--amber-bright);
    text-shadow: 0 0 14px var(--amber);
}

.contact-mailto-addr {
    color: var(--amber-bright);
    font-family: var(--font-mono);
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    letter-spacing: 0.06em;
    text-shadow: 0 0 12px rgba(255, 184, 64, 0.3);
    flex-grow: 1;
    word-break: break-all;
}

.contact-mailto-cta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    flex-shrink: 0;
    transition: color var(--transition);
}

.contact-mailto:hover .contact-mailto-cta { color: var(--amber); }

.contact-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ==========================================================================
   GALLERY LIGHTBOX
   ========================================================================== */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.gallery-lightbox[aria-hidden="false"] {
    pointer-events: auto;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 8, 0.92);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gallery-lightbox[aria-hidden="false"] .gallery-overlay {
    opacity: 1;
}

.gallery-panel {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    width: min(92vw, 900px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.96);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.gallery-lightbox[aria-hidden="false"] .gallery-panel {
    transform: scale(1);
    opacity: 1;
}

.gallery-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.gallery-title-text {
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    color: var(--amber);
    text-transform: uppercase;
}

.gallery-close {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
    min-height: var(--touch-target);
}

.gallery-close:hover {
    color: var(--amber-bright);
    border-color: var(--amber-dim);
}

.gallery-close:focus-visible {
    outline: 2px solid var(--amber-bright);
    outline-offset: 2px;
}

.gallery-stage {
    display: flex;
    align-items: center;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.gallery-image-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 70vh;
    overflow: hidden;
    background: var(--bg-primary);
}

.gallery-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease;
}

.gallery-loading,
.gallery-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-align: center;
    padding: 2rem;
}

.gallery-prev,
.gallery-next {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    padding: 1rem 0.85rem;
    cursor: pointer;
    transition: color var(--transition), background var(--transition);
    min-height: var(--touch-target);
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
}

.gallery-prev:hover,
.gallery-next:hover {
    color: var(--amber-bright);
    background: rgba(232, 160, 32, 0.05);
}

.gallery-prev:focus-visible,
.gallery-next:focus-visible {
    outline: 2px solid var(--amber-bright);
    outline-offset: -2px;
}

.gallery-prev:disabled,
.gallery-next:disabled {
    opacity: 0.25;
    cursor: default;
}

.gallery-footer {
    border-top: 1px solid var(--border);
    padding: 0.6rem 1.25rem;
    flex-shrink: 0;
}

.gallery-counter {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    background: var(--bg-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand .logo-main { font-size: 0.9rem; margin-bottom: 4px; }

.footer-brand p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 300px;
    margin-top: 0.75rem;
    line-height: 1.85;
}

.footer-links {
    display: flex;
    gap: 4rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.footer-col-title {
    font-size: 0.9rem;
    letter-spacing: 0.28em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.2rem 0;
    transition: color var(--transition);
    /* Accessible touch target via padding */
    min-height: 28px;
    display: flex;
    align-items: center;
}

.footer-col a:hover { color: var(--amber); }

.footer-col a:focus-visible {
    color: var(--amber);
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

.footer-ref { color: rgba(232, 160, 32, 0.18); }

/* ==========================================================================
   RESPONSIVE — Tablet (768px – 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
    .hero-inner {
        gap: 2.5rem;
    }
    .hero-readout {
        min-width: 190px;
    }
    .footer-links { gap: 2.5rem; }
}

/* ==========================================================================
   RESPONSIVE — Small Tablet / Large Mobile (640px – 900px)
   ========================================================================== */

@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }
    .hero-readout {
        display: none;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .footer-links { gap: 2.5rem; }
}

/* ==========================================================================
   RESPONSIVE — Mobile (max 640px)
   ========================================================================== */

@media (max-width: 640px) {
    section { padding: 4rem 0; }

    .hero-cta { flex-direction: column; align-items: flex-start; }

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

    .footer-links { flex-direction: column; gap: 1.5rem; }

    /* Hamburger nav — show toggle, hide inline nav */
    .nav-toggle { display: flex; }

    #main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 0.5rem 0;
        z-index: 200;
    }

    header.nav-open #main-nav {
        display: flex;
    }

    #main-nav a {
        padding: 0.85rem 1.5rem;
        font-size: 0.75rem;
        letter-spacing: 0.2em;
        border-bottom: 1px solid var(--border);
        min-height: var(--touch-target);
        display: flex;
        align-items: center;
    }

    #main-nav a:last-child { border-bottom: none; }

    .contact-mailto {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .contact-mailto-cta { display: none; }
}

/* ==========================================================================
   RESPONSIVE — Small Mobile (max 420px)
   ========================================================================== */

@media (max-width: 420px) {
    .container { padding: 0 1.25rem; }
    .logo-main { font-size: 0.82rem; letter-spacing: 0.18em; }
    .services-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   INTRO — Small Screen Overflow Fix
   ========================================================================== */

@media (max-width: 520px) {
    .intro-line {
        font-size: clamp(1.1rem, 5.5vw, 1.8rem);
        letter-spacing: 0.15em;
        white-space: normal;
        word-break: break-word;
    }
    .intro-tagline {
        font-size: clamp(0.55rem, 3vw, 0.8rem);
        letter-spacing: 0.28em;
    }
    #intro-divider.expanded { width: 88%; }
    #intro-skip { margin-top: 2rem; }
}

/* ==========================================================================
   REDUCED MOTION — disable intro animation, keep site visible
   (JS also handles this; CSS is the fallback)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    #intro { display: none !important; }
    #site  { display: block !important; opacity: 1 !important; }
    .intro-line, #intro-divider { transition: none; animation: none; }
    #intro-skip { animation: none; }
}

/* ==========================================================================
   WEYLAND-YUTANI KONAMI EASTER EGG OVERLAY
   ========================================================================== */

.wy-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: wy-flicker 0.12s steps(1) 0s 3;
}

.wy-overlay.active {
    display: flex;
}

@keyframes wy-flicker {
    0%   { opacity: 0; }
    50%  { opacity: 1; }
    100% { opacity: 0; }
}

.wy-box {
    border: 1px solid var(--amber);
    background: #020202;
    padding: 2.5rem 3rem;
    max-width: 560px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 60px rgba(232, 160, 32, 0.2),
                inset 0 0 60px rgba(232, 160, 32, 0.03);
    animation: wy-scan 6s linear infinite;
}

@keyframes wy-scan {
    0%   { box-shadow: 0 0 60px rgba(232, 160, 32, 0.2), inset 0 0 60px rgba(232, 160, 32, 0.03); }
    50%  { box-shadow: 0 0 80px rgba(232, 160, 32, 0.35), inset 0 0 80px rgba(232, 160, 32, 0.06); }
    100% { box-shadow: 0 0 60px rgba(232, 160, 32, 0.2), inset 0 0 60px rgba(232, 160, 32, 0.03); }
}

.wy-corp {
    font-family: var(--font-display);
    font-size: clamp(0.65rem, 2vw, 0.85rem);
    letter-spacing: 0.18em;
    color: var(--amber-bright);
    text-shadow: 0 0 20px rgba(255, 184, 64, 0.5);
    margin-bottom: 0;
}

.wy-divider {
    height: 1px;
    background: var(--border);
    margin: 1rem 0;
}

.wy-warning {
    font-size: 0.9rem;
    color: #ff4444;
    letter-spacing: 0.2em;
    text-shadow: 0 0 12px rgba(255, 68, 68, 0.6);
    margin: 0 0 0.75rem;
}

.wy-msg {
    font-family: var(--font-display);
    font-size: clamp(0.8rem, 2.5vw, 1.1rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--amber-bright);
    margin: 0 0 0.5rem;
}

.wy-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 0.12em;
    margin: 0 0 1rem;
}

.wy-quote {
    font-size: 0.875rem;
    color: var(--amber-dim);
    letter-spacing: 0.1em;
    font-style: italic;
    margin: 0 0 0.5rem;
}

.wy-orders {
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.14em;
    margin: 0 0 1rem;
}

.wy-dismiss {
    font-size: 0.82rem;
    color: var(--amber);
    letter-spacing: 0.2em;
    animation: wy-blink 1.2s step-end infinite;
    margin: 0;
}

@keyframes wy-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}
