/**
 * ==============================================================================
 * JOVEN — Flagship Digital Platform
 * Responsive Architecture & Mobile Art-Direction Stylesheet
 * 
 * Viewports Targeted:
 * - 360px & 375px: Ultra-compact & small mobile (iPhone SE, Galaxy S compact)
 * - 390px & 430px: Modern standard & large mobile (iPhone 14/15/16, Pro Max, Pixel)
 * - 768px: Tablet portrait (iPad Mini, iPad 10th gen, foldables)
 * - 1024px: Tablet landscape & laptop (iPad Pro, compact laptops)
 * - 1440px & 1920px: Standard desktop & ultrawide displays
 * ==============================================================================
 */

/* ------------------------------------------------------------------------------
   1. GLOBAL FOUNDATIONS, SAFE AREAS & FLUID SCALING
   --------------------------------------------------------------------------- */
:root {
  /* Dynamic viewport-safe container padding */
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Ensure no horizontal blowout across all devices */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

.container {
  padding-left: max(var(--container-padding), var(--safe-left));
  padding-right: max(var(--container-padding), var(--safe-right));
}

/* ------------------------------------------------------------------------------
   2. 1920px & LARGE MONUMENTAL DESKTOPS
   --------------------------------------------------------------------------- */
@media (min-width: 1441px) {
  :root {
    --container-max: 1560px;
    --text-display-monument: clamp(4.5rem, 8vw, 9.5rem);
  }

  .section {
    padding-block: var(--space-32);
  }

  .hero-visual-wrapper {
    max-width: 540px;
  }

  .creator-card {
    flex: 0 0 380px;
  }
}

/* ------------------------------------------------------------------------------
   3. 1024px LAPTOP & TABLET LANDSCAPE (901px - 1200px)
   --------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .nav-menu {
    gap: var(--space-5);
  }

  .nav-link {
    font-size: 0.6875rem;
  }

  .hero-reveal {
    font-size: clamp(3rem, 5.8vw, 4.85rem);
  }

  .manifesto-reveal {
    font-size: clamp(2.6rem, 5.2vw, 4.2rem);
  }
}

@media (max-width: 1024px) {
  :root {
    --header-height: 76px;
    --container-padding: clamp(1.25rem, 3.5vw, 3rem);
  }

  /* Verticals Triad */
  .section-verticals .grid-12 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--space-4);
  }

  .section-verticals .card-architectural {
    grid-column: span 1 !important;
  }

  /* Creator Cards on Laptop */
  .creator-card {
    flex: 0 0 clamp(290px, 32vw, 340px);
  }

  /* Timeline Stage Columns */
  .timeline-stage {
    grid-template-columns: 50px 160px 1fr;
    gap: var(--space-6);
  }

  .timeline-spine-track {
    left: 24px;
  }

  .stage-monument-num {
    font-size: 4rem;
  }

  /* Footer Grid */
  .footer-nav-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-10);
  }
}

