@font-face { font-family: 'Ola'; src: url('../fonts/Ola.ttf') format('truetype'); }
@font-face { font-family: 'TA-Basheer'; src: url('../fonts/TA-Basheer.otf') format('opentype'); }
@font-face { font-family: 'TA-Kadal'; src: url('../fonts/TA-Kadal.ttf') format('truetype'); }
@font-face { font-family: 'TA-Kairali'; src: url('../fonts/TA-Kairali.otf') format('opentype'); }
@font-face { font-family: 'TA-Mizhav'; src: url('../fonts/TA-Mizhav.ttf') format('truetype'); }
@font-face { font-family: 'TA-Mukil'; src: url('../fonts/TA-Mukil.ttf') format('truetype'); }
@font-face { font-family: 'TA-Sakhav new'; src: url('../fonts/TA-Sakhav new.otf') format('opentype'); }
@font-face { font-family: 'ML-TA-Adri'; src: url('../fonts/ML-TA-Adri.otf') format('opentype'); }
@font-face { font-family: 'ML-TA-Anandhi'; src: url('../fonts/ML-TA-Anandhi.otf') format('opentype'); }
@font-face { font-family: 'ML-TA-Malli'; src: url('../fonts/ML-TA-Malli.otf') format('opentype'); }
@font-face { font-family: 'TA-Vaaka'; src: url('../fonts/TA-Vaaka.ttf') format('truetype'); }

:root {
    --bg-deep: #050914;
    --surface: rgba(255, 255, 255, 0.075);
    --surface-strong: rgba(255, 255, 255, 0.12);
    --line: rgba(255, 255, 255, 0.14);
    --text: #f7fbff;
    --muted: #9bacbd;
    --primary: #2f7cff;
    --primary-2: #23c4d7;
    --green: #2dd77d;
    --danger: #ff5f73;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    --radius: 22px;
    --font: "Segoe UI", Tahoma, Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: var(--font);
    line-height: 1.55;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

option {
    background: var(--bg-deep);
    color: var(--text);
}

.site-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 18% 8%, rgba(47, 124, 255, 0.35), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(35, 196, 215, 0.24), transparent 24%),
        linear-gradient(135deg, #08111f 0%, #101827 48%, #050914 100%);
}

.site-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.container {
    width: min(1160px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 9, 20, 0.78);
    backdrop-filter: blur(18px);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand,
.header-actions,
.site-nav,
.hero-actions,
.hero-metrics,
.frame-info,
.tool-grid,
.control-row,
.admin-topbar,
.stat-grid,
.table-actions {
    display: flex;
    align-items: center;
}

.brand {
    gap: 0.85rem;
    min-width: 0;
}

.brand-logo {
    width: auto;
    height: 38px;
    max-width: 162px;
    object-fit: contain;
}

.brand-copy {
    display: grid;
    gap: 0.05rem;
}

.brand-copy strong {
    font-weight: 850;
    letter-spacing: 0;
}

.brand-copy small,
.frame-info span,
.panel-title span,
.metric-card span,
.fine-print,
.latest-label,
th {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-nav {
    gap: 1.1rem;
    color: var(--muted);
    font-weight: 650;
}

.site-nav a:hover {
    color: var(--text);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: white;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 999px;
    padding: 0.82rem 1.15rem;
    min-height: 44px;
    color: white;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 18px 42px rgba(47, 124, 255, 0.28);
}

.button.secondary {
    background: rgba(35, 196, 215, 0.15);
    border: 1px solid rgba(35, 196, 215, 0.28);
}

.button.ghost {
    background: var(--surface);
    border: 1px solid var(--line);
}

.button.success {
    background: linear-gradient(135deg, #19b96b, var(--green));
    color: #03130b;
}

.button.danger {
    background: rgba(255, 95, 115, 0.14);
    border: 1px solid rgba(255, 95, 115, 0.28);
    color: #ffdce2;
}

.button.large {
    padding: 1rem 1.35rem;
}

.button.small {
    min-height: 38px;
    padding: 0.58rem 0.82rem;
    font-size: 0.86rem;
}

.full-button {
    width: 100%;
}

.glass-panel,
.frame-card,
.metric-card,
.step-item,
.empty-state,
.admin-card {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--surface-strong), rgba(255, 255, 255, 0.055));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero {
    padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
    gap: clamp(1.2rem, 3vw, 2rem);
    align-items: stretch;
}

.hero-copy {
    min-height: 520px;
    display: grid;
    align-content: center;
    padding: clamp(1.25rem, 4vw, 3rem);
}

.hero-copy h1,
.section-head h2,
.panel-title h1 {
    margin: 0;
    letter-spacing: 0;
    line-height: 1.02;
}

.hero-copy h1 {
    max-width: 760px;
    font-size: clamp(2.5rem, 6.4vw, 5.7rem);
}

.hero-copy p,
.section-head p,
.empty-state p,
.admin-card p {
    color: var(--muted);
}

.hero-copy p {
    max-width: 660px;
    margin: 1.1rem 0 1.6rem;
    font-size: clamp(1rem, 2vw, 1.22rem);
}

.hero-actions,
.hero-metrics {
    gap: 0.85rem;
    flex-wrap: wrap;
}

.hero-metrics {
    margin-top: 1.5rem;
}

.metric-card {
    min-width: 136px;
    padding: 1rem 1.1rem;
    border-radius: 18px;
}

.metric-card strong {
    display: block;
    font-size: 1.7rem;
    line-height: 1;
}

.hero-panel {
    display: grid;
    place-items: center;
    padding: 1.1rem;
    border-radius: 30px;
}

.phone-preview {
    width: min(100%, 350px);
    border-radius: 32px;
    padding: 0.8rem;
    background: #02040a;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.phone-toolbar {
    display: flex;
    gap: 0.35rem;
    padding: 0.35rem 0.35rem 0.8rem;
}

.phone-toolbar span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
}

.phone-canvas {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(47, 124, 255, 0.22), rgba(35, 196, 215, 0.08)),
        #111827;
}

