:root,
[data-bs-theme="dark"] {
  --bs-primary: #FF2400;
  --bs-primary-rgb: 224, 72, 58;

  --bs-body-bg: #0c0c0c;
  --bs-body-color: #ffffff;
  --bs-body-color-rgb: 255, 255, 255; 
}

[data-bs-theme="light"] {
  --bs-primary: #ff2400;
  --bs-primary-rgb: 255, 36, 0;

  --bs-body-bg: #f3f3f3;
  --bs-body-color: #2b2b2b;
  --bs-body-color-rgb: 43, 43, 43;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

/* scrollbar-gutter above already reserves the scrollbar's space, so Bootstrap's
   modal open/close padding-right compensation (on body and .fixed-top) is redundant
   and causes a visible shrink/expand jump on desktop. Cancel it out. */
body,
.fixed-top {
  padding-right: 0 !important;
}

body.no-scroll {
  overflow: hidden;
  /* NO position: fixed */
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: "Roboto", sans-serif;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* image brand in the navbar (brand.png, 320x64 source = 2x of a 160x32 display size); height drives the size */
.navbar-brand-img {
    display: block;
    height: 24px;
    width: auto;
}

@media (min-width: 768px) {
    .navbar-brand-img {
        height: 30px;
    }
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    font-style: normal;
}

/* container size (site-wide: navbar, hero, portfolio, footer, other pages) */

.container-fluid {
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 768px) {
    .container-fluid {
        padding-left: 36px;
        padding-right: 36px;
    }
}


.row {
    --bs-gutter-x: 4px;
}

/* navbar */

.navbar{
    padding-top:16px;
    padding-bottom:16px;
    transition: all .5s ease;
}

@media (min-width: 768px) {
    .navbar{
        padding-top:32px;
        padding-bottom:32px;
    }
}

.navbar-nav {
  gap: 2.5rem;
}

.nav-actions {
  gap: 2.5rem;
}

.navbar-closed{
    padding-top:15px;
    padding-bottom:15px;
    background-color: var(--bs-body-bg) !important;
    transition: all .3s ease;
}

/* same type style as .hero-text (weight, letter-spacing, color) */
.nav-link {
  --bs-nav-link-color: var(--bs-body-color);
  --bs-nav-link-hover-color: var(--bs-body-color);
  --bs-navbar-color: var(--bs-body-color);
  --bs-navbar-hover-color: var(--bs-body-color);
  --bs-navbar-active-color: var(--bs-body-color);
  font-weight: 100;
  font-size: 1rem;
  letter-spacing: 1px;
}

#mobile-menu .nav-link {
  font-size: 1.6rem;
}

.nav-link.active {
  font-weight: 100;
  text-decoration: underline;
  text-decoration-color: var(--bs-primary);
  text-underline-offset: 12px;
  text-decoration-thickness: 2px;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.theme-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-switch-icon {
  font-size: 1.4rem;
  color: var(--bs-body-color);
  transition: color 0.2s ease, transform 0.2s ease;
}

.theme-switch-input:checked ~ .theme-switch-icon {
  color: var(--bs-primary);
  transform: rotate(-10deg);
}

.theme-switch-input:focus-visible ~ .theme-switch-icon {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

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

a:hover {
    color: inherit;
}

i{
    font-size: 1.2rem;
}

/* hero */

/* space reserved under the fixed navbar for the desktop hero (home + about); the projects grid has its own padding-top in .site-portfolio */
:root {
    --page-top: 120px;
}

/* mobile too: hero takes the free height between navbar and footer and centers reel + text in it
   (the footer is pushed to the bottom by .home-page) */
#hero {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    padding-top: 140px;
    padding-bottom: 24px;
}

@media (min-width: 768px) {
    #hero {
        padding-top:160px;
        padding-bottom: 30px;
    }
}

/* home, desktop only: the hero fills the first screen, the portfolio grid starts below it.
   On mobile the hero is just as tall as its content (a full-height hero left big empty gaps). */
@media (min-width: 768px) {
    #hero.hero-full {
        min-height: 100vh;
        min-height: 100dvh;
    }
}

.site-portfolio.portfolio-home {
        padding-top: 40px;
    }

/* the grid is the first thing on the home page; mobile-only top padding (desktop uses .site-portfolio's 90px) */
@media (min-width: 768px) {
    .site-portfolio.portfolio-home {
        padding-top: 80px;
    }
}

