/* === Portfolio V1 — v4 === */

:root {
    --bg-color: #111111;
    --text-color: #f1f1f1;
    --particle-color: #ffffff;
    --font-size-vw: 1.8;
    --font-weight: 300;
    --border-opacity: 0.12;
    --hero-align: center;
    --hero-margin: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family, 'Space Grotesk', system-ui, -apple-system, sans-serif);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Particles background ── */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.8s ease;
}
#particles-js.particles-ready {
    opacity: 1;
}

#particles-js.drill-bg {
    opacity: 0.4;
}

/* ── Center frame ── */
.frame-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
}

.frame {
    width: 50vw;
    height: 50vh;
    border: 1px solid rgba(255, 255, 255, var(--border-opacity));
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    justify-content: var(--hero-v-align, center);
    align-items: center;
    position: relative;
    pointer-events: auto;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    background: var(--frame-bg, rgba(17, 17, 17, 0.3));
    padding-top: var(--hero-v-padding, 0);
    padding-bottom: var(--hero-v-padding, 0);
}

/* ── Effect glow overlay ── */
.effect-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.effect-glow.active {
    opacity: 1;
}

/* ── Hero text ── */
.hero-text {
    font-size: clamp(14px, calc(var(--font-size-vw) * 1vw), 28px);
    font-weight: var(--font-weight);
    letter-spacing: 0.08em;
    color: rgba(241, 241, 241, 0.85);
    text-align: var(--hero-align);
    padding: 0 var(--hero-margin);
    line-height: var(--line-spacing, 2.2);
    width: 100%;
    margin: auto 0;
}

/* ── Hero divider ── */
.hero-divider {
    display: block;
    width: 7ch;
    height: 0.15em;
    margin: 0.6em 0;
    color: rgba(241, 241, 241, 0.25);
}

.hero-divider svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Hero line wrap ── */
.hero-line-wrap {
    display: block;
    overflow: hidden;
}
.hero-line-wrap:last-child {
    padding-bottom: 1em;
}

