/* ================================================================
   SHRIYAK SHAH — RESPONSIVE DESIGN
   World-class cinematic digital identity
   ================================================================ */

/* --- Breakpoint Variables --- */
/*
  Mobile First Approach
  Breakpoints:
  - 320px   : Small mobile
  - 360px   : Standard mobile
  - 375px   : iPhone SE/6/7/8
  - 390px   : iPhone 12/13/14
  - 430px   : Large mobile / iPhone Pro Max
  - 640px   : Small tablet / Large mobile landscape
  - 768px   : Tablet portrait
  - 1024px  : Tablet landscape / Small desktop
  - 1280px  : Desktop
  - 1440px  : Large desktop
  - 1920px  : Ultra-wide
*/

/* --- Base Mobile (320px+) --- */
html {
  font-size: 14px;
}

.container {
  padding: 0 var(--space-4);
}

.section {
  padding: var(--space-16) 0;
}

:root {
  --header-height: 64px;
  --header-height-mobile: 64px;
}

/* Navigation Mobile */
.nav__brand-name {
  font-size: var(--text-xs);
}

.nav__brand-role {
  font-size: 10px;
}

.nav__brand-mark {
  width: 36px;
  height: 36px;
  font-size: var(--text-base);
}

.nav__mobile-toggle {
  width: 40px;
  height: 40px;
}

/* Hero Mobile */
.hero {
  min-height: auto;
  padding: calc(var(--header-height) + var(--space-12)) var(--space-4) var(--space-16);
}

.hero__main {
  gap: var(--space-8);
}

.hero__headline {
  font-size: var(--text-3xl);
  line-height: 1.05;
}

.hero__subheadline {
  font-size: var(--text-base);
  line-height: 1.6;
}

.hero__name {
  font-size: var(--text-xl);
}

.hero__title {
  font-size: var(--text-xs);
}

.hero__cta-group {
  flex-direction: column;
  width: 100%;
}

.hero__cta-group .btn {
  width: 100%;
  justify-content: center;
}

.hero__stats {
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
}

.hero__stat-value {
  font-size: var(--text-2xl);
}

.hero__scroll-indicator {
  display: none;
}

/* Section Header Mobile */
.section-header {
  margin-bottom: var(--space-10);
}

.section-header__title {
  font-size: var(--text-3xl);
}

.section-header__description {
  font-size: var(--text-base);
}

/* Introduction Mobile */
.intro__grid {
  gap: var(--space-8);
}

.intro__headline {
  font-size: var(--text-2xl);
}

.intro__text {
  font-size: var(--text-base);
}

.intro__image {
  aspect-ratio: 4/5;
}

/* Timeline Mobile */
.timeline::before {
  left: 20px;
}

.timeline__item {
  flex-direction: column;
  align-items: flex-start;
  padding-left: 48px;
  margin-bottom: var(--space-8);
}

.timeline__date {
  flex: none;
  padding-right: 0;
  justify-content: flex-start;
  font-size: var(--text-xs);
  margin-bottom: var(--space-2);
}

.timeline__marker {
  left: 20px;
  top: 4px;
}

.timeline__content {
  width: 100%;
  padding: var(--space-4);
}

.timeline__title {
  font-size: var(--text-lg);
}

