/* =====================================================================
   GADTAN — PAGE MODULES
   Layout that belongs to a single page or section.
   ===================================================================== */

/* =====================================================================
   HOME — HERO
   ===================================================================== */
.hero {
    position: relative;
    padding-top: calc(var(--header-h) + clamp(3rem, 8vw, 6rem));
    padding-bottom: clamp(3rem, 7vw, 5.5rem);
}
.hero__grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: clamp(2.5rem, 5vw, 4.5rem);
}
.hero__title {
    font-size: clamp(2.5rem, 6.2vw, 4.4rem);
    line-height: 1.04;
    margin-block: 1.4rem 0.4rem;
}
.hero__title span { display: block; }
.hero__subtitle {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.4vw, 1.75rem);
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: -0.01em;
}
.hero__lead {
    color: var(--text-muted);
    font-size: 1.03rem;
    line-height: 1.8;
    max-width: 30rem;
    margin-top: 1.5rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.2rem; }

.hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2.2rem;
    border-top: 1px solid var(--border);
}
.hero__stat-value {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero__stat-label {
    font-size: 0.76rem;
    color: var(--text-faint);
    letter-spacing: 0.06em;
    margin-top: 0.2rem;
}

/* --- Portrait ------------------------------------------------------- */
.hero__portrait { position: relative; justify-self: center; width: min(100%, 440px); }
.hero__portrait-glow {
    position: absolute;
    inset: 8% 8% 20%;
    border-radius: 50%;
    background: var(--gradient);
    filter: blur(70px);
    opacity: 0.42;
    z-index: 0;
}
.hero__portrait-frame {
    position: relative;
    z-index: 1;
    border-radius: var(--r-xl);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.hero__portrait-frame img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

.hero__code-card {
    position: absolute;
    right: -6%;
    bottom: 8%;
    z-index: 2;
    width: min(280px, 72%);
    border-radius: var(--r-md);
    background: rgba(10, 10, 18, 0.94);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    animation: float-y 6s ease-in-out infinite;
}
.hero__code-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}
.hero__code-bar span { width: 9px; height: 9px; border-radius: 50%; }
.hero__code-bar em {
    margin-left: auto;
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--text-faint);
}
.hero__code-card pre {
    margin: 0;
    padding: 0.9rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1.75;
    color: var(--text-muted);
    white-space: pre-wrap;
    word-break: break-word;
}
.hero__code-card .tok-key { color: #C4B5FD; }
.hero__code-card .tok-str { color: #6EE7B7; }
.hero__code-card .tok-fn  { color: #93C5FD; }

.hero__badge {
    position: absolute;
    left: -4%;
    top: 12%;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1.1rem 0.7rem 0.75rem;
    border-radius: var(--r-pill);
    background: rgba(10, 10, 18, 0.92);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: float-y 7s ease-in-out infinite reverse;
}
.hero__badge strong { display: block; font-size: 0.9rem; font-family: var(--font-display); }
.hero__badge small { display: block; font-size: 0.68rem; color: var(--text-faint); }

/* --- Toolbelt marquee ----------------------------------------------- */
.toolbelt { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.toolbelt__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 1.1rem;
}
.toolbelt__list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tool-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: all var(--t-fast);
}
.tool-pill:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }
.tool-pill i { color: var(--accent); }

/* =====================================================================
   HOME — CATEGORY & SERVICE TILES
   ===================================================================== */
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: clamp(1.4rem, 2.5vw, 1.9rem);
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}
.tile::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--t-base);
}
.tile:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); box-shadow: var(--shadow-md); }
.tile:hover::before { opacity: 1; }
.tile__title { font-size: 1.08rem; font-weight: 700; }
.tile__desc { font-size: 0.87rem; color: var(--text-muted); line-height: 1.65; flex: 1; }
.tile__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--text-faint);
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}
.tile__count { color: var(--accent); font-weight: 700; }
.tile__watermark {
    position: absolute;
    right: -14px;
    bottom: -18px;
    font-size: 5.5rem;
    color: var(--accent);
    opacity: 0.05;
    pointer-events: none;
}

/* =====================================================================
   HOME — PROCESS
   ===================================================================== */
.process { counter-reset: step; }
.process__item {
    position: relative;
    padding: 1.6rem 1.5rem;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all var(--t-base);
}
.process__item:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); transform: translateY(-4px); }
.process__num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--accent);
    margin-bottom: 0.85rem;
    display: block;
}
.process__item h4 { font-size: 1rem; margin-bottom: 0.5rem; }
.process__item p { font-size: 0.86rem; color: var(--text-muted); line-height: 1.65; }