/* ── Hero line hover ── */
.hero-line {
    display: inline;
    cursor: default;
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

.hero-line-active {
    text-shadow: 0 0 20px currentColor;
}

.hero-line-welcome-glow {
    animation: welcomeGlow 3.3s ease-in-out forwards;
}

@keyframes welcomeGlow {
    0%    { color: rgba(241, 241, 241, 0.85); text-shadow: 0 0 0px rgba(0, 240, 255, 0); }
    24.2% { color: rgba(0, 240, 255, 0.95); text-shadow: 0 0 18px rgba(0, 240, 255, 0.7), 0 0 36px rgba(0, 240, 255, 0.3); }
    54.5% { color: rgba(0, 240, 255, 0.95); text-shadow: 0 0 18px rgba(0, 240, 255, 0.7), 0 0 36px rgba(0, 240, 255, 0.3); }
    100%  { color: rgba(241, 241, 241, 0.85); text-shadow: 0 0 0px rgba(0, 240, 255, 0); }
}

/* ── Subtitle reveal ── */
.hero-subtitle {
    display: block;
    font-size: 0.7em;
    letter-spacing: 0.12em;
    color: rgba(241, 241, 241, 0);
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                color 0.4s ease;
    pointer-events: none;
    line-height: 1.6;
    padding-top: 0;
}

.hero-subtitle.open {
    max-height: 3em;
    opacity: 1;
    color: rgba(241, 241, 241, 0.8);
    transform: translateY(0);
    padding-top: 0.15em;
    pointer-events: auto;
}

/* ── Learn More link ── */
.learn-more {
    color: rgba(255, 200, 100, 0.95);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-shadow: 0 0 12px rgba(255, 190, 80, 0.6), 0 0 24px rgba(255, 190, 80, 0.3);
    cursor: pointer;
    pointer-events: auto;
    transition: text-shadow 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    display: inline-block;
    padding: 12px 8px;
    margin: -12px -8px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.learn-more:hover {
    color: rgba(255, 220, 140, 1);
    text-shadow: 0 0 16px rgba(255, 190, 80, 0.8), 0 0 32px rgba(255, 190, 80, 0.5);
}

/* ── Frame transition for drill-in ── */
.frame {
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.frame.drilled-in {
    width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    height: calc(100dvh - 40px);
    border-radius: 8px;
}

/* ── Hero text fly-toward-user ── */
.hero-text.drill-out {
    transform: scale(2.5);
    filter: blur(20px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* ── Particles fly-away-from-user ── */
#particles-js.drill-away {
    transform: scale(0.3);
    filter: blur(15px);
    opacity: 0;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.effect-glow.drill-away {
    opacity: 0 !important;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ── Nav hide during drill ── */
.frame-nav.drill-hide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* ── Drill-in view ── */
.drill-view {
    display: none;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    overflow-y: auto;
    pointer-events: none;
}

.drill-view.active {
    display: flex;
    visibility: visible;
    pointer-events: auto;
}

.drill-back {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    background: transparent;
    border: none;
    -webkit-appearance: none;
    appearance: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    padding: 0.3rem 0.5rem;
    line-height: 1;
    z-index: 5;
    border-radius: 0;
}

.drill-back:hover {
    opacity: 1;
}

.drill-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    max-width: 100%;
}

.drill-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 1rem;
    row-gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2;
}

.drill-title {
    grid-column: 2;
    grid-row: 1;
    font-size: clamp(16px, calc(var(--font-size-vw) * 1.1vw), 32px);
    font-weight: var(--font-weight);
    letter-spacing: 0.08em;
    color: var(--text-color);
    opacity: 0;
    transform: translateY(20px);
    animation: drillContentIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0s;
}

/* ── Tag bar ── */
.tag-bar {
    grid-column: 2 / span 2;
    grid-row: 2;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(12px);
    animation: drillContentIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: 0.1s;
}

.tag-pill {
    padding: 0.35rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-family: var(--font-family, 'Space Grotesk', sans-serif);
    font-size: clamp(10px, 0.7rem, 14px);
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    outline: none;
}

.tag-pill:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.06);
}

.tag-pill.active {
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    border-color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.tag-pill.active:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 1);
}

/* ── Drill-in project cards ── */
.drill-cards {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.5rem 2.5rem 2rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.drill-cards::-webkit-scrollbar {
    width: 4px;
}

.drill-cards::-webkit-scrollbar-track {
    background: transparent;
}

.drill-cards::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.drill-card {
    display: flex;
    gap: 1.2rem;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.3s ease, background 0.3s ease;
    opacity: 0;
    transform: translateY(16px);
    animation: drillContentIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    cursor: pointer;
    flex-shrink: 0;
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.drill-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

.drill-card-thumb {
    flex-shrink: 0;
    width: 200px;
    aspect-ratio: 2 / 1;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.drill-card-info {
    flex: 1;
    padding: 1rem 1.2rem 1rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.drill-card-title {
    font-size: clamp(14px, calc(var(--font-size-vw) * 0.85vw), 22px);
    font-weight: 400;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.drill-card-intro strong { font-weight: 600; color: rgba(241,241,241,0.85); }
.drill-card-intro {
    font-size: clamp(11px, calc(var(--font-size-vw) * 0.55vw), 15px);
    font-weight: 300;
    color: rgba(241, 241, 241, 0.5);
    line-height: 1.5;
    margin-bottom: 0.6rem;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.drill-card-readmore {
    font-size: clamp(11px, calc(var(--font-size-vw) * 0.55vw), 14px);
    color: rgba(255, 200, 100, 0.95);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-shadow: 0 0 12px rgba(255, 190, 80, 0.6), 0 0 24px rgba(255, 190, 80, 0.3);
    letter-spacing: 0.06em;
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

.drill-card:hover .drill-card-readmore {
    color: rgba(255, 220, 140, 1);
    text-shadow: 0 0 16px rgba(255, 190, 80, 0.8), 0 0 32px rgba(255, 190, 80, 0.5);
}

@keyframes drillContentIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Drill-out reverse (content fading out) ── */
.drill-view.closing {
    pointer-events: none;
}

.drill-view.closing .drill-title,
.drill-view.closing .drill-nav-icons,
.drill-view.closing .tag-bar,
.drill-view.closing .drill-cards {
    animation: drillContentOut 0.25s ease forwards !important;
}

.drill-view.closing .tag-bar {
    animation-delay: 0.02s !important;
}

.drill-view.closing .drill-cards {
    animation-delay: 0.04s !important;
}

@keyframes drillContentOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ── Hero text return ── */
.hero-text.drill-return {
    animation: heroReturn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes heroReturn {
    0% {
        transform: scale(0.8);
        filter: blur(8px);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        filter: blur(0px);
        opacity: 1;
    }
}

/* ── Particles return ── */
#particles-js.drill-return {
    animation: particlesReturn 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes particlesReturn {
    0% {
        transform: scale(1.5);
        filter: blur(8px);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        filter: blur(0px);
        opacity: 1;
    }
}

/* ── Nav return ── */
.frame-nav.drill-return-nav {
    animation: navReturn 0.4s ease forwards;
    animation-delay: 0.15s;
    opacity: 0;
}

@keyframes navReturn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ── Glow return ── */
.effect-glow.drill-return-glow {
    opacity: 0 !important;
    transition: opacity 0.5s ease !important;
}

/* ── Inline project view (inside drill-view) ── */
.drill-project {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    overflow: hidden;
}

.drill-project.active {
    display: flex;
}

.drill-project-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    min-height: 4.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
    z-index: 2;
}

.drill-project-title {
    flex: 1;
    font-size: clamp(16px, calc(var(--font-size-vw) * 1.1vw), 32px);
    font-weight: var(--font-weight);
    letter-spacing: 0.08em;
    line-height: 1;
    color: var(--text-color);
    opacity: 0;
    transform: translateY(12px);
    animation: drillContentIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.05s forwards;
}

.drill-project-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 2.5rem 3rem;
}

.drill-project-scroll::-webkit-scrollbar {
    width: 4px;
}

.drill-project-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.drill-project-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.drill-project-section {
    max-width: 900px;
    margin: 0 auto 2.5rem;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.drill-project-section.revealed {
    opacity: 1;
    transform: translateY(0);
}

.drill-project-tags-section {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem !important;
}

.tag-pill-link {
    text-decoration: none;
    cursor: pointer;
}

.drill-project-hero {
    border-radius: 6px;
    overflow: hidden;
}

.drill-project-hero-img {
    width: 100%;
    display: block;
    border-radius: 6px;
    cursor: zoom-in;
}

.drill-project-intro p {
    font-size: clamp(15px, calc(var(--font-size-vw) * 0.85vw), 20px);
    font-weight: 400;
    line-height: 1.8;
    color: rgba(241, 241, 241, 1);
    letter-spacing: 0.03em;
    margin-bottom: 0.6em;
}

.drill-project-intro p:last-child {
    margin-bottom: 0;
}

.drill-project-chapter {
    margin-bottom: 3rem;
}

.drill-project-chapter-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: #fff;
    margin-bottom: 1.5rem;
}

.drill-project-chapter-title span {
    flex-shrink: 0;
}

.drill-project-chapter-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #bbbbbb;
}

.drill-project-chapter-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem;
    margin-top: 3rem;
    margin-bottom: 1.2rem;
    border-radius: 6px;
    overflow: hidden;
}

.drill-project-chapter-img-wrap {
    overflow: hidden;
}

.drill-project-chapter-img-wrap img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 3 / 2;
    cursor: zoom-in;
}

.drill-project-chapter-desc {
    font-size: clamp(14px, calc(var(--font-size-vw) * 0.75vw), 17px);
    font-weight: 400;
    line-height: 1.8;
    color: rgba(241, 241, 241, 1);
    letter-spacing: 0.03em;
    margin-bottom: 1.2rem;
}

.drill-project-chapter-desc p {
    margin-bottom: 0.6em;
}

.drill-project-chapter-desc p:last-child {
    margin-bottom: 0;
}

.drill-project-specs-label {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgb(175, 175, 175);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.drill-project-date-pill {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    font-variant-numeric: tabular-nums;
}

.drill-project-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 3rem;
}

.drill-project-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.drill-project-spec-label {
    font-size: 14px;
    font-style: italic;
    color: rgb(175, 175, 175);
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.drill-project-spec-value {
    font-size: 15px;
    font-weight: 400;
    font-style: normal;
    color: rgba(241, 241, 241, 1);
    text-align: right;
    letter-spacing: 0.03em;
}

.drill-project.fade-out {
    animation: drillContentOut 0.25s ease forwards;
}

/* ── Drill-project placeholders ── */
.drill-project-placeholder-img {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drill-project-placeholder-img::after {
    content: '1200×800';
    font-size: 12px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.08em;
}

.drill-project-placeholder-hero {
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drill-project-placeholder-hero::after {
    content: '1600×900';
    font-size: 12px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.08em;
}

.drill-project-placeholder-text {
    opacity: 1;
    font-style: italic;
    color: rgb(175, 175, 175);
}

.drill-project-chapter-desc.drill-project-placeholder-text {
    font-style: normal;
}

.drill-project-specs-label.drill-project-placeholder-text {
    font-style: normal;
    margin-top: 2rem;
}

.drill-project-placeholder-pill {
    opacity: 1;
}

/* ── CTA Block (shared between project.php and drill view) ── */

.project-cta-section,
.drill-project-cta-section {
    margin-top: 1rem;
}

.project-cta-divider {
    height: 1px;
    background: rgba(255, 255, 255, var(--border-opacity, 0.08));
    margin-bottom: 2rem;
}

.project-cta {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    min-height: 200px;
}

.project-cta--has-gif .project-cta-gif {
    flex: 3;
    min-width: 0;
    cursor: pointer;
}

.project-cta-gif img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-cta-separator {
    width: 1px;
    background: rgba(255, 255, 255, var(--border-opacity, 0.08));
    flex-shrink: 0;
}

.project-cta-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 2rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    min-width: 0;
}

.project-cta-text:hover {
    opacity: 0.8;
}

.project-cta-text span {
    display: block;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-color, #f1f1f1);
}

.project-cta-mail {
    width: 1em;
    height: 1em;
    margin-top: 1.2rem;
    stroke-width: 2.2;
    color: var(--text-color, #f1f1f1);
}

.project-cta--has-gif .project-cta-mail {
    width: 1.5em;
    height: 1.2em;
    stroke-width: 2.2;
}

/* No-gif: full-width centered, text on one line, mail below */
.project-cta:not(.project-cta--has-gif) {
    justify-content: center;
    min-height: auto;
}

.project-cta:not(.project-cta--has-gif) .project-cta-text {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0 0.4em;
    padding: 1.2rem 1.5rem;
}

.project-cta:not(.project-cta--has-gif) .project-cta-text span {
    display: inline;
}

.project-cta:not(.project-cta--has-gif) .project-cta-mail {
    width: 100%;
    height: 1em;
    margin-top: 1.2rem;
}

/* ── Navigation ── */
.frame-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1.2rem 0;
    width: 100%;
    margin-top: auto;
    flex-shrink: 0;
}

.frame-nav--bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    gap: 1rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.frame-nav--top {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
}

.frame-nav a {
    color: rgba(241, 241, 241, 0.5);
    text-decoration: none;
    font-size: clamp(11px, 0.9vw, 14px);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: color 0.3s ease;
    pointer-events: auto;
    white-space: nowrap;
}

.frame-nav a:hover {
    color: rgba(241, 241, 241, 0.95);
}

.frame-nav .nav-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

/* ── Mobile responsive ── */
@media (max-width: 600px) {
    .frame {
        width: 88vw;
        height: auto;
        padding-top: clamp(40px, 12vw, 80px);
        padding-bottom: clamp(40px, 12vw, 80px);
    }

    .hero-text {
        font-size: clamp(13px, 3.8vw, 18px);
        padding: 0 1.2rem;
    }

    .frame-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.8rem 0.5rem;
    }

    .frame-nav a {
        font-size: 10px;
        letter-spacing: 0.08em;
    }

    .frame-nav--bottom {
        gap: 0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .drill-card {
        flex-direction: column;
    }

    .drill-card-thumb {
        width: 100%;
    }

    .drill-card-info {
        padding: 0.8rem 1rem;
    }

    .drill-header {
        padding: 1.2rem 1rem;
    }

    .drill-cards {
        padding: 1rem 1.2rem 2rem;
    }

    .drill-project-topbar {
        padding: 1.2rem 1rem;
    }

    .drill-project-scroll {
        padding: 1.2rem 1rem 2rem;
    }

    .drill-project-chapter-images {
        grid-template-columns: 1fr;
    }

    .drill-project-specs-grid {
        grid-template-columns: 1fr;
    }

    .project-cta--has-gif {
        flex-direction: column;
    }

    .project-cta--has-gif .project-cta-gif {
        flex: none;
        width: 100%;
    }

    .project-cta--has-gif .project-cta-separator {
        width: 100%;
        height: 1px;
    }

    .project-cta--has-gif .project-cta-text {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 0 0.4em;
        padding: 1.2rem 1.5rem;
    }

    .project-cta--has-gif .project-cta-text span {
        display: inline;
    }

    .project-cta--has-gif .project-cta-mail {
        width: 100%;
        height: 1em;
        margin-top: 1.2rem;
    }
}

@media (max-width: 900px) and (min-width: 601px) {
    .frame {
        width: 68vw;
        height: 50vh;
    }

    .frame-nav {
        gap: 1.2rem;
    }
}

@media (orientation: portrait) {
    .frame {
        height: auto;
        padding-top: clamp(48px, 12vw, 110px);
        padding-bottom: clamp(48px, 12vw, 110px);
    }
}

/* ── Inline edit mode ── */
.edit-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: rgba(30, 30, 30, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.2rem;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.edit-toolbar-label {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.edit-toolbar-actions {
    display: flex;
    gap: 0.6rem;
}

.edit-btn {
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    background: transparent;
    color: #f1f1f1;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.edit-btn-save {
    background: rgba(80, 200, 120, 0.15);
    border-color: rgba(80, 200, 120, 0.4);
}

.edit-btn-save:hover {
    background: rgba(80, 200, 120, 0.25);
}

/* Editable elements highlight */
[contenteditable="true"] {
    outline: 1px dashed rgba(80, 200, 120, 0.4);
    outline-offset: 6px;
    cursor: text;
}

[contenteditable="true"]:focus {
    outline-color: rgba(80, 200, 120, 0.7);
}

/* Inline nav editing */
.edit-mode .frame-nav {
    position: relative;
    flex-wrap: wrap;
}

.nav-item-edit {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-remove-btn {
    width: 16px;
    height: 16px;
    border: none;
    background: rgba(220, 60, 60, 0.3);
    color: #f1f1f1;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.nav-remove-btn:hover {
    background: rgba(220, 60, 60, 0.6);
}

.nav-add-btn {
    width: 22px;
    height: 22px;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.nav-add-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #f1f1f1;
}

.edit-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 8px 20px;
    background: rgba(80, 200, 120, 0.2);
    border: 1px solid rgba(80, 200, 120, 0.4);
    border-radius: 4px;
    color: #f1f1f1;
    font-size: 12px;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 101;
    pointer-events: none;
}

.edit-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Nav icon buttons (shared: drill-header, drill-project-topbar, project-topbar) ── */
:root {
    --nav-icon-h: clamp(14px, calc(var(--font-size-vw) * 0.69vw), 22px);
    --nav-icon-border: clamp(0.875px, calc(var(--font-size-vw) * 0.043125vw), 1.375px);
}
.nav-icon-btn {
    background: transparent;
    border: none;
    padding: 0.25rem 0.3rem;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.6;
    transition: opacity 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-icon-btn:hover { opacity: 1; }
.nav-icon-svg {
    height: clamp(15px, calc(var(--font-size-vw) * 0.77vw), 24px);
    width: auto;
    display: block;
    stroke-width: var(--nav-icon-stroke, 1.5);
    overflow: visible;
}
.nav-icon-svg.nav-icon-envelope { height: var(--nav-icon-h); }
.drill-nav-icons,
.drill-project-nav-icons,
.project-nav-icons {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-shrink: 0;
    font-size: clamp(16px, calc(var(--font-size-vw) * 1.1vw), 32px);
}
.drill-nav-icons {
    grid-column: 3;
    grid-row: 1;
    opacity: 0;
    transform: translateY(20px);
    animation: drillContentIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.05s forwards;
}

/* ── Contact popup ── */
.contact-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.contact-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.contact-popup {
    background: rgba(17, 17, 17, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem 2.5rem 2rem;
    width: min(460px, calc(100vw - 2rem));
    position: relative;
    transform: translateY(18px);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.contact-overlay.active .contact-popup {
    transform: translateY(0);
}
.contact-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.2s;
    padding: 0.25rem 0.4rem;
    line-height: 1;
}
.contact-close:hover { opacity: 1; }
.contact-form-row { margin-bottom: 1.2rem; }
.contact-label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.45;
    margin-bottom: 0.45rem;
    font-family: inherit;
}
.contact-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 0.6rem 0.8rem;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    border-radius: 0;
    -webkit-appearance: none;
}
.contact-input:focus { border-color: rgba(255, 255, 255, 0.3); }
.contact-input.error { border-color: rgba(220, 70, 70, 0.7); }
.contact-error {
    display: block;
    font-size: 0.7rem;
    color: rgba(220, 70, 70, 0.85);
    margin-top: 0.3rem;
    min-height: 0.9em;
}
.contact-textarea {
    resize: vertical;
    min-height: 90px;
}
.contact-send {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.6rem 1.6rem;
    cursor: pointer;
    transition: border-color 0.25s ease, opacity 0.25s ease;
    margin-top: 0.4rem;
}
.contact-send:hover { border-color: rgba(255, 255, 255, 0.6); }
.contact-send:disabled { opacity: 0.4; cursor: not-allowed; }
.contact-success-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
    padding: 1.5rem 0 0.5rem;
    text-align: center;
}
.contact-success-wrap.visible { display: flex; }
.contact-success-msg {
    font-size: 0.95rem;
    opacity: 0.75;
    line-height: 1.65;
    letter-spacing: 0.02em;
}
.contact-continue {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.6rem 1.6rem;
    cursor: pointer;
    transition: border-color 0.25s ease;
}
.contact-continue:hover { border-color: rgba(255, 255, 255, 0.6); }

.lang-toggle {
    display: inline-flex;
    align-items: center;
    position: relative;
    vertical-align: middle;
    color: var(--text-color);
    opacity: 0.6;
    transition: opacity 0.15s;
    border: none;
    border-radius: 3px;
    box-shadow: inset 0 0 0 var(--nav-icon-border) currentColor;
}
.lang-toggle:hover {
    opacity: 1;
}
.lang-toggle-btn {
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    font-family: inherit;
    font-weight: 400;
    letter-spacing: 0.04em;
    background: transparent;
    color: inherit;
    border: none;
    cursor: pointer;
    line-height: 1;
}
.drill-lang-toggle {
    margin-left: 0.3rem;
    align-self: center;
    display: flex;
    height: var(--nav-icon-h);
}
.drill-lang-toggle .lang-toggle-btn {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1px 0.45rem 0;
}
