/* ==========================================================================
   Hero — "Prompt → Pixel" studio
   A brief is typed, four directions are generated, a human picks one,
   and it resolves into the finished case study. Driven by hero-studio.js.
   ========================================================================== */

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

/* ── Layout ─────────────────────────────────────────────────────────────── */
.hero-studio {
    min-height: auto;
    padding: calc(var(--spacing-24) + var(--spacing-8)) 0 var(--spacing-16);
    overflow: hidden;
}

/* Pixel grid that fades in behind the studio */
.hero-studio::before {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background-image: radial-gradient(rgba(229, 255, 0, 0.16) 1px, transparent 1.4px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 55% 70% at 78% 50%, #000 0%, transparent 75%);
            mask-image: radial-gradient(ellipse 55% 70% at 78% 50%, #000 0%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

.hero-studio .hero-container {
    gap: var(--spacing-12);
}

@media (min-width: 1024px) {
    .hero-studio { min-height: min(100vh, 980px); padding-bottom: var(--spacing-20); }
    .hero-studio .hero-container {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
        gap: var(--spacing-16);
    }
}

/* ── Copy column ────────────────────────────────────────────────────────── */
.hero-studio .hero-badge { margin-bottom: var(--spacing-8); }

.hero-studio .hero-title {
    font-size: clamp(2.6rem, 6.4vw, 7rem);
    line-height: 0.92;
    margin-bottom: var(--spacing-8);
}

.hero-studio .hero-title span {
    color: var(--color-accent);
}

.hero-studio .hero-subtitle {
    max-width: 30rem;
    margin-bottom: var(--spacing-8);
}

.hero-studio .hero-subtitle strong {
    color: var(--color-text);
    font-weight: 500;
}

.hero-studio .hero-ctas {
    flex-wrap: wrap;
    margin-bottom: var(--spacing-12);
}

.hero-services {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2);
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 34rem;
}

.hero-services li {
    font-size: var(--text-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-hover);
    border-radius: var(--radius-full);
    padding: 0.4rem 0.8rem;
}

@media (max-width: 767px) {
    .hero-studio { padding-top: var(--spacing-24); }
    .hero-studio .hero-title { font-size: clamp(2.4rem, 11.5vw, 4rem); }
    .hero-studio .hero-ctas .btn { flex: 1 1 auto; }
}

/* ── Studio window ──────────────────────────────────────────────────────── */
.studio {
    --studio-radius: 10px;
    position: relative;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--studio-radius);
    background: linear-gradient(180deg, #0e0e11 0%, #09090b 100%);
    box-shadow:
        0 40px 100px -30px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(0, 0, 0, 0.6),
        0 0 80px -20px rgba(229, 255, 0, 0.10);
    overflow: hidden;
    isolation: isolate;
}

.studio-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    height: 44px;
    padding: 0 var(--spacing-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.015);
}

.studio-dots { display: flex; gap: 6px; flex-shrink: 0; }
.studio-dots i {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #26262b;
}

.studio-steps {
    display: flex;
    gap: var(--spacing-1);
    list-style: none;
    margin: 0 0 0 auto;
    padding: 0;
}

.studio-steps li {
    position: relative;
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5d5d66;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-full);
    transition: color var(--transition-fast), background-color var(--transition-fast);
    white-space: nowrap;
}

.studio-steps li b { font-weight: 500; color: inherit; opacity: 0.6; margin-right: 0.35em; }

.studio-steps li.is-active {
    color: #0a0a0a;
    background: var(--color-accent);
}
.studio-steps li.is-active b { opacity: 0.55; }
.studio-steps li.is-done { color: #a4a4ad; }

@media (max-width: 520px) {
    .studio-steps li:not(.is-active) span { display: none; }
    .studio-steps li:not(.is-active) b { margin-right: 0; }
}

.studio-body {
    padding: var(--spacing-4);
    display: grid;
    gap: var(--spacing-4);
}

@media (min-width: 768px) {
    .studio-body { padding: var(--spacing-6); gap: var(--spacing-4); }
}

/* ── Prompt field ───────────────────────────────────────────────────────── */
.studio-prompt {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    min-height: 54px;
    padding: 0.6rem 0.6rem 0.6rem 1rem;
    border: 1px solid #25252b;
    border-radius: 12px;
    background: #111114;
    transition: border-color var(--transition);
}

.studio.is-typing .studio-prompt { border-color: rgba(229, 255, 0, 0.35); }

.studio-prompt-icon {
    color: var(--color-accent);
    font-size: 14px;
    flex-shrink: 0;
}

.studio-prompt-text {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    line-height: 1.35;
    color: #ececf1;
}

.studio-caret {
    display: inline-block;
    width: 2px;
    height: 1.05em;
    margin-left: 2px;
    vertical-align: -0.15em;
    background: var(--color-accent);
    animation: studio-blink 1s steps(1) infinite;
}

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

.studio-generate {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0a0a0a;
    background: #3a3a40;
    border-radius: 8px;
    padding: 0.55rem 0.8rem;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.studio.is-generating .studio-generate {
    background: var(--color-accent);
    transform: scale(0.96);
}

@media (max-width: 420px) {
    .studio-generate { display: none; }
    .studio-prompt-text { font-size: 14px; }
}

/* ── Stage ──────────────────────────────────────────────────────────────── */
.studio-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    transition: opacity 400ms ease;
}

.studio.is-clearing .studio-stage { opacity: 0; }

.studio-grid {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    transition: opacity 500ms ease 250ms;
}

.studio.is-proof .studio-grid { opacity: 0; }

/* ── Exploration tiles ──────────────────────────────────────────────────── */
.studio-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9%;
    overflow: hidden;
    border-radius: 8px;
    background: var(--t-bg, #141417);
    color: var(--t-fg, #fff);
    opacity: 0;
    transform: translateY(10px) scale(0.97);
    transition:
        opacity 450ms var(--transition-fast),
        transform 600ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 500ms ease,
        box-shadow 400ms ease;
}

.studio-tile.is-in { opacity: 1; transform: none; }

/* Skeleton shimmer while "generating" */
.studio-tile.is-loading {
    background: #141417;
    color: transparent;
}
.studio-tile.is-loading > * { visibility: hidden; }
.studio-tile.is-loading::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.06) 50%, transparent 80%);
    background-size: 200% 100%;
    animation: studio-shimmer 1.1s linear infinite;
}
@keyframes studio-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