/* =====================================================================
   HOME — CALL TO ACTION
   ===================================================================== */
.cta {
    position: relative;
    text-align: center;
    padding: clamp(2.75rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem);
    border-radius: var(--r-xl);
    border: 1px solid var(--border-strong);
    background:
        radial-gradient(ellipse 70% 130% at 50% 0%, rgba(99, 102, 241, 0.18), transparent 70%),
        var(--bg-elevated);
    overflow: hidden;
}
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.85rem; margin-top: 2rem; }

/* =====================================================================
   ABOUT
   ===================================================================== */
.page-hero {
    padding-top: calc(var(--header-h) + clamp(2.5rem, 6vw, 4.5rem));
    padding-bottom: clamp(1.5rem, 4vw, 3rem);
    text-align: center;
}
.page-hero__title { font-size: clamp(2.2rem, 5.2vw, 3.6rem); margin-block: 1.1rem 0.9rem; }
.page-hero__lead { color: var(--text-muted); font-size: 1.03rem; max-width: 620px; margin-inline: auto; line-height: 1.8; }

.about__grid {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
}
.about__portrait { position: sticky; top: calc(var(--header-h) + 24px); }
.about__portrait img {
    width: 100%;
    border-radius: var(--r-xl);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
}
.about__facts { display: grid; gap: 0.75rem; margin-top: 1.25rem; }
.about__fact {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.85rem;
}
.about__fact i { color: var(--accent); width: 18px; text-align: center; }
.about__fact span { color: var(--text-faint); }
.about__fact strong { margin-left: auto; font-weight: 600; text-align: right; }

.prose p { color: var(--text-muted); line-height: 1.9; margin-bottom: 1.4rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong, .prose b { color: var(--text); font-weight: 600; }
.prose .accentuate { color: var(--accent); font-weight: 600; }
.prose__lead { font-size: 1.12rem; color: var(--text) !important; font-weight: 500; }

/* --- Timeline -------------------------------------------------------- */
.timeline { position: relative; padding-left: 2.1rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, var(--indigo), var(--violet), transparent);
    opacity: 0.55;
}
.timeline__item { position: relative; margin-bottom: 1.5rem; }
.timeline__item:last-child { margin-bottom: 0; }
.timeline__dot {
    position: absolute;
    left: calc(-2.1rem + 1px);
    top: 1.9rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
.timeline__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.timeline__role { font-size: 1.12rem; font-weight: 700; color: var(--accent); }
.timeline__org { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.15rem; }
.timeline__period {
    padding: 0.32rem 0.85rem;
    border-radius: var(--r-pill);
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}
.timeline__list li {
    position: relative;
    padding-left: 1.35rem;
    margin-bottom: 0.7rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.7;
}
.timeline__list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}
.timeline__list li:last-child { margin-bottom: 0; }

/* --- Education ------------------------------------------------------- */
.education {
    position: relative;
    display: block;
    max-width: 640px;
    margin-inline: auto;
    text-align: center;
    overflow: hidden;
}
.education__watermark {
    position: absolute;
    right: -20px;
    bottom: -30px;
    font-size: 8rem;
    color: var(--accent);
    opacity: 0.05;
}
.education__degree { font-size: clamp(1.35rem, 3vw, 1.85rem); margin-bottom: 0.6rem; }
.education__school { color: var(--accent); font-weight: 600; font-size: 1.05rem; }
.education__years { color: var(--text-muted); font-size: 0.92rem; margin-top: 0.35rem; }
.education__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.4rem;
    padding: 0.45rem 1.05rem;
    border-radius: var(--r-pill);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: var(--emerald);
    font-size: 0.8rem;
    font-weight: 700;
}

/* --- Skill matrix ---------------------------------------------------- */
.skills-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}
.skills-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
}
.skills-tab:hover { color: var(--text); border-color: var(--border-strong); }
.skills-tab.is-active { background: var(--gradient); border-color: transparent; color: #fff; box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3); }
.skills-panel { display: none; }
.skills-panel.is-active { display: block; animation: fade-in 0.4s var(--ease); }
.skills-panel__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem 2.5rem; }

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

/* =====================================================================
   GALLERY — COVERFLOW
   ===================================================================== */