/* ------------------------------------------------------------------------------
   4. 768px TABLET PORTRAIT (769px - 900px & 768px Breakpoint)
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
  :root {
    --header-height: 72px;
  }

  /* Header & Navigation Drawer */
  .site-header {
    background-color: rgba(11, 11, 12, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }

  .nav-status {
    display: none;
  }

  .nav-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
  }

  .nav-actions .btn {
    display: none; /* Relocate primary CTA inside the drawer on mobile/tablet */
  }

  .nav-menu {
    position: fixed;
    visibility: hidden;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: rgba(11, 11, 12, 0.98);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: calc(var(--header-height) + var(--space-8)) var(--container-padding) var(--space-12);
    gap: var(--space-4);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    z-index: calc(var(--z-header) - 1);
    border-left: 1px solid var(--color-stroke-subtle);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-menu.is-active {
    visibility: visible;
    transform: translateX(0);
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-link {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5.5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: var(--tracking-tight);
    padding-block: var(--space-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .nav-link::after {
    display: none;
  }

  /* Mobile Nav Drawer Footer & Action */
  .nav-drawer-footer {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    width: 100%;
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-stroke-contrast);
  }

  .nav-drawer-cta {
    width: 100%;
    min-height: 50px;
    font-size: 0.8125rem;
    justify-content: center;
  }

  .nav-drawer-coords {
    font-family: var(--font-utility);
    font-size: var(--text-micro);
    color: var(--color-text-dim);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: clamp(1rem, 4vw, 1.75rem);
    --text-lead: 1.0625rem;
    --text-body: 0.9375rem;
  }

  .section {
    padding-block: var(--space-20);
  }

  .section-header {
    margin-bottom: var(--space-10);
  }

  .section-title {
    font-size: clamp(2rem, 6.5vw, 2.75rem);
  }

  .section-subtitle {
    font-size: 1rem;
    margin-top: var(--space-3);
  }

  /* 01. Hero Tablet Portrait */
  .section-hero {
    min-height: auto;
    padding-top: calc(var(--header-height) + var(--space-8));
    padding-bottom: var(--space-16);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .hero-content-col {
    grid-column: 1 / -1;
  }

  .hero-reveal {
    font-size: clamp(2.5rem, 8vw, 3.75rem);
    line-height: 0.96;
  }

  .hero-lead {
    font-size: 1.0625rem;
    max-width: 600px;
    margin-top: var(--space-5);
    margin-bottom: var(--space-8);
  }

  .hero-actions {
    gap: var(--space-4);
  }

  .hero-visual-col {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: var(--space-2);
  }

  .hero-visual-wrapper {
    max-width: 480px;
    width: 100%;
  }

  .hero-image-curtain {
    aspect-ratio: 4 / 4.8;
  }

  .hero-floating-card {
    position: relative;
    left: 0;
    bottom: 0;
    max-width: 100%;
    margin-top: var(--space-4);
  }

  /* 02. Manifesto Tablet Portrait */
  .manifesto-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .manifesto-visual-col {
    grid-column: 1 / -1;
    max-width: 480px;
    margin-inline: auto;
    width: 100%;
  }

  .manifesto-content-col {
    grid-column: 1 / -1;
  }

  .manifesto-image-curtain {
    aspect-ratio: 4 / 4.8;
  }

  .manifesto-floating-card {
    position: relative;
    left: 0;
    bottom: 0;
    max-width: 100%;
    margin-top: var(--space-4);
  }

  .manifesto-reveal {
    font-size: clamp(2.25rem, 7vw, 3.25rem);
  }

  .manifesto-pillars {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  /* 03. Services Tablet Portrait */
  .service-row-header {
    grid-template-columns: 48px 1fr 36px;
    padding: var(--space-5) var(--space-1);
    min-height: 56px;
  }

  .service-row-summary {
    display: none;
  }

  .service-number {
    font-size: 2rem;
  }

  .service-title {
    font-size: 1.35rem;
  }

  .service-toggle-label {
    display: none;
  }

  .service-panel-inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding: var(--space-3) 0 var(--space-6);
  }

  .service-image-frame {
    aspect-ratio: 16 / 10;
    max-width: 100%;
  }

  /* 04. Verticals Tablet Portrait */
  .section-verticals .grid-12 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: var(--space-4);
  }

  .section-verticals .card-architectural {
    grid-column: 1 / -1 !important;
    padding: var(--space-6);
  }

  /* 05. Selected Work Tablet Portrait */
  .work-header-main {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .work-filter-bar {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: var(--space-2);
    padding: 6px;
  }

  .work-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .work-filter-pill {
    min-height: 44px;
    padding: 10px 16px;
    white-space: nowrap;
  }

  .work-flagship-grid .work-content-col {
    padding: var(--space-6);
  }

  .work-matrix-row {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .work-grid-secondary {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  /* Work Dossier Modal Tablet */
  .work-modal-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  /* 06. Creator Universe Tablet */
  .universe-header-main {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-5);
  }

  .universe-nav-controls {
    width: 100%;
    justify-content: space-between;
  }

  .universe-filter-bar {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: var(--space-2);
  }

  .universe-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .universe-filter-pill {
    min-height: 44px;
    padding: 10px 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Tablet Creator Card Art Direction */
  .creator-card {
    flex: 0 0 clamp(290px, 46vw, 340px);
  }

  /* Keep resting plate clearly visible on tablet/touch */
  .creator-card-plate {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Tucked touch-friendly drawer reveal */
  .creator-card-drawer {
    transform: translateY(102%);
    padding: var(--space-5) var(--space-4);
  }

  .creator-card:focus-within .creator-card-drawer {
    transform: translateY(0%);
  }

  /* 07. Impact Timeline Tablet */
  .timeline-spine-track {
    left: 18px;
    top: 24px;
  }

  .timeline-stage {
    display: flex;
    flex-direction: column;
    padding-left: 48px;
    padding-bottom: var(--space-10);
    gap: var(--space-3);
    position: relative;
  }

  .stage-node-col {
    position: absolute;
    left: 7px;
    top: 4px;
  }

  .stage-coord {
    display: none;
  }

  .stage-monument-col {
    flex-direction: row;
    align-items: baseline;
    gap: var(--space-3);
  }

  .stage-monument-num {
    font-size: 3.25rem;
  }

  .stage-content-col {
    padding: var(--space-6);
  }

  /* 08. Founder Tablet */
  .section-founder .card-architectural {
    max-width: 100%;
    padding: var(--space-6);
  }

  /* 09. Contact Section Tablet */
  .contact-interaction-wrapper {
    padding: var(--space-6);
  }

  .contact-type-selector {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .form-col-6 {
    grid-column: span 12;
  }

  /* 10. Footer Tablet */
  .footer-nav-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }
}

/* ------------------------------------------------------------------------------
   5. 390px & 430px MODERN MOBILE PHONES (iPhone 14/15/16, Pro Max, Galaxy S, Pixel)
   --------------------------------------------------------------------------- */
@media (max-width: 480px) {
  :root {
    --header-height: 68px;
    --container-padding: 16px;
  }

  /* Brand Logo Sizing */
  .brand-logo-img {
    height: 34px;
  }

  .site-header {
    height: var(--header-height);
  }

  /* Typography Fluid Clamping */
  .section-title {
    font-size: clamp(1.85rem, 8vw, 2.35rem);
    letter-spacing: -0.02em;
  }

  .section-index {
    font-size: 0.6875rem;
  }

  /* Hero Section Mobile Art-Direction */
  .section-hero {
    padding-top: calc(var(--header-height) + var(--space-5));
    padding-bottom: var(--space-12);
  }

  .hero-eyebrow {
    font-size: 0.625rem;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
  }

  .hero-eyebrow-sep {
    font-size: 0.65rem;
  }

  .hero-reveal {
    font-size: clamp(2.15rem, 9.8vw, 2.75rem);
    line-height: 0.96;
    letter-spacing: -0.025em;
    word-break: break-word;
  }

  .hero-vermilion-frame {
    padding: 0 0.18em;
  }

  .hero-lead {
    font-size: 0.9375rem;
    line-height: 1.55;
    margin-top: var(--space-4);
    margin-bottom: var(--space-6);
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: var(--space-3);
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 50px;
    font-size: 0.75rem;
    justify-content: center;
  }

  .hero-visual-wrapper {
    max-width: 100%;
  }

  .hero-image-curtain {
    aspect-ratio: 4 / 4.8;
    max-height: 420px;
  }

  .hero-floating-card {
    position: relative;
    left: 0;
    bottom: 0;
    width: 100%;
    margin-top: var(--space-3);
    padding: var(--space-4);
  }

  .hero-floating-title {
    font-size: 1.15rem;
  }

  /* Typographic Marquee Strip */
  .typo-strip-container {
    padding-block: 8px;
  }

  .typo-strip-item {
    font-size: 0.875rem;
    gap: var(--space-2);
  }

  .typo-strip-spec {
    font-size: 0.5625rem;
  }

  /* Manifesto Section Mobile */
  .manifesto-reveal {
    font-size: clamp(1.85rem, 8.2vw, 2.45rem);
    line-height: 0.96;
  }

  .manifesto-accent-rule {
    height: 3px;
  }

  .manifesto-rule-wrapper {
    margin-top: var(--space-4);
    margin-bottom: var(--space-5);
  }

  .manifesto-lead {
    font-size: 0.9375rem;
    line-height: 1.55;
  }

  .manifesto-body {
    font-size: 0.875rem;
    line-height: 1.6;
  }

  .manifesto-pillar-card {
    padding: var(--space-5);
  }

  .pillar-title {
    font-size: 1.25rem;
  }

  .manifesto-footnote {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  /* Services Mobile Accordion */
  .service-row-header {
    grid-template-columns: 36px 1fr 28px;
    gap: var(--space-2);
    padding: var(--space-4) 0;
    min-height: 52px;
  }

  .service-number {
    font-size: 1.65rem;
  }

  .service-title {
    font-size: 1.15rem;
    line-height: 1.1;
  }

  .service-category {
    font-size: 0.5625rem;
  }

  .service-panel-inner {
    padding-top: var(--space-2);
    padding-bottom: var(--space-5);
  }

  .service-lead-benefit {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .service-image-frame {
    aspect-ratio: 16 / 10;
  }

  /* Selected Work Flagship Mobile */
  .work-campaign-title {
    font-size: clamp(1.75rem, 7.5vw, 2.25rem);
    line-height: 1.05;
  }

  .work-campaign-subtitle {
    font-size: 0.875rem;
    margin-top: var(--space-2);
  }

  .work-visual-frame {
    min-height: 240px;
    aspect-ratio: 16 / 10;
  }

  .work-floating-plate {
    top: var(--space-3);
    right: var(--space-3);
    padding: 6px 10px;
  }

  .work-grid-secondary {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .work-card-actions {
    flex-direction: column;
    width: 100%;
    gap: var(--space-3);
    margin-top: var(--space-6);
  }

  .work-card-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 0.75rem;
    justify-content: center;
  }

  /* Selected Work Dossier Modal Mobile Bottom Sheet */
  .work-modal-drawer {
    width: 100% !important;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 8px 8px 0 0;
    margin-top: auto;
    border-left: none;
    border-top: 1px solid var(--color-stroke-focus);
    padding-bottom: max(var(--space-4), var(--safe-bottom));
  }

  .work-modal-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .work-modal-header {
    padding: var(--space-4);
  }

  .work-modal-body {
    padding: var(--space-4);
  }

  /* Creator Universe Cards Mobile Art-Direction */
  .creator-card {
    flex: 0 0 clamp(280px, 82vw, 340px);
    aspect-ratio: 3 / 4.4;
  }

  /* Clear editorial plate on mobile touch screens */
  .creator-card-plate {
    display: flex !important;
    flex-direction: column;
    padding: var(--space-4);
    opacity: 1 !important;
    transform: none !important;
    background: linear-gradient(0deg, rgba(11, 11, 12, 0.95) 0%, rgba(11, 11, 12, 0.6) 75%, transparent 100%);
  }

  .creator-card-name {
    font-size: 1.6rem;
  }

  .creator-card-handle {
    font-size: 0.6875rem;
    margin-bottom: 2px;
  }

  .creator-card-role {
    font-size: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Mobile Touch Inspection Affordance */
  .creator-card-plate::after {
    content: '[ TAP TO INSPECT SPECIMEN ]';
    display: inline-block;
    font-family: var(--font-utility);
    font-size: 0.5625rem;
    letter-spacing: var(--tracking-widest);
    color: var(--color-accent-brand);
    margin-top: var(--space-2);
    text-transform: uppercase;
  }

  /* Creator Modal on Mobile (Bottom Sheet UX) */
  .universe-modal-dialog {
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 8px 8px 0 0;
    margin-top: auto;
    width: 100%;
  }

  .universe-modal-close {
    top: var(--space-3);
    right: var(--space-3);
    width: 44px;
    height: 44px;
  }

  /* Impact Timeline Mobile */
  .timeline-spine-track {
    left: 12px;
  }

  .stage-node-col {
    left: 2px;
  }

  .stage-node {
    width: 20px;
    height: 20px;
  }

  .stage-node-dot {
    width: 6px;
    height: 6px;
  }

  .timeline-stage {
    padding-left: 36px;
    padding-bottom: var(--space-8);
  }

  .stage-monument-num {
    font-size: 2.75rem;
    line-height: 0.88;
  }

  .stage-headline {
    font-size: 1.35rem;
  }

  .stage-content-col {
    padding: var(--space-5);
    gap: var(--space-3);
  }

  /* Contact Section Mobile */
  .contact-headline-monument {
    font-size: clamp(2.5rem, 11vw, 3.5rem);
    line-height: 0.92;
    letter-spacing: -0.03em;
  }

  .contact-supporting-copy {
    font-size: 1.0625rem;
    margin-top: var(--space-3);
  }

  .contact-type-selector {
    grid-template-columns: 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
  }

  .contact-type-btn {
    padding: var(--space-4) var(--space-5);
    min-height: 52px;
  }

  .type-btn-label {
    font-size: 1.15rem;
  }

  /* PREVENT IOS SAFARI VIEWPORT AUTO-ZOOM (Must be >= 16px) */
  .form-input,
  .form-textarea {
    font-size: 16px !important;
    padding: 12px 14px;
    min-height: 48px;
    border-radius: var(--radius-sharp);
  }

  .discipline-chips-row {
    gap: 8px;
  }

  .discipline-chip {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.6875rem;
    display: inline-flex;
    align-items: center;
  }

  .btn-submit-inquiry {
    width: 100%;
    min-height: 52px;
    font-size: 0.75rem;
  }

  .form-actions-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
  }

  .form-direct-note {
    text-align: center;
    font-size: 0.75rem;
  }

  /* Footer Mobile */
  .site-footer {
    padding-top: var(--space-16);
    padding-bottom: var(--space-8);
  }

  .footer-nav-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: 0.6875rem;
  }
}

/* ------------------------------------------------------------------------------
   6. 360px & 375px ULTRA-COMPACT MOBILE PHONES (iPhone SE, Small Androids)
   --------------------------------------------------------------------------- */
@media (max-width: 375px) {
  :root {
    --container-padding: 14px;
  }

  /* Hero Headline Clamping for Zero Overflow on 360px */
  .hero-reveal {
    font-size: clamp(1.85rem, 8.8vw, 2.25rem);
    line-height: 0.98;
  }

  .hero-eyebrow {
    font-size: 0.5625rem;
  }

  .hero-eyebrow-item {
    font-size: 0.5625rem;
  }

  .hero-lead {
    font-size: 0.875rem;
  }

  .manifesto-reveal {
    font-size: clamp(1.65rem, 7.8vw, 2.15rem);
  }

  .manifesto-pillar-card {
    padding: var(--space-4);
  }

  .service-row-header {
    grid-template-columns: 32px 1fr 24px;
  }

  .service-number {
    font-size: 1.4rem;
  }

  .service-title {
    font-size: 1.05rem;
  }

  .work-campaign-title {
    font-size: 1.65rem;
  }

  .work-card-flagship .work-card-meta-bar {
    gap: var(--space-2);
  }

  .work-card-tags {
    gap: 4px;
  }

  .tag-pill {
    padding: 2px 6px;
    font-size: 0.5625rem;
  }

  .creator-card {
    flex: 0 0 88vw;
  }

  .creator-card-name {
    font-size: 1.45rem;
  }

  .timeline-stage {
    padding-left: 30px;
  }

  .stage-monument-num {
    font-size: 2.35rem;
  }

  .stage-headline {
    font-size: 1.2rem;
  }

  .contact-headline-monument {
    font-size: 2.35rem;
  }

  .type-btn-label {
    font-size: 1.05rem;
  }

  .discipline-chip {
    font-size: 0.625rem;
    padding: 8px 12px;
  }
}
