/* ═══════════════════════════════════════════════════════════════════════════
   DASCĂU SEVERIUS — CONSILIER
   Full-Card Laser Genesis Engine · True 100dvh Elastic Proportional Layout
   Fits 375x667 (iPhone SE) to 430x932 (Pro Max) & Desktop with ZERO clipping & ZERO bottom gap
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --obsidian-void: #02050a;
    --obsidian-deep: #050b14;
    --obsidian-card: #091220;
    --obsidian-glass: rgba(9, 18, 32, 0.82);
    --gold-24k: #d4af37;
    --gold-bright: #f6e099;
    --gold-warm: #e5c158;
    --gold-hot: #fff8e6;
    --gold-line: rgba(212, 175, 55, 0.36);
    --gold-faint: rgba(212, 175, 55, 0.14);
    --ivory: #f8f5ec;
    --ivory-soft: #d5cfc0;
    --slate-muted: #94a3b8;

    --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;

    --tilt-x: 50%;
    --tilt-y: 28%;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: var(--obsidian-void);
    color: var(--ivory);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

body {
    display: flex;
    justify-content: center;
    align-items: stretch;
    background-image:
        radial-gradient(circle at var(--tilt-x) var(--tilt-y), rgba(212, 175, 55, 0.08) 0%, transparent 55%),
        radial-gradient(120% 90% at 50% 0%, #0a1526 0%, var(--obsidian-deep) 52%, var(--obsidian-void) 100%);
}

/* ── Monolith Frame: Strictly 100dvh Elastic Container ── */
.sovereign-frame {
    position: relative;
    width: 100%;
    max-width: 460px;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: clamp(16px, 4.5vw, 24px);
    padding-right: clamp(16px, 4.5vw, 24px);
    overflow: hidden;
}

/* ── Full-Card Optical Laser Canvas (4 Ultra-Thin Corner Laser Threads) ── */
#card-laser-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 60;
}

/* ── Outer Double Filigree Frame (Phase 1) ── */
.frame-borders {
    position: absolute;
    inset: 7px;
    pointer-events: none;
    z-index: 2;
}

.frame-borders svg {
    width: 100%;
    height: 100%;
    display: block;
}

.frame-rect-outer {
    fill: none;
    stroke: var(--gold-line);
    stroke-width: 1.25;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.frame-rect-inner {
    fill: none;
    stroke: var(--gold-faint);
    stroke-width: 0.8;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

/* ── Laser-Drawn Progressive Reveal Utility ── */
.laser-unit {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transition: opacity 0.12s linear;
}

.laser-unit.laser-done {
    opacity: 1 !important;
    clip-path: inset(0 0% 0 0) !important;
}

/* ── Top Bar: Owner QR Button [⊞ QR] & Bilingual Switcher [RO | EN] ── */
.top-telemetry-bar {
    position: relative;
    z-index: 6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 2px 0;
    flex: 0 0 auto;
}

.btn-owner-qr {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(9, 18, 32, 0.88);
    border: 1px solid var(--gold-line);
    color: var(--gold-bright);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-owner-qr svg {
    width: 13px;
    height: 13px;
    stroke: var(--gold-24k);
    fill: none;
    stroke-width: 2;
}

.btn-owner-qr:hover, .btn-owner-qr.active {
    background: var(--gold-24k);
    color: #02050a;
    border-color: var(--gold-bright);
}

.btn-owner-qr:hover svg, .btn-owner-qr.active svg {
    stroke: #02050a;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(9, 18, 32, 0.88);
    border: 1px solid var(--gold-line);
    border-radius: 16px;
    padding: 2px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--slate-muted);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn.active {
    background: var(--gold-24k);
    color: #02050a;
}

/* ── Hero Anubis Stage & Laser-Written Identity (Elastic Proportional) ── */
.hero-forge {
    position: relative;
    z-index: 5;
    text-align: center;
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(2px, 0.8dvh, 12px) 0 clamp(4px, 1.2dvh, 14px);
}

.emblem-stage {
    position: relative;
    height: clamp(118px, 21.5dvh, 215px);
    width: clamp(106px, 19.3dvh, 194px);
    margin: 0 auto clamp(3px, 0.8dvh, 10px);
    cursor: pointer;
    filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.72));
}

.anubis-emblem-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.laser-path {
    fill: url(#gold24k);
    fill-opacity: 0;
    stroke: var(--gold-hot);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: fill-opacity 0.28s ease, stroke 0.28s ease, stroke-width 0.28s ease;
}

.laser-path.burned {
    fill-opacity: 1;
    stroke: var(--gold-24k);
    stroke-width: 0.3;
}

.identity-block {
    position: relative;
    padding: 0 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.person-name {
    font-family: var(--font-serif);
    font-size: clamp(20px, min(6.2vw, 3.3dvh), 31px);
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #f8f5ec 0%, #f6e099 45%, #d4af37 82%, #f8f5ec 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: clamp(1px, 0.4dvh, 5px);
    line-height: 1.15;
}

.person-role {
    font-size: clamp(11.5px, min(3.4vw, 1.8dvh), 15.5px);
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold-warm);
}

/* ── 2-Tab Client Navigation (Contact | Portofoliu) ── */
.chamber-nav {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin: 0 0 clamp(6px, 1.1dvh, 12px);
    padding: 3.5px;
    background: rgba(5, 11, 20, 0.9);
    border: 1px solid var(--gold-line);
    border-radius: 8px;
    flex: 0 0 auto;
}

.chamber-tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--ivory-soft);
    font-family: var(--font-sans);
    font-size: clamp(12px, 1.8dvh, 14px);
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: clamp(6px, 1.05dvh, 10px) 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.22s ease;
    text-align: center;
    white-space: nowrap;
}

