/* ============================================
    OMNIA — Global Stylesheet
    Styleguide Compliant • Premium Dark Theme
   ============================================ */

/* ========== CSS VARIABLES (Design Tokens) ========== */
:root {
    /* Backgrounds & Text */
    --color-bg: #050508;
    --color-bg-rgb: 5, 5, 8;
    --color-text: #ffffff;
    --color-text-rgb: 255, 255, 255;
    --color-text-muted: #a0a0b0;

    /* Brand Colors */
    --color-primary: #56167d;
    --color-primary-light: #7a22ad;
    --color-primary-glow: rgba(86, 22, 125, 0.5);
    --color-secondary: #005b85;

    /* Accents */
    --color-accent-red: #c8003b;
    --color-accent-yellow: #fcbf4a;

    /* Surfaces / Glassmorphism */
    --color-surface: rgba(255, 255, 255, 0.05);
    --color-surface-hover: rgba(255, 255, 255, 0.08);
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-strong: rgba(255, 255, 255, 0.2);
    --color-surface-solid: #110e16;
    --color-surface-deep: #0a0a10;
    --color-elevated: #15121f;
    --color-overlay-soft: rgba(5, 5, 8, 0.82);
    --color-overlay-strong: rgba(5, 5, 8, 0.92);
    --color-header-bg: rgba(5, 5, 8, 0.85);
    --color-header-mobile-bg: rgba(5, 5, 8, 0.98);
    --color-input-bg: rgba(255, 255, 255, 0.05);
    --color-tag-bg: rgba(255, 255, 255, 0.03);
    --color-scroll-track: rgba(20, 15, 25, 0.5);
    --color-scroll-thumb-1: rgba(86, 22, 125, 0.7);
    --color-scroll-thumb-2: rgba(122, 34, 173, 0.6);
    --color-scroll-thumb-hover-1: rgba(122, 34, 173, 0.9);
    --color-scroll-thumb-hover-2: rgba(86, 22, 125, 0.8);
    --color-scroll-thumb-border: rgba(86, 22, 125, 0.3);
    --color-hero-overlay-start: rgba(5, 5, 8, 0.6);
    --color-hero-overlay-end: rgba(5, 5, 8, 0.75);
    --hero-bg-image: url('../assets/backgorunds/OMNIA_bg_SitioWeb.png');
    --color-gradient-soft-start: rgba(86, 22, 125, 0.05);
    --color-footer-end: rgba(0, 0, 0, 0.8);
    --header-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);

    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --omnia-viewport-height: 100vh;
    --omnia-safe-top: env(safe-area-inset-top, 0px);
    --omnia-safe-right: env(safe-area-inset-right, 0px);
    --omnia-safe-bottom: env(safe-area-inset-bottom, 0px);
    --omnia-safe-left: env(safe-area-inset-left, 0px);

    /* Radii */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;

    /* Effects */
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --glow-text: 0 0 20px rgba(86, 22, 125, 0.4);
    --backdrop-blur: blur(12px);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

:root {
    color-scheme: dark;
}