.studio-tile-tag {
    position: absolute;
    top: 8px; left: 10px;
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: currentColor;
    opacity: 0.55;
}

.studio-tile.is-dim {
    opacity: 0.22;
    filter: grayscale(0.7) blur(1.5px);
    transform: scale(0.96);
}

.studio-tile.is-picked {
    box-shadow: 0 0 0 2px var(--color-accent), 0 18px 40px -12px rgba(229, 255, 0, 0.35);
    transform: scale(1.02);
    z-index: 2;
}

.studio-tile.is-picked .studio-tile-tag::after {
    content: " · Picked";
    color: var(--color-accent);
    opacity: 1;
}

/* Refine: wordmark tightens, mark settles */
.studio-tile .wm { transition: letter-spacing 900ms cubic-bezier(0.16, 1, 0.3, 1), font-weight 900ms; }
.studio-tile .mk { transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1); }
.studio-tile.is-refining .wm { letter-spacing: var(--wm-tight, -0.03em); }
.studio-tile.is-refining .mk { transform: scale(1.08) rotate(var(--mk-rot, 0deg)); }

/* ── Wordmarks ──────────────────────────────────────────────────────────── */
.wm {
    font-size: clamp(11px, 1.35vw, 17px);
    line-height: 1;
    white-space: nowrap;
    color: currentColor;
    letter-spacing: var(--wm-loose, 0.04em);
}
.wm-display { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; }
.wm-sans    { font-family: var(--font-sans); font-weight: 600; }
.wm-serif   { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-style: italic; }

@media (max-width: 767px) {
    .wm { font-size: clamp(10px, 3.4vw, 15px); }
}

/* ── Marks (pure CSS, sized to the tile) ────────────────────────────────── */
.mk {
    position: relative;
    width: 30%;
    aspect-ratio: 1;
    color: var(--t-mk, currentColor);
    flex-shrink: 0;
}

.mk-ring { border: 3px solid currentColor; border-radius: 50%; }
.mk-ring::after {
    content: "";
    position: absolute;
    width: 26%; height: 26%;
    top: -4%; right: -4%;
    border-radius: 50%;
    background: currentColor;
}

.mk-mono {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid currentColor;
    border-radius: 22%;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(16px, 2.6vw, 34px);
    line-height: 1;
}
.mk-mono::before { content: attr(data-letter); }

.mk-drop {
    width: 24%;
    border-radius: 50% 50% 50% 0;
    background: currentColor;
    transform: rotate(-45deg);
    --mk-rot: -45deg;
}

.mk-star {
    background: currentColor;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.mk-book::before,
.mk-book::after {
    content: "";
    position: absolute;
    top: 14%;
    width: 44%;
    height: 72%;
    border: 3px solid currentColor;
}
.mk-book::before { left: 4%;  border-radius: 4px 2px 2px 14px; transform: skewY(8deg); }
.mk-book::after  { right: 4%; border-radius: 2px 4px 14px 2px; transform: skewY(-8deg); background: currentColor; }

.mk-dots {
    background-image: radial-gradient(circle, currentColor 0 18%, transparent 20%);
    background-size: 33.333% 33.333%;
    opacity: 0.9;
}
.mk-dots::after {
    content: "";
    position: absolute;
    width: 33.333%; height: 33.333%;
    left: 33.333%; top: 33.333%;
    border-radius: 50%;
    background: var(--t-accent, currentColor);
    box-shadow: 0 0 16px var(--t-accent, currentColor);
    transform: scale(0.7);
}

.mk-arch {
    width: 26%;
    aspect-ratio: 0.8;
    border: 3px solid currentColor;
    border-bottom: 0;
    border-radius: 999px 999px 0 0;
}
.mk-arch::after {
    content: "";
    position: absolute;
    left: 50%; top: 22%;
    width: 34%; height: 34%;
    border-radius: 50%;
    background: currentColor;
    transform: translateX(-50%);
}

.mk-sun {
    width: 34%;
    aspect-ratio: 2;
    border-radius: 999px 999px 0 0;
    background: currentColor;
}
.mk-sun::after {
    content: "";
    position: absolute;
    left: -14%; right: -14%; bottom: -5px;
    height: 3px;
    background: currentColor;
}

.mk-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12%;
}
.mk-bars::before,
.mk-bars::after {
    content: "";
    width: 12%;
    background: currentColor;
    border-radius: 99px;
}
.mk-bars::before { height: 100%; box-shadow: 22px 12px 0 currentColor; }
.mk-bars::after  { height: 64%; }