.chamber-tab.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0.08));
    border-color: var(--gold-24k);
    color: var(--gold-bright);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.14);
}

/* ── Elastic Stage Area: Fills 100% of Remaining Height down to Bottom Border ── */
.chamber-stage {
    position: relative;
    z-index: 5;
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 1px 2px;
}

.chamber-pane {
    display: none;
    flex: 1 1 0%;
    min-height: 0;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(5px, 1.05dvh, 11px);
}

.chamber-pane.active {
    display: flex;
}

/* ── Elastic Action Cards: Auto-Scale to Fill Exactly 100% of Stage Height ── */
#chamber-identity .forge-item {
    flex: 1 1 0%;
    min-height: 0;
}

.forge-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 11px;
    padding: clamp(6px, 1.2dvh, 14px) 13px;
    background: var(--obsidian-glass);
    border: 1px solid var(--gold-line);
    border-radius: 7px;
    color: var(--ivory);
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
}

.forge-item:hover, .forge-item:active {
    border-color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.1);
}

.forge-item-left {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    flex: 1;
}

.forge-icon {
    width: clamp(28px, 4.3dvh, 36px);
    height: clamp(28px, 4.3dvh, 36px);
    border-radius: 6px;
    background: rgba(212, 175, 55, 0.09);
    border: 1px solid var(--gold-line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-bright);
    flex-shrink: 0;
}

.forge-icon svg {
    width: clamp(14px, 2.1dvh, 17px);
    height: clamp(14px, 2.1dvh, 17px);
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.forge-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    text-align: left;
}

.forge-label {
    font-size: clamp(9.5px, 1.35dvh, 11px);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-warm);
    line-height: 1.2;
}

.forge-val {
    font-size: clamp(12.5px, 1.95dvh, 15px);
    font-weight: 600;
    color: var(--ivory);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.forge-arrow {
    color: var(--gold-24k);
    font-size: clamp(13px, 1.9dvh, 15px);
    font-weight: 700;
    flex-shrink: 0;
}

/* Primary 24K Gold CTA Button — Anchored at the Bottom */
.btn-sovereign-gold {
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    padding: clamp(10px, 1.8dvh, 16px) 16px;
    border-radius: 7px;
    border: 1px solid var(--gold-bright);
    background: linear-gradient(135deg, #f3d88b 0%, #d4af37 48%, #a67e24 100%);
    color: #040811;
    font-family: var(--font-sans);
    font-size: clamp(12.5px, 1.85dvh, 14.5px);
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.22);
    transition: transform 0.15s;
}

.btn-sovereign-gold:active {
    transform: scale(0.985);
}

.btn-sovereign-gold svg {
    width: clamp(16px, 2.2dvh, 19px);
    height: clamp(16px, 2.2dvh, 19px);
    stroke: #040811;
    fill: none;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Portfolio Grid (6 Domains + Details Card, Elastic Fit) ── */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, 1fr);
    gap: clamp(5px, 1dvh, 9px);
    flex: 1 1 0%;
    min-height: 0;
}

.portfolio-domain-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(6px, 1.1dvh, 12px) 11px;
    background: var(--obsidian-glass);
    border: 1px solid var(--gold-line);
    border-radius: 7px;
    color: var(--ivory);
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
}