/* title above the reel */
.hero-name {
    margin: 0 0 1.25rem;
    font-size: 2rem;
    font-weight: 600;
    text-align: left;
    text-wrap: balance;
    color: var(--bs-body-color);
}

@media (min-width: 768px) {
    .hero-name {
        margin-bottom: 1.5rem;
        font-size: 2rem;
        text-align: center;     /* centered on desktop, left on mobile */
    }
}

/* title above the home grid */
.section-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 300;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--bs-primary);
}

@media (min-width: 768px) {
    .section-title {
        font-size: 1.2rem;
    }
}

/* home hero: centered showreel player */
.hero-reel {
    aspect-ratio: 16 / 9;
    background-color: #000;
    overflow: hidden;
}

.hero-reel iframe {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}

.hero-text-center {
    text-align: left;
    text-wrap: pretty;      /* avoids one-word last lines */
}

/* poster + play button over the YouTube iframe, hides YouTube's own overlay and gives
   a real user gesture on the page (needed to request fullscreen on mobile); main.js removes it on click */
.hero-reel { position: relative; }

.hero-reel-tap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #000 url("/assets/img/reel-poster.jpg") center / cover no-repeat;
    cursor: pointer;
}

/* play button: circle + triangle */
.hero-reel-tap::before,
.hero-reel-tap::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
}

.hero-reel-tap::before {
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.hero-reel-tap::after {
    margin: -9px 0 0 -6px;
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent #fff;
}

/* desktop: reel + intro fit in one viewport (no scroll). The reel width is capped
   by the available height: 100dvh minus hero padding (100 + 30), intro text (~125) and its margin (24). */
@media (min-width: 768px) {
    #hero {
        flex: 1 0 auto;
        display: flex;
        align-items: center;
        padding-top: var(--page-top);
        padding-bottom: 24px;
    }

    /* title and intro share the reel's width so their left edges line up with the video */
    #hero .hero-reel,
    #hero .hero-name,
    #hero .hero-text-center {
        width: min(100%, calc((100dvh - 200px) * 16 / 9));   /* reel only (no text under it); use ~460px if the text comes back */
        margin-left: auto;
        margin-right: auto;
    }

    #hero .hero-text-center {
        font-size: 1.2rem;
        line-height: 2.5rem;
        margin-top: 1.5rem;
        margin-bottom: 0;
        padding-left: 0;
        padding-right: 0;
    }
}

/* home page: hero fills the viewport height, pushing the footer to the bottom */

.home-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.home-page .site-footer {
    flex-shrink: 0;
}

.hero-text {
    font-size: 1rem;
    font-weight: 100;
    line-height: 1.6rem;
    letter-spacing: 1px;
    color: rgba(var(--bs-body-color-rgb));
}

.hero-highlight {
    font-weight: 700;
    font-size: 1.2rem;
}

@media (min-width: 768px) {
    .hero-text {
        font-size: 1.6rem;
        line-height: 4rem;
        text-align: center;     /* centered on desktop, left on mobile */
        text-wrap: balance;

    }
}

.bio-link {
    color: var(--bs-primary);
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* menu mobile */

#menuToggle{
	position: fixed;
	top: 12px;   /* lined up with the navbar brand's vertical center (was 15px: bars sat ~3px lower) */
	right: 8px;
	width: 50px;
	height: 50px;
	z-index: 1055;
    border: none;
	cursor: pointer;
	padding: 10px;
    background-color: transparent;
}

.theme-switch-mobile {
    position: fixed;
    top: 28px;
    right: 70px;
    z-index: 1055;
}

.bar1, .bar2, .bar3{
	width: 100%;
	height: 2px;           /* 2px bar + 8px gap = same 10px pitch as before (3 + 7), so the X transforms below still line up */
	margin-bottom: 8px;
	background-color: var(--bs-body-color);
	transition:all 0.3s ease-in-out;
}

.menu-on .bar1,
.menu-on .bar2,
.menu-on .bar3{
	width: 100%;
	height: 2px;
	margin-bottom: 8px;
	background-color: var(--bs-body-color);
	transition:all 0.3s ease-in-out;
}

.menu-on .bar1 {
    transform: rotate(45deg) translate(4px, 9px);
}

.menu-on .bar2 {
    opacity: 0;
}

.menu-on .bar3 {
    transform: rotate(-45deg) translate(5px, -10px); 
}