.preview-frame {
    position: absolute;
    width: 78%;
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.35));
}

.preview-frame-1 {
    transform: translate(0, 0) rotate(-2deg);
    z-index: 3;
}

.preview-frame-2 {
    transform: translate(-42%, 12%) scale(0.72) rotate(-9deg);
    opacity: 0.68;
}

.preview-frame-3 {
    transform: translate(42%, -10%) scale(0.68) rotate(8deg);
    opacity: 0.52;
}

.empty-preview {
    padding: 1rem;
    color: var(--muted);
    text-align: center;
}

.section {
    padding: clamp(2.5rem, 5vw, 4.5rem) 0;
}

.alt-section {
    background: rgba(255, 255, 255, 0.025);
}

.section-head {
    max-width: 760px;
    margin-bottom: 1.3rem;
}

.section-head h2 {
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.section-head.compact {
    margin: 0;
}

.frame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.1rem;
}

.frame-card {
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.frame-card:hover {
    transform: translateY(-4px);
    border-color: rgba(35, 196, 215, 0.45);
}

.frame-preview {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.28);
}

.frame-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.frame-card:hover .frame-preview img {
    transform: scale(1.035);
}

.latest-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    background: rgba(35, 196, 215, 0.2);
    color: #c9fbff;
    border: 1px solid rgba(35, 196, 215, 0.34);
}

.frame-info {
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem;
}

.frame-info h3 {
    margin: 0.1rem 0 0;
    font-size: 1.04rem;
}

.frame-info b {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--surface);
}

.how-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
    gap: 1.4rem;
    align-items: start;
}

.step-list {
    display: grid;
    gap: 0.8rem;
}

.step-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    border-radius: 18px;
    padding: 1rem;
}

.step-item strong {
    color: #90eaf2;
}

.site-footer {
    padding: 2rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 1.2rem;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
}

.footer-grid > div {
    display: grid;
    align-content: start;
    gap: 0.45rem;
}

.footer-logo {
    width: auto;
    height: 44px;
    object-fit: contain;
}

.footer-grid h4,
.footer-grid p {
    margin: 0;
}

.footer-grid p,
.footer-grid a,
.footer-bar,
.editor-tip {
    color: var(--muted);
}

.footer-bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    font-size: 0.9rem;
}

.editor-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 1.2rem;
    padding-top: 1.2rem;
    padding-bottom: 2rem;
}

.editor-stage {
    display: grid;
    gap: 0.85rem;
    justify-items: center;
}

.canvas-wrap {
    position: relative;
    width: min(100%, 720px);
    aspect-ratio: 1;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #101827;
    box-shadow: var(--shadow);
}

#editor-canvas,
#poster-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    cursor: move;
}

