/* ==========================================================================
   Westeneng Design — site layout styles.
   MudShadcn restyles the MudBlazor components; this file only styles the site's own
   layout. Colours come from the theme palette (Theme/SiteTheme.cs), so every rule
   follows light/dark mode automatically.
   ========================================================================== */

:root {
    --wd-bg: var(--mud-palette-background);
    --wd-fg: var(--mud-palette-text-primary);
    --wd-muted-fg: var(--mud-palette-text-secondary);
    --wd-muted: var(--mud-palette-secondary);
    --wd-subtle: var(--mud-palette-background-gray);
    --wd-border: var(--mud-palette-lines-default);
    --wd-radius: var(--mud-default-borderradius, 8px);
    --wd-radius-lg: 14px;
    --wd-mono: "Geist Mono", ui-monospace, SFMono-Regular, monospace;
    --wd-header-h: 64px;
}

html { scroll-behavior: smooth; }
body {
    background: var(--wd-bg);
    color: var(--wd-fg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "cv11";
}
section[id] { scroll-margin-top: calc(var(--wd-header-h) + 8px); }
::selection { background: var(--wd-fg); color: var(--wd-bg); }
a { color: inherit; text-decoration: none; }

.wd-muted { color: var(--wd-muted-fg) !important; }
.wd-mono { font-family: var(--wd-mono); }
.wd-center { text-align: center; display: flex; flex-direction: column; align-items: center; }

/* ---------- Logo ---------- */
.wd-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--wd-fg); line-height: 1; }
.wd-logo-mark { width: auto; display: block; }
.wd-logo-bar { width: 2px; background: currentColor; border-radius: 1px; }
.wd-logo-text { font-weight: 700; letter-spacing: 0.04em; }

/* ---------- Header ---------- */
.wd-header {
    position: sticky; top: 0; z-index: 1100;
    height: var(--wd-header-h);
    background: var(--mud-palette-appbar-background);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--wd-border);
}
.wd-header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.wd-header-logo { display: flex; align-items: center; }
.wd-nav { display: flex; gap: 4px; margin-left: 16px; }
.wd-nav-link {
    font-size: .875rem; font-weight: 500; color: var(--wd-muted-fg);
    padding: 6px 12px; border-radius: var(--wd-radius); transition: color .15s, background .15s;
}
.wd-nav-link:hover { color: var(--wd-fg); background: var(--wd-muted); }
.wd-header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wd-icon-btn { border: 1px solid var(--wd-border) !important; border-radius: var(--wd-radius) !important; width: 36px; height: 36px; }
.wd-show-mobile { display: none !important; }
.wd-main { padding-top: 0 !important; }

.wd-drawer { border-left: 1px solid var(--wd-border); padding: 16px; }
.wd-drawer-head { display: flex; align-items: center; justify-content: space-between; height: 40px; margin-bottom: 24px; }
.wd-drawer-nav { display: flex; flex-direction: column; margin-bottom: 24px; }
.wd-drawer-link { padding: 12px 4px; font-size: 1.125rem; font-weight: 500; border-bottom: 1px solid var(--wd-border); }