.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.62rem 1.25rem;
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
}
.filter-pill:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }
.filter-pill.is-active { background: var(--text); border-color: var(--text); color: #0A0A12; }
.filter-pill__count {
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding-inline: 5px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.68rem;
    font-weight: 700;
}
.filter-pill.is-active .filter-pill__count { background: rgba(0, 0, 0, 0.12); }

.coverflow {
    position: relative;
    height: clamp(340px, 46vw, 460px);
    perspective: 1600px;
    margin-bottom: 2rem;
}
.coverflow__track {
    position: relative;
    height: 100%;
    transform-style: preserve-3d;
}
.coverflow__slide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(200px, 25vw, 280px);
    height: clamp(280px, 36vw, 400px);
    margin: 0;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-lg);
    transition: transform 0.65s var(--ease), opacity 0.65s var(--ease), filter 0.65s var(--ease);
    will-change: transform;
    cursor: pointer;
}
.coverflow__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow);
}
.coverflow__slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(6, 6, 12, 0.94));
    pointer-events: none;
}
.coverflow__caption {
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    padding: 1.15rem 1.25rem;
    text-align: center;
}
.coverflow__caption h3 { font-size: 1.02rem; font-weight: 700; }
.coverflow__caption p {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-top: 0.25rem;
}
.coverflow__slide.is-active { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.coverflow__slide.is-active .coverflow__caption p { color: var(--accent); }

.coverflow__nav { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.coverflow__btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t-fast);
}
.coverflow__btn:hover { color: var(--text); background: var(--surface-hover); border-color: var(--border-strong); transform: translateY(-2px); }
.coverflow__dots { display: flex; gap: 0.4rem; align-items: center; }
.coverflow__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all var(--t-fast);
}
.coverflow__dot.is-active { width: 22px; border-radius: var(--r-pill); background: var(--gradient); }

/* =====================================================================
   CATEGORY
   ===================================================================== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 0.85rem;
    pointer-events: none;
}
.search-box input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    transition: all var(--t-fast);
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.result-count { font-size: 0.83rem; color: var(--text-faint); }

.category-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* =====================================================================
   PROJECT DETAIL
   ===================================================================== */
.project-hero {
    padding-top: calc(var(--header-h) + clamp(2rem, 5vw, 3.5rem));
    padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
    text-align: center;
}
.project-hero__title { font-size: clamp(1.9rem, 4.6vw, 3.2rem); margin-block: 1rem 0.75rem; }
.project-hero__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.viewer {
    position: relative;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #0A0A12;
}
.viewer__stage {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.viewer__stage[data-ratio="wide"] { aspect-ratio: 16 / 9; }
.viewer__slide { display: none; width: 100%; height: 100%; }
.viewer__slide.is-active { display: grid; place-items: center; animation: fade-in 0.45s var(--ease); }
.viewer__slide img,
.viewer__slide video {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: clamp(10px, 2vw, 26px);
}
.viewer__stage[data-ratio="wide"] .viewer__slide img { object-fit: cover; padding: 0; }
.viewer__slide iframe { width: 100%; height: 100%; border: 0; }

.viewer__watermark {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170' viewBox='0 0 170 170'%3E%3Ctext x='50%25' y='50%25' text-anchor='middle' fill='%23ffffff' font-family='Arial' font-size='11' letter-spacing='2' transform='rotate(-40 85 85)'%3EGADTAN PORTFOLIO%3C/text%3E%3C/svg%3E");
}

.viewer__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(8, 8, 14, 0.65);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-strong);
    color: #fff;
    cursor: pointer;
    transition: all var(--t-fast);
}
.viewer__arrow:hover { background: var(--accent); border-color: transparent; }
.viewer__arrow--prev { left: 14px; }
.viewer__arrow--next { right: 14px; }

.viewer__thumbs {
    display: flex;
    gap: 0.55rem;
    padding: 0.85rem;
    overflow-x: auto;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    scrollbar-width: thin;
}
.viewer__thumb {
    flex: 0 0 auto;
    width: 68px;
    height: 50px;
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #0E0E18;
    cursor: pointer;
    opacity: 0.5;
    padding: 0;
    transition: all var(--t-fast);
}
.viewer__thumb img { width: 100%; height: 100%; object-fit: cover; }
.viewer__thumb.is-active { opacity: 1; border-color: var(--accent); }
.viewer__thumb:hover { opacity: 0.85; }
.viewer__thumb-icon { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-faint); font-size: 0.85rem; }