:root[data-theme="light"] {
    color-scheme: light;
    --color-bg: #ffffff;
    --color-bg-rgb: 255, 255, 255;
    --color-text: #15182c;
    --color-text-rgb: 21, 24, 44;
    --color-text-muted: #4d5670;
    --color-primary: #005b85;
    --color-primary-light: #005b85;
    --color-primary-glow: rgba(0, 91, 133, 0.18);
    --color-surface: #ffffff;
    --color-surface-hover: #ffffff;
    --color-border: rgba(24, 27, 44, 0.14);
    --color-border-strong: rgba(24, 27, 44, 0.28);
    --color-surface-solid: #ffffff;
    --color-surface-deep: #ffffff;
    --color-elevated: #ffffff;
    --color-overlay-soft: rgba(255, 255, 255, 0.96);
    --color-overlay-strong: rgba(255, 255, 255, 0.98);
    --color-header-bg: rgba(255, 255, 255, 0.98);
    --color-header-mobile-bg: rgba(255, 255, 255, 0.99);
    --color-input-bg: #ffffff;
    --color-tag-bg: #ffffff;
    --color-scroll-track: #ffffff;
    --color-scroll-thumb-1: rgba(0, 91, 133, 0.46);
    --color-scroll-thumb-2: rgba(0, 91, 133, 0.46);
    --color-scroll-thumb-hover-1: rgba(0, 91, 133, 0.62);
    --color-scroll-thumb-hover-2: rgba(0, 91, 133, 0.62);
    --color-scroll-thumb-border: rgba(0, 91, 133, 0.24);
    --color-hero-overlay-start: rgba(255, 255, 255, 0.7);
    --color-hero-overlay-end: rgba(255, 255, 255, 0.85);
    --hero-bg-image: url('../assets/backgorunds/OMNIA_bg_SitioWeb_lightmode.jpg');
    --color-gradient-soft-start: #f3f7ff;
    --color-footer-end: #f5f8ff;
    --shadow-soft: 0 16px 36px -28px rgba(20, 24, 44, 0.28);
    --glow-text: none;
    --backdrop-blur: none;
    --header-shadow: 0 8px 26px rgba(24, 27, 44, 0.12);
}

html[data-theme="light"] body.theme-procesos {
    --color-primary-light: #c8003b;
    --color-primary-glow: rgba(200, 0, 59, 0.09);
}

html[data-theme="light"] body.theme-herramientas {
    --color-primary-light: #005b85;
    --color-primary-glow: rgba(0, 91, 133, 0.09);
}

html[data-theme="light"] body.theme-tendencias {
    --color-primary-light: #56167d;
    --color-primary-glow: rgba(86, 22, 125, 0.09);
}

/* ========== BLOG THEMES (Categorías) ========== */
body.theme-procesos {
    --color-primary: #c8003b;
    --color-primary-light: #ef5350;
    --color-primary-glow: rgba(200, 0, 59, 0.5);
}

body.theme-herramientas {
    --color-primary: #005b85;
    --color-primary-light: #4fc3f7;
    --color-primary-glow: rgba(0, 91, 133, 0.5);
}

body.theme-tendencias {
    --color-primary: #56167d;
    --color-primary-light: #7a22ad;
    --color-primary-glow: rgba(86, 22, 125, 0.5);
}

/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: var(--omnia-viewport-height);
    overflow-x: hidden;
}

@supports (-webkit-touch-callout: none) {
    @media (hover: none) and (pointer: coarse) {
        html.is-iphone-webkit body,
        html.is-iphone-webkit .placeholder-page,
        html.is-iphone-webkit .portfolio-hero,
        html.is-iphone-webkit .hero {
            min-height: var(--omnia-viewport-height);
        }

        html.is-ios-webkit .hero {
            background-attachment: scroll;
            background-position: center top;
        }
    }
}

html.is-scroll-locked,
body.is-scroll-locked {
    overscroll-behavior: none;
}

/* ========== OMNIA: Scrollbar Styling ========== */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-scroll-thumb-1) var(--color-scroll-track);
}

/* Chrome, Edge, Safari (webkit) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-scroll-track);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-scroll-thumb-1), var(--color-scroll-thumb-2));
    border-radius: 4px;
    border: 1px solid var(--color-scroll-thumb-border);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-scroll-thumb-hover-1), var(--color-scroll-thumb-hover-2));
}

/* Hide scrollbar arrows/buttons */
::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

ul,
ol {
    list-style: none;
}

/* ========== UTILITIES ========== */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #ffffff;
    box-shadow: 0 4px 20px var(--color-primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--color-primary-glow);
}

html[data-theme="light"] .btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: none;
}

html[data-theme="light"] .btn-primary:hover {
    background: var(--color-primary);
    box-shadow: none;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    backdrop-filter: var(--backdrop-blur);
}