/* ---------- Shared building blocks ---------- */
.wd-card {
    display: block; background: var(--mud-palette-surface);
    border: 1px solid var(--wd-border); border-radius: var(--wd-radius-lg);
    box-shadow: 0 1px 2px rgb(0 0 0 / .04);
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.wd-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.wd-badge {
    display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
    font-size: .75rem; font-weight: 500; border-radius: 999px;
    background: var(--wd-muted); color: var(--wd-fg);
}
.wd-badge-lg { height: 28px; padding: 0 12px; font-size: .8125rem; border: 1px solid var(--wd-border); background: var(--wd-bg); }
.wd-icon-box {
    display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
    border: 1px solid var(--wd-border); border-radius: var(--wd-radius); background: var(--wd-bg);
}
.wd-icon-box .mud-icon-root { font-size: 20px; }

.wd-section { padding: 112px 0; }
.wd-section-muted { background: var(--wd-subtle); border-top: 1px solid var(--wd-border); border-bottom: 1px solid var(--wd-border); }
.wd-section-header { max-width: 640px; margin-bottom: 48px; }
.wd-section-header.wd-center { margin-inline: auto; }
.wd-eyebrow { display: block; color: var(--wd-muted-fg); margin-bottom: 12px !important; }
.wd-section-desc { margin-top: 14px !important; }

/* ---------- Hero ---------- */
.wd-hero { position: relative; overflow: hidden; padding: 120px 0 104px; border-bottom: 1px solid var(--wd-border); }
.wd-hero-bg {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(to right, var(--wd-border) 1px, transparent 1px),
        linear-gradient(to bottom, var(--wd-border) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 60% at 30% 30%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 30%, #000 30%, transparent 75%);
    opacity: .7;
}
.wd-hero-mark {
    position: absolute; right: -4%; top: 50%; transform: translateY(-50%);
    width: min(48vw, 640px); height: auto; pointer-events: none;
    fill: none; stroke: var(--wd-border); stroke-width: .6;
}
.wd-hero-inner { position: relative; }
.wd-pill {
    display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px;
    border: 1px solid var(--wd-border); border-radius: 999px; background: var(--wd-bg);
    font-size: .8125rem; font-weight: 500; transition: background .15s;
}
.wd-pill:hover { background: var(--wd-muted); }
.wd-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 25%, transparent); }
.wd-hero-title { margin-top: 28px !important; max-width: 900px; }
.wd-hero-accent { color: var(--wd-muted-fg); }
.wd-hero-lead { max-width: 580px; margin-top: 24px !important; }
.wd-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.wd-hero-meta {
    display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 72px; padding-top: 24px;
    border-top: 1px dashed var(--wd-border); font-size: .875rem; font-weight: 500; max-width: 760px;
}
.wd-hero-meta .wd-mono { color: var(--wd-muted-fg); font-size: .75rem; margin-right: 6px; }

/* ---------- Work ---------- */
.wd-work-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.wd-work-head .wd-section-header { margin-bottom: 0; }
.wd-filter .mud-chip { margin: 0 6px 0 0; }
.wd-work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.wd-project { overflow: hidden; }
.wd-project:hover { border-color: color-mix(in srgb, var(--wd-fg) 30%, var(--wd-border)); transform: translateY(-2px); box-shadow: 0 12px 32px -16px rgb(0 0 0 / .25); }
.wd-project-body { padding: 20px; }
.wd-project-meta { display: flex; justify-content: space-between; font-family: var(--wd-mono); font-size: .75rem; color: var(--wd-muted-fg); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.wd-project-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.wd-project-arrow { font-size: 18px !important; color: var(--wd-muted-fg); transition: transform .2s, color .2s; }
.wd-project:hover .wd-project-arrow { transform: translate(2px, -2px); color: var(--wd-fg); }

/* Project placeholder artwork */
.wd-thumb {
    position: relative; aspect-ratio: 16 / 10; overflow: hidden;
    background: var(--wd-subtle); border-bottom: 1px solid var(--wd-border);
    display: grid; place-items: end center; padding: 24px 24px 0;
}
.wd-thumb-lg { aspect-ratio: 16 / 7; border: 1px solid var(--wd-border); border-radius: var(--wd-radius-lg); padding: 48px 12% 0; margin: 48px 0; }
.wd-thumb-glow {
    position: absolute; inset: 0;
    background:
        radial-gradient(60% 70% at 85% 0%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%),
        radial-gradient(50% 60% at 0% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
}
.wd-thumb-window {
    position: relative; width: 100%; height: 88%;
    background: var(--mud-palette-surface); border: 1px solid var(--wd-border); border-bottom: 0;
    border-radius: 10px 10px 0 0; box-shadow: 0 -8px 30px -12px rgb(0 0 0 / .2);
    transition: transform .3s;
}
.wd-project:hover .wd-thumb-window { transform: translateY(-4px); }
.wd-thumb-bar { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-bottom: 1px solid var(--wd-border); }
.wd-thumb-bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--wd-border); }
.wd-thumb-bar span { margin-left: 8px; font-size: 10px; color: var(--wd-muted-fg); }
.wd-thumb-body { padding: 8% 9%; }
.wd-thumb-title { font-weight: 700; letter-spacing: -.03em; font-size: clamp(1rem, 2vw, 1.375rem); line-height: 1.1; margin-bottom: 12px; }
.wd-thumb-lg .wd-thumb-title { font-size: clamp(1.5rem, 4vw, 3rem); }
.wd-thumb-line { height: 6px; border-radius: 3px; background: var(--wd-muted); margin-bottom: 6px; }
.wd-thumb-blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.wd-thumb-blocks span { aspect-ratio: 4 / 3; border-radius: 6px; background: var(--wd-muted); }
.wd-thumb-blocks span:first-child { background: var(--accent); opacity: .85; }