/* Ventures Mobile */
.ventures__grid {
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.venture-card.featured {
  grid-template-columns: 1fr;
}

.venture-card__content {
  padding: var(--space-5);
}

.venture-card__content-alt {
  padding: var(--space-6);
}

.venture-card__title {
  font-size: var(--text-lg);
}

/* Philosophy Mobile */
.philosophy__grid {
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.philosophy__card {
  padding: var(--space-6);
}

.philosophy__card-number {
  font-size: var(--text-3xl);
}

.philosophy__card-title {
  font-size: var(--text-lg);
}

/* Madridista Mobile */
.madridista__content {
  gap: var(--space-8);
}

.madridista__headline {
  font-size: var(--text-3xl);
}

.madridista__text {
  font-size: var(--text-base);
}

.madridista__values {
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.madridista__trophy {
  flex-direction: column;
  text-align: center;
  gap: var(--space-3);
}

.madridista__trophy-icon {
  width: 48px;
  height: 48px;
  font-size: var(--text-xl);
}

.madridista__visual {
  aspect-ratio: 4/3;
}

/* Future Mobile */
.future__grid {
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.future-card {
  padding: var(--space-6);
}

/* Contact Mobile */
.contact__grid {
  gap: var(--space-8);
}

.contact__form {
  padding: var(--space-6);
}

.contact__method {
  padding: var(--space-4);
  flex-direction: column;
  gap: var(--space-3);
  text-align: center;
}

.contact__method-icon {
  margin: 0 auto;
}

.form-row--half {
  grid-template-columns: 1fr;
}

/* Footer Mobile */
.footer__grid {
  grid-template-columns: 1fr;
  gap: var(--space-8);
  text-align: center;
}

.footer__brand {
  max-width: none;
}

.footer__brand-mark {
  margin: 0 auto var(--space-4);
}

.footer__nav-list,
.footer__contact-list,
.footer__social-list {
  align-items: center;
}

.footer__bottom {
  flex-direction: column;
  gap: var(--space-4);
  text-align: center;
}

.footer__legal {
  flex-wrap: wrap;
  justify-content: center;
}

/* Mobile Menu */
.mobile-menu {
  max-width: 100%;
  padding: calc(var(--header-height) + var(--space-6)) var(--space-4) var(--space-8);
}

.mobile-menu__link {
  font-size: var(--text-xl);
  padding: var(--space-3) var(--space-2);
}

/* --- 360px+ --- */
@media (min-width: 360px) {
  html {
    font-size: 15px;
  }

  .hero__headline {
    font-size: var(--text-4xl);
  }

  .section-header__title {
    font-size: var(--text-4xl);
  }
}

/* --- 375px+ (iPhone SE/6/7/8) --- */
@media (min-width: 375px) {
  .container {
    padding: 0 var(--space-5);
  }

  .hero__headline {
    font-size: calc(var(--text-4xl) + 0.25rem);
  }

  .about-hero__headline,
  .ventures-hero__headline,
  .contact-hero__headline {
    font-size: var(--text-4xl);
  }
}

/* --- 390px+ (iPhone 12/13/14) --- */
@media (min-width: 390px) {
  .hero__headline {
    font-size: calc(var(--text-4xl) + 0.5rem);
  }

  .hero__subheadline {
    font-size: var(--text-lg);
  }
}

/* --- 430px+ (iPhone Pro Max) --- */
@media (min-width: 430px) {
  html {
    font-size: 16px;
  }

  .hero__headline {
    font-size: var(--text-5xl);
  }

  .section-header__title {
    font-size: var(--text-4xl);
  }

  .about-hero__headline,
  .ventures-hero__headline,
  .contact-hero__headline {
    font-size: var(--text-5xl);
  }
}

/* --- 640px+ (Small Tablet / Large Mobile Landscape) --- */
@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-6);
  }

  .hero {
    padding: calc(var(--header-height) + var(--space-16)) var(--space-6) var(--space-20);
  }

  .hero__main {
    gap: var(--space-10);
  }

  .hero__stats {
    gap: var(--space-6);
  }

  .section-header__title {
    font-size: var(--text-4xl);
  }

  .intro__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
    align-items: center;
  }

  .intro__image {
    aspect-ratio: 3/4;
  }

  .timeline::before {
    left: 50%;
  }

  .timeline__item {
    flex-direction: row;
    padding-left: 0;
    align-items: flex-start;
  }

  .timeline__date {
    flex: 0 0 180px;
    padding-right: var(--space-6);
    justify-content: flex-end;
    margin-bottom: 0;
  }

  .timeline__marker {
    left: 50%;
    transform: translateX(-50%);
  }

  .timeline__content {
    width: calc(50% - 40px);
  }

  .timeline__item:nth-child(odd) .timeline__content {
    margin-left: auto;
  }

  .ventures__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .venture-card.featured {
    grid-column: span 2;
    grid-template-columns: 1fr 1fr;
  }

  .philosophy__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .madridista__values {
    grid-template-columns: repeat(2, 1fr);
  }

  .madridista__trophy {
    flex-direction: row;
    text-align: left;
  }

  .future__grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .form-row--half {
    grid-template-columns: 1fr 1fr;
  }

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- 768px+ (Tablet Portrait) --- */
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }

  .section {
    padding: var(--space-20) 0;
  }

  :root {
    --header-height: 80px;
  }

  .nav__links {
    display: flex;
  }

  .nav__cta {
    display: inline-flex;
  }

  .nav__mobile-toggle {
    display: none;
  }

  .hero {
    min-height: 100vh;
    padding-top: var(--header-height);
  }

  .hero__main {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
  }

  .hero__narrative {
    max-width: 560px;
  }

  .hero__headline {
    font-size: var(--text-5xl);
  }

  .hero__scroll-indicator {
    display: flex;
  }

  .section-header {
    margin-bottom: var(--space-14);
  }

  .section-header__title {
    font-size: var(--text-4xl);
  }

  .intro__headline {
    font-size: var(--text-3xl);
  }

  .timeline__content {
    width: calc(50% - 50px);
    padding: var(--space-6);
  }

  .venture-card__content {
    padding: var(--space-6);
  }

  .venture-card__content-alt {
    padding: var(--space-8);
  }

  .philosophy__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .madridista__content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }

  .madridista__visual {
    aspect-ratio: 16/9;
  }

  .future__grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    text-align: left;
  }

  .footer__brand {
    max-width: 320px;
  }

  .footer__brand-mark {
    margin: 0 0 var(--space-4);
  }

  .footer__nav-list,
  .footer__contact-list,
  .footer__social-list {
    align-items: flex-start;
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
  }

  .footer__legal {
    justify-content: flex-end;
  }
}