/* --- Live prototype preview ------------------------------------------ */
.preview { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.preview__bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1rem;
    background: #12121C;
    border-bottom: 1px solid var(--border);
}
.preview__dots { display: flex; gap: 0.4rem; }
.preview__dots span { width: 10px; height: 10px; border-radius: 50%; }
.preview__label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.preview__tools { display: flex; gap: 0.25rem; margin-left: auto; padding: 3px; background: rgba(255, 255, 255, 0.04); border-radius: var(--r-sm); }
.preview__tool {
    width: 32px;
    height: 30px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    font-size: 0.82rem;
    transition: all var(--t-fast);
}
.preview__tool:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.preview__tool.is-active { background: var(--accent); color: #fff; }
.preview__frame { position: relative; width: 100%; padding-top: 60%; background: #fff; }
.preview__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    margin-inline: auto;
    transition: width 0.45s var(--ease);
    background: #fff;
}
.preview.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 3000;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}
.preview.is-fullscreen .preview__frame { flex: 1; padding-top: 0; }

/* --- Description ------------------------------------------------------ */
.project-body { max-width: 940px; margin-inline: auto; }
.project-prose {
    color: var(--text-muted);
    line-height: 1.9;
    font-size: 1rem;
}
.project-prose :is(h1, h2, h3, h4) { color: var(--text); margin-block: 1.6rem 0.7rem; font-size: 1.15rem; }
.project-prose p { margin-bottom: 1.1rem; }
.project-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.project-prose img { border-radius: var(--r-md); margin-block: 1.2rem; }
.project-prose ul, .project-prose ol { padding-left: 1.3rem; margin-bottom: 1.1rem; list-style: revert; }
.project-prose li { margin-bottom: 0.45rem; }
.project-prose blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.1rem;
    margin-block: 1.2rem;
    color: var(--text);
    font-style: italic;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    padding-top: 1.6rem;
    margin-top: 1.6rem;
    border-top: 1px solid var(--border);
}
.detail-meta__item span {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.3rem;
}
.detail-meta__item strong { font-size: 0.98rem; font-weight: 600; }

/* =====================================================================
   VIDEOS
   ===================================================================== */
.video-frame {
    position: relative;
    padding-top: 56.25%;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
    box-shadow: var(--shadow-lg);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* =====================================================================
   CONTACT
   ===================================================================== */
.contact__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: start;
}
.contact__info { display: grid; gap: 0.85rem; margin-top: 1.75rem; }
.contact__row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    transition: all var(--t-fast);
}
.contact__row:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.contact__row i { color: var(--accent); width: 20px; text-align: center; }
.contact__row span { display: block; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.contact__row strong { display: block; font-size: 0.92rem; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

/* =====================================================================
   LOGIN / LOCKED / ERROR
   ===================================================================== */
.page-bare { display: grid; place-items: center; min-height: 100vh; padding: 2rem 1.25rem; }
.auth-card {
    width: 100%;
    max-width: 440px;
    text-align: center;
    padding: clamp(2rem, 5vw, 3rem);
    border-radius: var(--r-xl);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}
.auth-card__icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin-inline: auto;
    margin-bottom: 1.5rem;
    border-radius: 20px;
    background: var(--gradient);
    color: #fff;
    font-size: 1.4rem;
    box-shadow: var(--glow);
}
.auth-card h1 { font-size: 1.55rem; margin-bottom: 0.6rem; }
.auth-card p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.7; }
.auth-tiers { display: grid; gap: 0.55rem; margin-block: 1.75rem; text-align: left; }
.auth-tier {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-muted);
}
.auth-tier i { color: var(--accent); }

.error-page { display: grid; place-items: center; min-height: 78vh; text-align: center; padding-top: var(--header-h); }
.error-code {
    font-family: var(--font-display);
    font-size: clamp(5rem, 18vw, 10rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 980px) {
    .hero__grid { grid-template-columns: 1fr; text-align: center; }
    .hero__lead { margin-inline: auto; }
    .hero__actions, .toolbelt__list { justify-content: center; }
    .hero__portrait { order: -1; width: min(100%, 340px); }
    .hero__code-card { right: -2%; width: min(240px, 68%); }
    .hero__badge { left: -2%; }
    .about__grid { grid-template-columns: 1fr; }
    .about__portrait { position: static; max-width: 380px; margin-inline: auto; }
    .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .hero__stats { gap: 0.5rem; }
    .hero__code-card { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .timeline { padding-left: 1.5rem; }
    .timeline__dot { left: calc(-1.5rem + 2px); width: 13px; height: 13px; }
    .viewer__arrow { width: 36px; height: 36px; }
    .preview__label { display: none; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-box { max-width: none; }
}