.btn-secondary:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-strong);
}

/* ========== HEADER ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    background: var(--color-header-bg);
    backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--color-border);
}

.header.is-scrolled {
    box-shadow: var(--header-shadow);
}

.header__container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 1.5rem;
}

.header__logo {
    flex-shrink: 0;
}

.header__logo img {
    height: 55px;
    width: auto;
}

/* Larger logo on desktop */
@media (min-width: 992px) {
    .header__logo img {
        height: 65px;
    }
}

.header__tagline {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: none;
}

@media (min-width: 768px) {
    .header__tagline {
        display: block;
    }
}

/* Rotating Phrase Styles */
.rotating-phrase-container {
    display: none;
    /* Hidden on mobile by default, like tagline */
    font-size: 0.75rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    /* Remove fixed height, let grid dictate it */
    position: relative;
    margin-right: auto;
    margin-left: 2rem;
}

@media (min-width: 768px) {
    .rotating-phrase-container {
        display: block;
    }
}

.rotating-phrase {
    display: grid;
    grid-template-areas: "stack";
    align-items: center;
    margin: 0;
    padding: 0;
}

.phrase {
    grid-area: stack;
    width: max-content;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    white-space: nowrap;
}

.phrase--active {
    opacity: 1;
    z-index: 1;
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .phrase {
        transition: none;
        opacity: 0;
    }

    .phrase:first-child {
        opacity: 1;
    }

    .phrase--active {
        opacity: 0;
    }

    .phrase:first-child {
        opacity: 1 !important;
    }
}

.header__nav {
    margin-left: auto;
}

@media (min-width: 768px) {
    .header__nav {
        order: 2;
        margin-left: auto;
    }

    .theme-toggle {
        order: 3;
        margin-left: 1rem;
        margin-right: 0;
    }
}

.header__nav-list {
    display: flex;
    gap: 2rem;
}

.header__nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
    position: relative;
}

.header__nav-link:hover,
.header__nav-link.active {
    color: var(--color-text);
}

.header__nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-normal);
}

.header__nav-link:hover::after,
.header__nav-link.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.header__menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}

.theme-toggle {
    margin-left: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.55rem 0.35rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text);
    backdrop-filter: var(--backdrop-blur);
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-hover);
}

.theme-toggle__status {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.theme-toggle[data-mode="auto"] .theme-toggle__status {
    color: var(--color-primary-light);
}

.theme-toggle__switch {
    width: 42px;
    height: 22px;
    border-radius: 999px;
    background: rgba(var(--color-text-rgb), 0.16);
    border: 1px solid rgba(var(--color-text-rgb), 0.22);
    position: relative;
    transition: all var(--transition-normal);
}

.theme-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform var(--transition-normal);
}

html[data-theme="dark"] .theme-toggle__thumb {
    transform: translateX(20px);
}

html[data-theme="light"] .theme-toggle__switch {
    background: rgba(var(--color-text-rgb), 0.08);
    border-color: rgba(var(--color-text-rgb), 0.16);
}

.theme-toggle.theme-toggle--floating {
    position: fixed;
    top: auto;
    right: auto;
    left: max(1rem, env(safe-area-inset-left));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1200;
    background: var(--color-elevated);
    box-shadow: 0 14px 36px -20px rgba(12, 18, 34, 0.45);
}

html[data-theme="light"] .theme-toggle.theme-toggle--floating {
    border-color: rgba(24, 27, 44, 0.22);
    box-shadow: 0 16px 34px -18px rgba(20, 24, 44, 0.25);
}

.header__menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    transition: all var(--transition-normal);
    transform-origin: center;
}