/* --- 1024px+ (Tablet Landscape / Small Desktop) --- */
@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-8);
  }

  .section {
    padding: var(--space-24) 0;
  }

  .hero__headline {
    font-size: var(--text-6xl);
  }

  .hero__subheadline {
    font-size: var(--text-xl);
  }

  .hero__name {
    font-size: var(--text-2xl);
  }

  .hero__stat-value {
    font-size: var(--text-3xl);
  }

  .section-header__title {
    font-size: var(--text-5xl);
  }

  .section-header__description {
    font-size: var(--text-lg);
  }

  .intro__headline {
    font-size: var(--text-4xl);
  }

  .intro__text {
    font-size: var(--text-lg);
  }

  .timeline__date {
    flex: 0 0 200px;
    padding-right: var(--space-8);
  }

  .timeline__content {
    padding: var(--space-8);
  }

  .timeline__title {
    font-size: var(--text-xl);
  }

  .ventures__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .venture-card.featured {
    grid-column: span 2;
  }

  .venture-card__title {
    font-size: var(--text-xl);
  }

  .philosophy__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .philosophy__card {
    padding: var(--space-8);
  }

  .philosophy__card-title {
    font-size: var(--text-xl);
  }

  .madridista__headline {
    font-size: var(--text-4xl);
  }

  .future__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .future-card {
    padding: var(--space-8);
  }

  .contact__form {
    padding: var(--space-10);
  }

  .about-hero__headline,
  .ventures-hero__headline,
  .contact-hero__headline {
    font-size: var(--text-5xl);
  }

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

  .about__highlights {
    grid-template-columns: repeat(4, 1fr);
  }

  .ventures__list {
    grid-template-columns: repeat(2, 1fr);
  }

  .venture-item__content {
    padding: var(--space-8);
  }
}

/* --- 1280px+ (Desktop) --- */
@media (min-width: 1280px) {
  .container {
    padding: 0 var(--space-10);
    max-width: var(--container-xl);
  }

  .hero__headline {
    font-size: var(--text-6xl);
  }

  .section-header__title {
    font-size: var(--text-5xl);
  }

  .intro__headline {
    font-size: var(--text-4xl);
  }

  .madridista__headline {
    font-size: var(--text-5xl);
  }

  .about-hero__headline,
  .ventures-hero__headline,
  .contact-hero__headline {
    font-size: var(--text-5xl);
  }
}

/* --- 1440px+ (Large Desktop) --- */
@media (min-width: 1440px) {
  .container {
    max-width: var(--container-2xl);
  }

  .hero__headline {
    font-size: calc(var(--text-6xl) + 1rem);
  }

  .section-header__title {
    font-size: calc(var(--text-5xl) + 0.5rem);
  }

  .intro__headline {
    font-size: calc(var(--text-4xl) + 0.5rem);
  }

  .madridista__headline {
    font-size: calc(var(--text-5xl) + 0.5rem);
  }
}

/* --- 1920px+ (Ultra-wide) --- */
@media (min-width: 1920px) {
  html {
    font-size: 18px;
  }

  .container {
    max-width: 1800px;
  }

  .hero__headline {
    font-size: var(--text-6xl);
  }

  .section-header__title {
    font-size: var(--text-5xl);
  }
}

/* --- Landscape Mobile Adjustments --- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: calc(var(--header-height) + var(--space-8)) var(--space-4) var(--space-12);
  }

  .hero__main {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .hero__headline {
    font-size: var(--text-4xl);
  }

  .hero__subheadline {
    font-size: var(--text-sm);
  }

  .hero__stats {
    display: none;
  }

  .hero__scroll-indicator {
    display: none;
  }

  .section {
    padding: var(--space-12) 0;
  }
}

/* --- High DPI Displays --- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Sharper shadows on retina */
  .card-elevated,
  .venture-card,
  .future-card {
    box-shadow: var(--shadow-sm);
  }

  .card-elevated:hover,
  .venture-card:hover,
  .future-card:hover {
    box-shadow: var(--shadow-lg);
  }
}