/* ---------- Services ---------- */
.wd-services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.wd-service { padding: 24px; }
.wd-service .wd-icon-box { margin-bottom: 20px; }
.wd-service .mud-typography-h6 { margin-bottom: 6px; }
.wd-checklist { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--wd-border); padding-top: 16px; }
.wd-checklist li { display: flex; align-items: center; gap: 8px; font-size: .875rem; padding: 4px 0; }
.wd-checklist .mud-icon-root { font-size: 16px; color: var(--wd-muted-fg); }

/* ---------- AI & automation (always dark) ---------- */
.wd-ai { position: relative; overflow: hidden; background: #09090b; color: #fafafa; border-top: 1px solid var(--wd-border); border-bottom: 1px solid var(--wd-border); }
.wd-ai-bg {
    position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(to right, rgb(255 255 255 / .05) 1px, transparent 1px), linear-gradient(to bottom, rgb(255 255 255 / .05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 60% 70% at 85% 20%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 60% 70% at 85% 20%, #000 20%, transparent 75%);
}
.wd-ai-inner { position: relative; }
.wd-ai .wd-eyebrow, .wd-ai .wd-section-desc, .wd-ai p { color: #a1a1aa !important; }
.wd-ai-top { display: grid; grid-template-columns: 7fr 5fr; gap: 64px; align-items: start; margin-bottom: 64px; }
.wd-ai-top .wd-section-header { margin-bottom: 0; }
.wd-ai .wd-hero-cta { margin-top: 32px; }
.wd-ai-btn.mud-button-root { background: #fafafa !important; color: #18181b !important; }
.wd-ai-btn.mud-button-root:hover { background: #e4e4e7 !important; }
.wd-ai-note { border: 1px solid #27272a; border-radius: var(--wd-radius-lg); padding: 24px; background: rgb(24 24 27 / .7); backdrop-filter: blur(6px); }
.wd-ai-note-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.wd-ai .wd-icon-box { background: #18181b; border-color: #27272a; color: #fafafa; }
.wd-ai-note p { font-size: .9375rem; margin: 0; }
.wd-ai .wd-checklist { border-top-color: #27272a; }
.wd-ai .wd-checklist li { align-items: flex-start; color: #e4e4e7; }
.wd-ai .wd-checklist .mud-icon-root { color: #22c55e; margin-top: 3px; }
.wd-ai-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.wd-ai-steps li { border-top: 1px solid #3f3f46; padding-top: 20px; }
.wd-ai-steps .wd-mono { display: block; font-size: .75rem; color: #71717a; margin-bottom: 12px; }
.wd-ai-steps .mud-typography-h6 { margin-bottom: 6px; }
.wd-ai-steps p { font-size: .875rem; margin: 0; line-height: 1.6; }

/* ---------- Process ---------- */
.wd-process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--wd-border); border-radius: var(--wd-radius-lg); overflow: hidden; }
.wd-process-step { padding: 28px 24px 32px; border-right: 1px solid var(--wd-border); position: relative; }
.wd-process-step:last-child { border-right: 0; }
.wd-process-step:hover { background: var(--wd-subtle); }
.wd-process-num { display: inline-block; font-size: .75rem; color: var(--wd-muted-fg); margin-bottom: 40px; padding: 2px 8px; border: 1px solid var(--wd-border); border-radius: 999px; }
.wd-process-step .mud-typography-h6 { margin-bottom: 6px; }

/* ---------- About ---------- */
.wd-about { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: center; }
.wd-about-card {
    aspect-ratio: 4 / 5; border-radius: var(--wd-radius-lg); padding: 32px;
    background: #09090b; color: #fafafa; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden; border: 1px solid var(--wd-border);
}
.wd-about-card::before {
    content: ""; position: absolute; inset: 0;
    background-image: linear-gradient(to right, rgb(255 255 255 / .06) 1px, transparent 1px), linear-gradient(to bottom, rgb(255 255 255 / .06) 1px, transparent 1px);
    background-size: 32px 32px;
}
.wd-about-card .wd-logo { color: #fafafa; position: relative; }
.wd-about-card-foot { position: relative; display: flex; justify-content: space-between; font-size: .75rem; color: #a1a1aa; letter-spacing: .1em; }
.wd-about-text .wd-section-header { margin-bottom: 24px; }
.wd-about-text .mud-typography-body1 { margin-bottom: 16px; }
.wd-stack { margin-top: 32px; }

/* ---------- Contact ---------- */
.wd-contact { display: grid; grid-template-columns: 5fr 6fr; gap: 64px; align-items: start; }
.wd-contact-links { display: flex; flex-direction: column; gap: 12px; }
.wd-contact-link { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--wd-border); border-radius: var(--wd-radius-lg); transition: background .15s; font-weight: 500; font-size: .9375rem; }
.wd-contact-link:hover { background: var(--wd-subtle); }
.wd-contact-link small { display: block; font-size: .75rem; font-weight: 400; }
.wd-contact-form { padding: 28px; }
.wd-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wd-field { margin-bottom: 16px; }

/* ---------- Project detail ---------- */
.wd-detail { padding-top: 64px; }
.wd-back { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 500; color: var(--wd-muted-fg); margin-bottom: 40px; }
.wd-back:hover { color: var(--wd-fg); }
.wd-back .mud-icon-root { font-size: 16px; }
.wd-detail-head { display: grid; grid-template-columns: 7fr 4fr; gap: 48px; align-items: end; }
.wd-facts { margin: 0; border-top: 1px solid var(--wd-border); }
.wd-facts > div { display: grid; grid-template-columns: 100px 1fr; padding: 12px 0; border-bottom: 1px solid var(--wd-border); font-size: .875rem; }
.wd-facts dt { color: var(--wd-muted-fg); }
.wd-facts dd { margin: 0; font-weight: 500; }
.wd-detail-body { display: grid; grid-template-columns: 7fr 4fr; gap: 48px; align-items: start; }
.wd-detail-body .mud-typography-h5 { margin-bottom: 12px; }
.wd-detail-cta { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.wd-detail-cta .mud-button-root { margin-top: 12px; }
.wd-detail-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 80px; }
.wd-detail-nav-item { padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 1.0625rem; }
.wd-detail-nav-item:hover { border-color: color-mix(in srgb, var(--wd-fg) 30%, var(--wd-border)); }
.wd-detail-nav-item.wd-right { text-align: right; }
.wd-notfound { min-height: 60vh; justify-content: center; gap: 12px; }

/* ---------- Footer ---------- */
.wd-footer { border-top: 1px solid var(--wd-border); padding-top: 56px; }
.wd-footer-inner { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; padding-bottom: 48px; }
.wd-footer-brand { display: flex; flex-direction: column; gap: 16px; }
.wd-footer-cols { display: flex; gap: 72px; }
.wd-footer-title { font-family: var(--wd-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--wd-muted-fg); margin-bottom: 12px; }
.wd-footer-link { display: block; font-size: .875rem; padding: 3px 0; }
.wd-footer-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.wd-footer-bottom { display: flex !important; justify-content: space-between; padding-top: 20px; padding-bottom: 24px; border-top: 1px solid var(--wd-border); font-size: .8125rem; color: var(--wd-muted-fg); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .wd-services-grid { grid-template-columns: repeat(2, 1fr); }
    .wd-work-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .wd-nav, .wd-hide-mobile { display: none !important; }
    .wd-show-mobile { display: inline-flex !important; }
    .wd-process { grid-template-columns: repeat(2, 1fr); }
    .wd-process-step:nth-child(2) { border-right: 0; }
    .wd-process-step:nth-child(-n+2) { border-bottom: 1px solid var(--wd-border); }
    .wd-about, .wd-contact, .wd-detail-head, .wd-detail-body, .wd-ai-top { grid-template-columns: 1fr; gap: 40px; }
    .wd-ai-steps { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
    .wd-about-card { aspect-ratio: 16 / 9; }
    .wd-hero-mark { opacity: .6; width: 80vw; right: -25%; }
}
@media (max-width: 640px) {
    .wd-section { padding: 72px 0; }
    .wd-hero { padding: 72px 0 64px; }
    .wd-hero-meta { margin-top: 48px; }
    .wd-work-grid, .wd-services-grid, .wd-process, .wd-form-row, .wd-detail-nav, .wd-ai-steps { grid-template-columns: 1fr; }
    .wd-process-step { border-right: 0 !important; border-bottom: 1px solid var(--wd-border); }
    .wd-process-step:last-child { border-bottom: 0; }
    .wd-process-num { margin-bottom: 20px; }
    .wd-footer-cols { gap: 40px; }
    .wd-thumb-lg { aspect-ratio: 4 / 3; padding: 24px 6% 0; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}

/* ---------- Blazor error UI ---------- */
#blazor-error-ui {
    color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box; display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 2000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