.header__menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header__menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.header__menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Navigation */
@media (max-width: 767px) {
    .header__container {
        gap: 0.75rem;
    }

    .header__logo img {
        height: 46px;
    }

    .header__menu-toggle {
        display: flex;
        order: 3;
        margin-left: 0;
        flex-shrink: 0;
    }

    .header__nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-header-mobile-bg);
        backdrop-filter: var(--backdrop-blur);
        padding: 1.35rem max(1.25rem, var(--omnia-safe-left)) calc(2rem + var(--omnia-safe-bottom)) max(1.25rem, var(--omnia-safe-right));
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
        border-bottom: 1px solid var(--color-border);
        max-height: calc(var(--omnia-viewport-height) - var(--header-height));
        overflow-y: auto;
    }

    .header__nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .header__nav-list {
        flex-direction: column;
        gap: 1.15rem;
        text-align: left;
    }

    .header__nav-link {
        font-size: 1rem;
        display: inline-flex;
        padding: 0.25rem 0;
    }

    .theme-toggle {
        order: 2;
        margin-left: auto;
        margin-right: 0.5rem;
        padding: 0.3rem 0.45rem;
        min-height: 36px;
    }

    .theme-toggle__switch {
        width: 38px;
        height: 20px;
    }

    .theme-toggle__thumb {
        width: 14px;
        height: 14px;
    }

    html[data-theme="dark"] .theme-toggle__thumb {
        transform: translateX(18px);
    }

    .theme-toggle__status {
        display: none;
    }

    .theme-toggle.theme-toggle--floating {
        left: max(0.75rem, env(safe-area-inset-left));
        bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
        --radius-lg: 20px;
        --radius-md: 14px;
    }

    body {
        font-size: 16px;
    }

    .container {
        padding: 0 1rem;
    }

    .header {
        height: var(--header-height);
    }

    .hero {
        min-height: auto;
        background-attachment: scroll;
        padding-top: calc(var(--header-height) + 1rem);
        padding-bottom: 3rem;
    }

    .hero__title {
        font-size: clamp(1.8rem, 9vw, 2rem);
    }

    .hero__content {
        max-width: 100%;
        padding: 1rem 0;
    }

    .hero__subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .btn {
        min-height: 48px;
        font-size: 0.95rem;
        padding: 0.75rem 1.25rem;
    }

    .countdown__item {
        min-width: 84px;
        padding: 1rem 1rem;
    }

    .countdown {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .countdown__item {
        min-width: 0;
        flex: 1 1 0;
        max-width: 96px;
        padding: 0.8rem 0.5rem;
    }

    .countdown__number {
        font-size: clamp(1.5rem, 6.8vw, 2rem);
    }

    .section {
        padding: 3.5rem 0;
    }

    .section__header {
        margin-bottom: 2rem;
    }

    .section__title {
        font-size: clamp(1.4rem, 6vw, 1.6rem);
    }

    .section__subtitle {
        font-size: 0.95rem;
    }

    .about__text {
        font-size: 1rem;
        line-height: 1.7;
    }

    .highlights {
        gap: 1.25rem;
    }

    .highlights__pill {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    .highlights__panel {
        min-height: 0;
        padding: 1.25rem;
    }

    .highlights__panel-text {
        font-size: 1rem;
        line-height: 1.6;
    }

    .card {
        padding: 1rem;
    }

    .card__title {
        font-size: 1.15rem;
    }

    .card__text {
        font-size: 1rem;
    }

    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .project-modal {
        padding: 0.75rem;
    }

    .project-modal__container {
        width: 100%;
        max-height: calc(var(--omnia-viewport-height) - 1.5rem - var(--omnia-safe-top) - var(--omnia-safe-bottom));
    }

    .project-modal__close {
        top: 0.75rem;
        right: 0.75rem;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    .project-modal__content {
        padding: 2.5rem 1.1rem 1.25rem;
    }

    .project-modal__details {
        gap: 1rem;
        padding: 1rem;
    }
}

/* ========== HERO ========== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: var(--omnia-viewport-height);
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: var(--hero-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    /* Extra spacing from fixed header */
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: 2rem;
}

@supports (-webkit-touch-callout: none) {
    .hero {
        background-attachment: scroll;
        background-image: none;
        overflow: hidden;
    }

    .hero::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: var(--hero-bg-image);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        /* Force a dedicated, crisp compositing layer on Safari */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        z-index: 0;
    }

    .hero__overlay {
        z-index: 1;
    }

    .hero__content {
        z-index: 2;
    }
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            var(--color-hero-overlay-start) 0%,
            var(--color-hero-overlay-end) 100%);
}

.hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 800px;
}

.hero__title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: var(--glow-text);
}

.hero__subtitle {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: var(--color-text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Countdown */
.countdown {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.countdown__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--color-surface);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem 2rem;
    min-width: 100px;
}

.countdown__number {
    font-size: clamp(2.5rem, 10vw, 4rem);
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--color-text), var(--color-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.countdown__label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

/* Countdown finished state */
.countdown--finished {
    padding: 2rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-lg);
}

.countdown--finished .countdown__message {
    font-size: 1.5rem;
    font-weight: 600;
}

.hero__note {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.hero__cta {
    margin-top: 1rem;
}

/* ========== SECTIONS ========== */
.section {
    padding: 6rem 0;
}

.section__header {
    text-align: center;
    margin-bottom: 3rem;
}

.section__title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
}

/* About Section */
.section--about {
    background: var(--color-bg);
}

.about__content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.about__text {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.about__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.about__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    color: var(--color-text);
}

.about__icon {
    color: var(--color-primary-light);
    font-size: 1.2rem;
}

/* ========== INTERACTIVE HIGHLIGHTS ========== */
.highlights {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .highlights {
        flex-direction: row;
        align-items: center;
        gap: 3rem;
    }
}

.highlights__pills {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.highlights__pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.highlights__pill::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-primary);
    transform: scaleY(0);
    transition: transform var(--transition-normal);
}

.highlights__pill:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.highlights__pill.active {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
    color: var(--color-text);
}

.highlights__pill.active::before {
    transform: scaleY(1);
}

.highlights__pill-icon {
    color: var(--color-primary-light);
    font-size: 1rem;
    transition: transform var(--transition-normal);
}

.highlights__pill.active .highlights__pill-icon {
    transform: scale(1.2);
}

/* Highlights Panel */
.highlights__panel {
    flex: 1;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    backdrop-filter: var(--backdrop-blur);
}

/* Glow effect behind panel */
.highlights__panel::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(ellipse at center,
            var(--color-primary-glow) 0%,
            transparent 70%);
    opacity: 0.4;
    z-index: -1;
    filter: blur(20px);
    transition: opacity var(--transition-normal);
}