/* --- Touch Device Optimizations --- */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .btn:hover,
  .card:hover,
  .venture-card:hover,
  .future-card:hover,
  .philosophy__card:hover,
  .contact__method:hover,
  .guarantee:hover,
  .venture-item:hover,
  .timeline__content:hover,
  .footer__social-link:hover,
  .footer__nav-link:hover,
  .footer__contact-link:hover,
  .nav__link:hover,
  .mobile-menu__link:hover,
  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-accent:hover,
  .btn-ghost:hover {
    transform: none;
    box-shadow: none;
    background: inherit;
    border-color: inherit;
    color: inherit;
  }

  /* Larger touch targets */
  .btn {
    min-height: 48px;
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
  }

  .nav__link {
    padding: var(--space-3) 0;
  }

  .mobile-menu__link {
    min-height: 48px;
  }

  .footer__social-link {
    width: 48px;
    height: 48px;
  }

  /* Disable custom cursor */
  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }

  /* Disable magnetic effects */
  .magnetic {
    transition: none;
  }

  /* Disable tilt */
  .tilt-card {
    transition: box-shadow 0.3s ease-out;
  }
}

/* --- Reduced Motion - Responsive Override --- */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale,
  .stagger-children > *,
  .text-reveal .text-reveal__line,
  .image-reveal,
  .image-reveal-clip {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    clip-path: none !important;
  }

  .image-reveal::before {
    display: none;
  }

  .parallax-layer {
    transform: none !important;
  }

  .animate-float,
  .animate-float-slow,
  .animate-drift,
  .animate-pulse,
  .animate-pulse-glow,
  .animate-breathe,
  .animate-rotate,
  .animate-rotate-reverse,
  .animate-shimmer,
  .animate-gradient-shift {
    animation: none !important;
  }
}

/* --- Print Styles --- */
@media print {
  .nav,
  .mobile-menu,
  .mobile-menu__backdrop,
  .hero__scroll-indicator,
  .footer__back-to-top,
  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding-top: 0;
  }

  .section {
    page-break-inside: avoid;
    padding: var(--space-8) 0;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
    color: #000;
  }

  .btn {
    border: 1px solid #000;
    color: #000;
    background: transparent !important;
  }

  .card,
  .venture-card,
  .future-card,
  .philosophy__card {
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
  }

  .bg-obsidian,
  .bg-charcoal,
  .contact,
  .philosophy {
    background: #fff !important;
    color: #000 !important;
  }

  .bg-obsidian .section-header__title,
  .bg-charcoal .section-header__title,
  .contact .section-header__title,
  .philosophy .section-header__title {
    color: #000 !important;
  }
}

/* --- Dark Mode Support (Future) --- */
@media (prefers-color-scheme: dark) {
  /* Handled in design-system.css via CSS variables */
}

/* --- Focus Visible Enhancement --- */
@media (prefers-reduced-motion: no-preference) {
  :focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
  }

  .btn:focus-visible,
  .nav__link:focus-visible,
  .mobile-menu__link:focus-visible,
  .footer__nav-link:focus-visible,
  .footer__contact-link:focus-visible,
  .footer__social-link:focus-visible,
  .venture-card__link:focus-visible,
  .contact__method:focus-visible {
    outline-offset: 4px;
  }
}

/* --- Container Queries (Future-proofing) --- */
@container (min-width: 400px) {
  .card__content--compact {
    padding: var(--space-6);
  }
}

@container (min-width: 600px) {
  .venture-card__content--compact {
    padding: var(--space-8);
  }
}

/* --- Safe Area Insets (iPhone X+) --- */
@supports (padding: max(0px)) {
  .mobile-menu {
    padding-left: max(var(--space-4), env(safe-area-inset-left));
    padding-right: max(var(--space-4), env(safe-area-inset-right));
    padding-bottom: max(var(--space-8), env(safe-area-inset-bottom));
  }

  .footer__back-to-top {
    bottom: max(var(--space-6), env(safe-area-inset-bottom));
    right: max(var(--space-6), env(safe-area-inset-right));
  }

  .hero {
    padding-left: max(var(--space-4), env(safe-area-inset-left));
    padding-right: max(var(--space-4), env(safe-area-inset-right));
  }
}

/* --- Text Clamp Utilities --- */
.clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Aspect Ratio Fallbacks --- */
@supports not (aspect-ratio: 1/1) {
  .aspect-square::before {
    content: '';
    display: block;
    padding-top: 100%;
  }

  .aspect-video::before {
    content: '';
    display: block;
    padding-top: 56.25%;
  }

  .aspect-photo::before {
    content: '';
    display: block;
    padding-top: 75%;
  }

  .aspect-portrait::before {
    content: '';
    display: block;
    padding-top: 133.33%;
  }

  .aspect-square > *,
  .aspect-video > *,
  .aspect-photo > *,
  .aspect-portrait > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}