.upload-hint {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 0.25rem;
    text-align: center;
    padding: 1rem;
    background: rgba(5, 9, 20, 0.72);
    pointer-events: none;
}

.upload-hint strong {
    font-size: 1.35rem;
}

.upload-hint span {
    color: var(--muted);
}

.upload-hint.hidden {
    opacity: 0;
}

.editor-panel {
    align-self: start;
    position: sticky;
    top: 96px;
    display: grid;
    gap: 1rem;
    padding: 1.1rem;
    border-radius: 26px;
}

.panel-title h1 {
    margin-top: 0.25rem;
    font-size: 1.6rem;
}

.control-group {
    display: grid;
    gap: 0.65rem;
}

.control-row {
    justify-content: space-between;
    color: var(--muted);
    font-weight: 750;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary-2);
}

.tool-grid {
    gap: 0.7rem;
}

.tool-grid .button {
    flex: 1;
}

.fine-print {
    margin: 0;
    text-align: center;
}

.empty-state {
    grid-column: 1 / -1;
    display: grid;
    justify-items: start;
    gap: 0.65rem;
    padding: 1.3rem;
    border-radius: var(--radius);
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

.admin-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1rem;
    min-height: 100vh;
    padding: 1rem;
}

.admin-sidebar {
    position: sticky;
    top: 1rem;
    align-self: start;
    border-radius: 26px;
    padding: 1rem;
}

.admin-nav {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

.admin-nav a {
    padding: 0.82rem 0.9rem;
    border-radius: 16px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}

.admin-nav a.active,
.admin-nav a:hover {
    color: var(--text);
    background: rgba(47, 124, 255, 0.16);
}

.admin-main {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.admin-topbar {
    justify-content: space-between;
    gap: 1rem;
    border-radius: 26px;
    padding: 1rem 1.1rem;
}

.admin-topbar h1,
.admin-card h2 {
    margin: 0;
}

.stat-grid {
    gap: 1rem;
    align-items: stretch;
}

.stat-grid .metric-card {
    flex: 1;
}

.admin-card {
    padding: 1.1rem;
    border-radius: 26px;
}

.admin-form {
    display: grid;
    gap: 1rem;
    max-width: 720px;
}

.admin-form label {
    display: grid;
    gap: 0.45rem;
    color: var(--muted);
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.92rem 1rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
}

input[type="file"] {
    padding: 0.78rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.85rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    vertical-align: middle;
}

.thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
}

.table-actions {
    gap: 0.45rem;
    flex-wrap: wrap;
}

.inline-admin-form {
    display: none;
}

td input,
td select {
    min-width: 160px;
    padding: 0.68rem 0.78rem;
    border-radius: 12px;
}

.flash {
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--line);
}

.flash.success {
    border-color: rgba(45, 215, 125, 0.32);
    background: rgba(45, 215, 125, 0.12);
}

.flash.error {
    border-color: rgba(255, 95, 115, 0.36);
    background: rgba(255, 95, 115, 0.12);
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-panel {
    width: min(100%, 440px);
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 28px;
}

.hidden {
    display: none !important;
}

.panel-divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 0.5rem 0;
}

.color-picker {
    padding: 0.2rem 0.5rem;
    height: 48px;
    cursor: pointer;
}

@media (max-width: 960px) {
    .hero-grid,
    .how-grid,
    .editor-shell,
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        min-height: auto;
    }

    .editor-panel,
    .admin-sidebar {
        position: static;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(100%, calc(100% - 20px));
    }

    .header-inner {
        min-height: auto;
        padding: 0.75rem 0;
    }

    .brand-logo {
        height: 28px;
        max-width: none;
    }

    .brand-copy {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 10px;
        right: 10px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 0.8rem;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(5, 9, 20, 0.96);
    }

    .site-nav.open {
        display: flex;
    }

    .header-actions .button {
        padding: 0.7rem 0.86rem;
        font-size: 0.84rem;
    }

    .hero-copy {
        padding: 1rem 0;
    }

    .hero-copy h1 {
        font-size: clamp(2.3rem, 13vw, 4rem);
    }

    .hero-actions .button,
    .tool-grid,
    .stat-grid,
    .footer-bar {
        width: 100%;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-grid > div {
        justify-items: center;
    }

    .frame-grid {
        grid-template-columns: 1fr;
    }

    .admin-shell {
        padding: 0.6rem;
    }

    th,
    td {
        padding: 0.65rem;
    }
}