.highlights__panel-text {
    font-size: 1.1rem;
    color: var(--color-text);
    line-height: 1.7;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.highlights__panel-text.changing {
    opacity: 0;
    transform: translateY(10px);
}

/* Scroll reveal animation for about section */
.section--about.reveal-ready {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section--about.reveal-ready.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== SERVICES SECTION ========== */
.section--services {
    background: var(--color-bg);
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* Services grid responsive */
@media (max-width: 1100px) {
    .services__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .services__grid {
        grid-template-columns: 1fr;
    }
}

/* ========== CARDS ========== */
.card {
    background: var(--color-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center,
            var(--color-primary-glow) 0%,
            transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-soft);
}

.card:hover::after {
    opacity: 0.3;
}

.card__icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
}

.card__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card__text {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ========== FOOTER ========== */
.footer {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-footer-end) 100%);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--color-border);
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer__col {
    min-width: 0;
}

.footer__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.footer__text {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.footer__text--muted {
    font-style: italic;
    opacity: 0.7;
}

.footer__links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer__links a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

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

.footer__contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer__contact li {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.footer__bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.footer__bottom p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Footer Blog Entries */
.footer__blog-entries {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer__blog-entry {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
    line-height: 1.4;
}

.footer__blog-entry:hover {
    color: var(--color-text);
}

.footer__blog-all {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--color-primary-light);
    font-weight: 500;
    margin-top: 0.5rem;
    transition: color var(--transition-fast);
}

.footer__blog-all:hover {
    color: var(--color-text);
}

/* ========== PLACEHOLDER PAGES ========== */
.placeholder-page {
    min-height: 100vh;
    min-height: var(--omnia-viewport-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-height);
    text-align: center;
}

.placeholder-page__title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.placeholder-page__text {
    font-size: 1.5rem;
    color: var(--color-primary-light);
    margin-bottom: 0.5rem;
}

.placeholder-page__subtitle {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shared blob motion family: loops close at 100% to avoid visual jumps */
@keyframes blobMorphLoop {
    0% {
        border-radius: var(--blob-r0, 70% 30% 30% 70% / 60% 40% 60% 40%);
    }

    25% {
        border-radius: var(--blob-r25, 30% 70% 70% 30% / 30% 30% 70% 70%);
    }

    50% {
        border-radius: var(--blob-r50, 50% 50% 30% 70% / 50% 70% 30% 50%);
    }

    75% {
        border-radius: var(--blob-r75, 30% 70% 50% 50% / 50% 50% 70% 50%);
    }

    100% {
        border-radius: var(--blob-r0, 70% 30% 30% 70% / 60% 40% 60% 40%);
    }
}

@keyframes blobDriftLoop {
    0% {
        transform: translate(var(--blob-base-x, 0), var(--blob-base-y, 0)) rotate(0deg) scale(1);
    }

    50% {
        transform: translate(
                calc(var(--blob-base-x, 0) + var(--blob-dx, 0px)),
                calc(var(--blob-base-y, 0) + var(--blob-dy, -4px))
            ) rotate(var(--blob-rot, 4deg)) scale(var(--blob-scale, 1.04));
    }

    100% {
        transform: translate(var(--blob-base-x, 0), var(--blob-base-y, 0)) rotate(0deg) scale(1);
    }
}

.hero__content {
    animation: fadeInUp 1s ease-out;
}

/* Fade-in on scroll (applied via JS) */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== ACCESSIBILITY ========== */
:focus-visible {
    outline: 2px solid var(--color-primary-light);
    outline-offset: 2px;
}

/* Skip to content (optional) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--color-text);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    z-index: 9999;
}

.skip-link:focus {
    top: 1rem;
}

/* ========== RESPONSIVE FINE-TUNING ========== */
@media (max-width: 480px) {
    .countdown {
        flex-wrap: nowrap;
        gap: 0.35rem;
        justify-content: center;
    }

    .countdown__item {
        padding: 0.65rem 0.35rem;
        min-width: 0;
        flex: 1 1 0;
        max-width: 82px;
    }

    .countdown__number {
        font-size: clamp(1.35rem, 6.2vw, 1.75rem);
    }

    .countdown__label {
        font-size: 0.82rem;
        letter-spacing: 0.05em;
    }

    .section {
        padding: 4rem 0;
    }

    .footer__grid {
        gap: 2rem;
    }
}

/* ============================================
   PORTFOLIO PAGE STYLES
   ============================================ */

/* ========== PORTFOLIO HERO ========== */
.portfolio-hero {
    position: relative;
    min-height: 100vh;
    min-height: var(--omnia-viewport-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-height);
    overflow: hidden;
}

.portfolio-hero__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, var(--color-primary-glow) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 91, 133, 0.2) 0%, transparent 50%),
        var(--color-bg);
}

.portfolio-hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 900px;
    animation: fadeInUp 1s ease-out;
}

.portfolio-hero__title {
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.portfolio-hero__subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--color-text-muted);
    margin-bottom: 4rem;
}

.portfolio-hero__scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portfolio-hero__scroll-icon {
    width: 24px;
    height: 40px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    position: relative;
}

.portfolio-hero__scroll-icon span {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--color-primary-light);
    border-radius: 2px;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateX(-50%) translateY(12px);
        opacity: 0.3;
    }
}