/* ── Human cursor ───────────────────────────────────────────────────────── */
.studio-cursor {
    position: absolute;
    top: 0; left: 0;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    gap: 2px;
    pointer-events: none;
    opacity: 0;
    transform: translate(var(--cx, 110%), var(--cy, 110%));
    transition:
        transform 950ms cubic-bezier(0.65, 0, 0.35, 1),
        opacity 300ms ease;
}

.studio-cursor.is-visible { opacity: 1; }

.studio-cursor svg {
    width: 20px; height: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    transition: transform 150ms ease;
}

.studio-cursor.is-clicking svg { transform: scale(0.82); }

.studio-cursor span {
    margin-top: 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #0a0a0a;
    background: var(--color-accent);
    padding: 0.25rem 0.55rem;
    border-radius: 6px 6px 6px 2px;
    white-space: nowrap;
}

/* ── Proof board (finished result) ──────────────────────────────────────── */
.studio-proof {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 4;
    display: grid;
    grid-template-rows: 1fr auto;
    overflow: hidden;
    border-radius: 8px;
    background: var(--p-bg, #111);
    color: var(--p-fg, #fff);
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5);
    transform-origin: var(--origin, 50% 50%);
    transition:
        opacity 450ms ease,
        transform 750ms cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s linear 750ms;
}

.studio.is-proof .studio-proof {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition:
        opacity 450ms ease,
        transform 750ms cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s;
}

.studio-proof:hover,
.studio-proof:focus-visible { opacity: 1; }
.studio-proof:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.proof-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7%;
    padding: var(--spacing-6);
    min-height: 0;
}

/* Real logo artwork (e.g. Good Tales Kids) */
.mk-img {
    width: auto;
    height: 72%;
    aspect-ratio: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.proof-hero--img { padding: 5% 5% 4%; }
.proof-hero--img img {
    display: block;
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 44px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 60px rgba(233, 191, 103, 0.12));
}

.proof-hero .mk { width: 22%; color: var(--t-mk, currentColor); }
.proof-hero .mk-drop  { width: 17%; }
.proof-hero .mk-arch  { width: 18%; }
.proof-hero .mk-sun   { width: 26%; }
.proof-hero .mk-mono  { font-size: clamp(22px, 3.6vw, 48px); }
.proof-hero .wm { font-size: clamp(18px, 2.6vw, 34px); letter-spacing: var(--wm-tight, -0.03em); }

.proof-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-4);
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
    color: #fff;
    font-size: 12px;
}

.proof-name {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.proof-tags { display: block; color: #a4a4ad; margin-top: 2px; }

.proof-swatches { display: flex; gap: 5px; margin-left: auto; }
.proof-swatches i {
    width: 16px; height: 16px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.proof-link {
    flex-shrink: 0;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 11px;
    color: #0a0a0a;
    background: var(--color-accent);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast);
}

.studio-proof:hover .proof-link { transform: translateX(2px); }

@media (max-width: 520px) {
    .proof-swatches { display: none; }
}

/* ── Studio footer caption ──────────────────────────────────────────────── */
.studio-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-4);
    padding: 0 var(--spacing-6) var(--spacing-4);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5d5d66;
}

.studio-foot b { color: var(--color-accent); font-weight: 500; }
.studio-counter { white-space: nowrap; }

@media (max-width: 767px) {
    .studio-foot { padding: 0 var(--spacing-4) var(--spacing-4); }
}

/* ── Reduced motion: no loop, show the finished state ──────────────────── */
@media (prefers-reduced-motion: reduce) {
    .studio *,
    .studio *::before,
    .studio *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* Screenshot mode (website concepts): the picked direction is a real screen of the build */
.studio-tile .mk-shot {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}
.studio-tile.is-refining .mk-shot { transform: scale(1.04); }
.studio-tile .studio-tile-tag { z-index: 1; }
.studio-tile:has(.mk-shot) .studio-tile-tag {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    opacity: 1;
    padding: 2px 6px;
    border-radius: 4px;
}
.proof-shot { min-height: 0; overflow: hidden; }
.proof-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