.mobile-floating-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bs-body-bg);
    z-index: 1055;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s; /* Wait 0.3s to hide visibility */
}

.mobile-floating-menu.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

#mobile-menu .social-icon {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 3rem;
    margin-bottom: 0 !important;
}

.mobile-floating-menu {
    font-size: 2rem;
}

.mobile-floating-menu i{
    font-size: 1.5rem;
}

#mobile-menu .navbar-nav {
    gap: 1rem;
}

#mobile-menu.show .nav-item,
#mobile-menu.show .social-icon {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#mobile-menu .nav-item,
#mobile-menu .social-icon {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#mobile-menu.show .nav-item:nth-child(1) {
    transition-delay: 0.1s;
}
#mobile-menu.show .nav-item:nth-child(2) {
    transition-delay: 0.2s;
}
#mobile-menu.show .nav-item:nth-child(3) {
    transition-delay: 0.3s;
}

/* portfolio cards */

.portfolio-col {
    padding-top: 2rem;
}

@media (min-width: 768px) {
    .portfolio-col {
        padding-top: 3rem;
    }
}

/* Responsive aspect ratio container */
.fixed-size {
    position: relative;
    width: 100%;
    max-width: 720px;
    aspect-ratio: 3 / 2;
    overflow: hidden;
}

@media (min-width: 768px) {
    .fixed-size {
        aspect-ratio: 16 / 9;
    }
}

.fixed-size img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

@media (hover: none) and (pointer: coarse) {
    .portfolio-item:hover img {
        transform: none;
    }
}

.thumb-caption {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow: hidden;
    padding-top: 0.75rem;
    padding-right: 0.75rem;
}

.thumb-caption-title {
    font-size: .9rem;
    font-weight: 300;
    margin: 0;
    color: var(--bs-body-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumb-caption-category {
    flex-shrink: 0;
    font-size: .9rem;
    font-weight: 300;
    color: var(--bs-body-color);
    opacity: 0.6;
    white-space: nowrap;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(var(--bs-body-color-rgb), 0.3);
}

a.text-decoration-none:hover {
    text-decoration: none;
}

/* video lightbox */

.media-lightbox-content {
    background-color: #000000;
    border: none;
    position: relative;
}

.media-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    z-index: 1;
}

#lightboxVideo {
    display: block;
    max-height: 85vh;
}

/* sections */

.site-portfolio {
    padding-top: 90px;      /* own value, independent from --page-top (which the hero uses) */
    background-color: transparent;
    padding-bottom: 48px;
}

@media (min-width: 768px) {
    .site-portfolio {
        padding-bottom: 64px;
    }
}

/* footer — simple one-line bar, follows the page theme */

.site-footer {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    padding-top: 2rem;
    padding-bottom: 2rem;
    font-size: 0.85rem;
    font-weight: 400;
    text-align: left;
}

.footer-credit {
    color: rgba(var(--bs-body-color-rgb), 0.25);
}

@media (min-width: 768px) {
    .site-footer {
        padding-top: 2.5rem;
        padding-bottom: 2rem;
    }
}

.footer-link {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--bs-primary);
}

/* about */

.about-name {
    font-weight: 600;
    font-size: 1.5rem;
    padding-bottom:1.5rem;
}

@media (min-width: 768px) {
    .about-name {
        font-size: 1.5rem;
    }
}

.about-text {
    font-size: 1rem;        /* same as the home .hero-text: 1rem mobile, 1.2rem desktop */
    font-weight: 100;
    line-height: 1.5rem;
    letter-spacing: 1px;
    color: rgba(var(--bs-body-color-rgb));
    margin: 0 0 1rem;
}

@media (min-width: 768px) {
    .about-text {
        font-size: 1.2rem;
        line-height: 2.5rem;
    }
}

/* header/mobile contact email */

.contact-email {
    font-size: 1rem;
    opacity: 1;
    font-weight: 100;
    letter-spacing: 1px;
}

#mobile-menu .contact-email {
    font-size: 1.15rem;
}

/* "¡Copiado!" state of the email link (class toggled by main.js): dark pill with white text in place */
.contact-email.is-copied {
    display: inline-block;
    min-width: 0;
    padding: 0.15rem 0.9rem;
    border-radius: 999px;
    background-color: #1f1f1f;
    color: #fff;
    text-align: center;
}