.portfolio-domain-card:hover, .portfolio-domain-card:active {
    border-color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.1);
}

.domain-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.domain-tag {
    font-size: clamp(8.5px, 1.2dvh, 10px);
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--gold-warm);
}

.domain-host {
    font-size: clamp(11.5px, 1.75dvh, 13.5px);
    font-weight: 700;
    color: var(--ivory);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-desc {
    font-size: clamp(9.5px, 1.4dvh, 11px);
    color: var(--slate-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Corporate / Contact Summary Card in Portfolio */
.protocol-card {
    background: var(--obsidian-glass);
    border: 1px solid var(--gold-line);
    border-radius: 8px;
    padding: clamp(8px, 1.3dvh, 12px) 12px;
    flex: 0 0 auto;
}

.protocol-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: clamp(4px, 0.8dvh, 7px);
    padding-bottom: clamp(4px, 0.7dvh, 6px);
    border-bottom: 1px solid var(--gold-faint);
}

.protocol-title {
    font-size: clamp(10px, 1.45dvh, 11.5px);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-bright);
}

.btn-copy-inline {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold-line);
    color: var(--gold-bright);
    font-size: clamp(10px, 1.4dvh, 11px);
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.protocol-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: clamp(2.5px, 0.55dvh, 4.5px) 0;
    border-bottom: 1px dashed rgba(212, 175, 55, 0.12);
    font-size: clamp(11px, 1.6dvh, 12.5px);
}

.protocol-row:last-of-type {
    border-bottom: none;
}

.protocol-key {
    color: var(--slate-muted);
    font-size: clamp(9.5px, 1.35dvh, 11px);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.protocol-val {
    color: var(--ivory);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Owner Mode: Surgical Laser QR Stage (Opened via Top-Left [⊞ QR]) ── */
.qr-forge-card {
    background: var(--obsidian-glass);
    border: 1px solid var(--gold-line);
    border-radius: 10px;
    padding: clamp(8px, 1.5dvh, 14px);
    text-align: center;
    position: relative;
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qr-mode-pills {
    display: inline-flex;
    background: rgba(5, 11, 20, 0.9);
    border: 1px solid var(--gold-line);
    border-radius: 16px;
    padding: 2px;
    margin-bottom: clamp(4px, 0.9dvh, 8px);
}

.qr-mode-btn {
    background: transparent;
    border: none;
    color: var(--slate-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 13px;
    cursor: pointer;
}

.qr-mode-btn.active {
    background: var(--gold-24k);
    color: #02050a;
}

.qr-canvas-stage {
    position: relative;
    width: clamp(150px, 24dvh, 210px);
    height: clamp(150px, 24dvh, 210px);
    margin: 0 auto clamp(4px, 0.9dvh, 8px);
    padding: 8px;
    background: #030710;
    border: 1.2px solid var(--gold-24k);
    border-radius: 10px;
    box-shadow: 0 0 22px rgba(212, 175, 55, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#qr-laser-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.qr-sub-caption {
    font-size: clamp(10.5px, 1.5dvh, 12px);
    color: var(--ivory-soft);
    line-height: 1.35;
}

.qr-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 0 0 auto;
}

/* ── Bottom Drawers ── */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 5, 11, 0.78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.drawer-backdrop.active {
    display: flex;
}

.sovereign-drawer {
    width: 100%;
    max-width: 460px;
    background: var(--obsidian-card);
    border-top: 2px solid var(--gold-24k);
    border-radius: 16px 16px 0 0;
    padding: 20px 20px max(22px, env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.8);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.drawer-title {
    font-family: var(--font-serif);
    font-size: 18px;
    color: var(--gold-bright);
}

.btn-close-drawer {
    background: transparent;
    border: 1px solid var(--gold-line);
    color: var(--ivory);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}

.handshake-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--gold-line);
    color: var(--ivory);
    font-family: var(--font-sans);
    font-size: 14px;
    margin-bottom: 10px;
}

.handshake-input:focus {
    outline: none;
    border-color: var(--gold-bright);
}

/* ── Toast (Strictly Hidden Off-Screen Unless .visible) ── */
.sovereign-toast {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    left: 50%;
    transform: translate(-50%, -220%);
    opacity: 0;
    pointer-events: none;
    background: rgba(9, 18, 32, 0.96);
    border: 1px solid var(--gold-24k);
    color: var(--gold-bright);
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    z-index: 200;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
    white-space: nowrap;
}

.sovereign-toast.visible {
    transform: translate(-50%, 0);
    opacity: 1;
}