/* ========== WORKS SECTION ========== */
.works {
    padding: 8rem 0;
}

.section__subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-top: 0.75rem;
}

.works__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .works__grid {
        grid-template-columns: 1fr;
    }
}

/* Project Cards */
.project-card {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.project-card__image {
    position: absolute;
    inset: 0;
}

.project-card__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(86, 22, 125, 0.3), rgba(0, 91, 133, 0.2));
}

.project-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, var(--color-overlay-strong) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-normal);
}

.project-card:hover .project-card__overlay {
    opacity: 1;
    transform: translateY(0);
}

.project-card__tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    width: fit-content;
}

html[data-theme="light"] .project-card__tag {
    color: #ffffff;
}

.project-card__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-card__desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.project-card__btn {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.project-card__btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
}

/* ========== PROCESS / TIMELINE ========== */
.process {
    padding: 8rem 0;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-gradient-soft-start) 100%);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 4rem;
    position: relative;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
}

.timeline__item {
    display: flex;
    gap: 2rem;
    padding: 2rem 0;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s ease;
}

.timeline__item.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline__marker {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: var(--color-surface);
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.timeline__number {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary-light);
}

.timeline__content {
    flex: 1;
    padding-top: 0.5rem;
}

.timeline__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline__text {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

@media (min-width: 768px) {
    .timeline {
        flex-direction: row;
        gap: 2rem;
        max-width: none;
    }

    .timeline::before {
        display: none;
    }

    .timeline__item {
        flex: 1;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
        transform: translateY(20px);
    }

    .timeline__item.visible {
        transform: translateY(0);
    }
}

/* ========== PHILOSOPHY ========== */
.philosophy {
    position: relative;
    padding: 10rem 0;
    overflow: hidden;
}

.philosophy__glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(ellipse at center, var(--color-primary-glow) 0%, transparent 70%);
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
}

.philosophy__content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.philosophy__title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--color-text), var(--color-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.philosophy__text {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    line-height: 1.8;
}

/* ========== CTA SECTION ========== */
.cta-section {
    padding: 8rem 0;
    background: var(--color-bg);
}

.cta-section__content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cta-section__title {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-section__text {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.cta-section__btn {
    font-size: 1rem;
    padding: 1rem 2.5rem;
}

/* ========== FOOTER EXTENDED ========== */
.footer--extended .footer__logo {
    display: block;
    margin-bottom: 1rem;
}

.footer--extended .footer__logo img {
    height: 45px;
    width: auto;
}

/* ========== PROJECT MODAL ========== */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: max(0.75rem, var(--omnia-safe-top)) 0.75rem max(0.75rem, var(--omnia-safe-bottom));
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.project-modal__overlay {
    position: absolute;
    inset: 0;
    background: var(--color-overlay-strong);
    backdrop-filter: blur(10px);
}

html.is-ios-inapp .project-modal__overlay {
    backdrop-filter: none;
    background: rgba(5, 5, 8, 0.95);
}

.project-modal__container {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 800px;
    max-height: calc(var(--omnia-viewport-height) - 1.5rem - var(--omnia-safe-top) - var(--omnia-safe-bottom));
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transform: translateY(30px);
    transition: transform var(--transition-normal);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.project-modal.active .project-modal__container {
    transform: translateY(0);
}

.project-modal__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
}

.project-modal__close:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.project-modal__content {
    padding: 3rem;
}

.project-modal__tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

html[data-theme="light"] .project-modal__tag {
    color: #ffffff;
}

.project-modal__title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.project-modal__desc {
    font-size: 1rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.project-modal__details {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--color-tag-bg);
    border-radius: var(--radius-md);
}

.project-modal__detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.project-modal__label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-modal__value {
    font-size: 0.95rem;
    font-weight: 500;
}

.project-modal__image {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.project-modal__placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(86, 22, 125, 0.3), rgba(0, 91, 133, 0.2));
}
