/* ==========================================================================
   jioji Landing Page — Faithful to Figma `Site` -> `Desktop - 2` (`725:10578`)
   with crafted responsive adaptation for Tablet & Mobile.
   ========================================================================== */

:root {
  /* Design tokens from Figma Material 3 dark olive palette */
  --bg: #12140d;
  --surface-high: #282b23;
  --primary: #bacf83;
  --primary-hover: #c9dc97;
  --on-primary: #273500;
  --on-surface: #e1e2e9;
  --on-surface-variant: #c6c8b8;
  --outline: #909284;
  --outline-variant: #44483d;

  --radius-cta: 16px;
  --radius-pill: 100px;
  --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Safe area insets for iOS notch / Dynamic Island / home indicator */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

html {
  background-color: var(--bg);
  color: var(--on-surface);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--bg);
  color: var(--on-surface);
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   Desktop-first Exact Figma Canvas (>= 1200px)
   Matches Desktop - 2 (1440 x 869) 1:1
   ========================================================================== */

.page {
  position: relative;
  width: 100%;
  min-height: 100svh;
  background-color: var(--bg);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.canvas {
  position: relative;
  width: 100%;
  max-width: 1440px;
  min-height: max(100svh, 760px);
  display: flex;
  flex-direction: column;
}

/* Header: logo at (67, 62), language button at (right: 54, top: 50) */
.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 50px 54px 0 67px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 6px;
  text-decoration: none;
  border-radius: 6px;
}

.brand-logo img {
  display: block;
  width: 105px;
  height: 32px;
}

.brand-logo:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 6px;
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-btn {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 16px 24px;
  min-height: 48px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.15px;
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
  transition: background-color 160ms ease, opacity 160ms ease;
}

.lang-btn:hover {
  background-color: rgba(186, 207, 131, 0.08);
}

.lang-btn:active {
  background-color: rgba(186, 207, 131, 0.14);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 8px;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 192px;
  background-color: var(--surface-high);
  border: 1px solid rgba(144, 146, 132, 0.35);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 40;
}

.lang-option {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
  transition: background-color 140ms ease, color 140ms ease;
}

.lang-option:hover {
  background-color: rgba(186, 207, 131, 0.1);
}

.lang-option.is-selected {
  color: var(--primary);
  background-color: rgba(186, 207, 131, 0.14);
}

/* Main Hero Area */
.hero {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  padding: 24px 67px 48px;
}

/* Left Copy Column: width 522px, gap 24px (matches Frame 161) */
.hero-copy {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 522px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  /* Slight optical lift to match Figma vertical center (y: 167 on 869px canvas) */
  margin-top: -36px;
}

.hero-title {
  margin: 0;
  max-width: 492px;
  font-family: var(--font-sans);
  font-size: clamp(54px, 5.556vw, 80px);
  font-weight: 700;
  line-height: 0.9; /* 72px at 80px */
  letter-spacing: -0.25px;
  color: var(--on-surface);
  font-variation-settings: 'wdth' 100;
}

.hero-subtitle {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(19px, 1.667vw, 24px);
  font-weight: 400;
  line-height: 1.3333; /* 32px at 24px */
  letter-spacing: 0;
  color: var(--on-surface-variant);
  font-variation-settings: 'wdth' 100;
}

/* CTA Buttons Row (matches Frame 162: gap 16px, two 232 x 72 buttons) */
.cta-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: 232px;
  min-height: 72px;
  height: 72px;
  padding: 8px 16px;
  border-radius: var(--radius-cta);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.cta-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.cta-btn:active {
  transform: translateY(1px) scale(0.99);
}

.cta-btn--primary {
  background-color: var(--primary);
  border: 1px solid transparent;
  color: var(--on-primary);
}

.cta-btn--primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(186, 207, 131, 0.18);
}

.cta-btn--outlined {
  background-color: transparent;
  border: 1px solid var(--outline);
  color: var(--on-surface-variant);
}

.cta-btn--outlined:hover {
  background-color: rgba(198, 200, 184, 0.08);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Leading 48x48 icon slot with 3px padding matching Figma 739:14592 / 739:14607 */
.cta-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cta-icon__img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
}

.cta-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}

.cta-overline {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.5px;
}

.cta-platform {
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: 0;
}

/* ==========================================================================
   Right 3-Phone Mockup Composition (Desktop)
   Exact Figma node 733:831: x=589 (40.90%), y=122, w=870 (60.42%), h=1009
   Inner crop: left=-37.41%, top=0, width=161.62%, height=104.48%
   ========================================================================== */

.hero-visual {
  position: absolute;
  left: 42.2%;
  top: 16px; /* 122px from top of canvas minus 106px header height = 16px */
  width: 60.4167%;
  max-width: 870px;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.mockup-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 870 / 1009;
  overflow: hidden;
}

.mockup-img {
  position: absolute;
  top: 0;
  left: -37.41%;
  width: 161.62%;
  height: 104.48%;
  max-width: none;
  display: block;
}

/* ==========================================================================
   Download Feedback Toast
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(92vw, 440px);
  padding: 12px 20px;
  border-radius: 999px;
  background-color: #e1e2e9;
  color: #2e3035;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toast-in 200ms ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ==========================================================================
   Compact Desktop / Large Tablet (1024px – 1199px)
   ========================================================================== */

@media (max-width: 1199px) {
  .site-header {
    padding: 36px 36px 0 44px;
  }

  .hero {
    padding: 20px 44px 40px;
  }

  .hero-copy {
    max-width: 440px;
    gap: 20px;
    margin-top: -20px;
  }

  .hero-title {
    font-size: clamp(46px, 5vw, 60px);
    line-height: 0.94;
  }

  .hero-subtitle {
    font-size: 18px;
    line-height: 1.4;
  }

  .cta-btn {
    width: 204px;
    height: 66px;
    min-height: 66px;
    padding: 8px 14px;
    gap: 12px;
  }

  .cta-icon {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .cta-platform {
    font-size: 21px;
    line-height: 28px;
  }

  .hero-visual {
    left: 44%;
    top: 24px;
    width: 58%;
  }
}

/* ==========================================================================
   Tablet Portrait & Small Tablet (768px – 1023px)
   Reflow into clean vertical editorial flow
   ========================================================================== */

@media (max-width: 1023px) {
  .page {
    overflow-x: clip;
    overflow-y: visible;
  }

  .canvas {
    min-height: 100svh;
  }

  .site-header {
    padding: calc(28px + var(--safe-top)) 32px 0;
  }

  .brand-logo {
    margin-top: 0;
  }

  .hero {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 32px 0;
    gap: 36px;
  }

  .hero-copy {
    max-width: 580px;
    margin-top: 0;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  .hero-title {
    font-size: clamp(44px, 6.8vw, 62px);
    line-height: 0.96;
    text-wrap: balance;
  }

  .hero-subtitle {
    max-width: 500px;
    font-size: 18px;
    line-height: 1.45;
  }

  .cta-group {
    justify-content: center;
    width: 100%;
    margin-top: 4px;
  }

  .hero-visual {
    position: relative;
    left: auto;
    top: auto;
    width: min(100%, 620px);
    max-width: 620px;
    margin-top: 4px;
  }

  .mockup-frame {
    aspect-ratio: 870 / 740;
  }

  .mockup-frame::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 18%;
    background: linear-gradient(to bottom, rgba(18, 20, 13, 0), var(--bg));
    pointer-events: none;
  }
}

/* ==========================================================================
   Mobile (<= 767px — tested down to 360x800 and 390x844)
   Crafted vertical flow: value prop + both CTAs clearly above the fold,
   native touch ergonomics, safe-area aware, zero horizontal overflow.
   ========================================================================== */

@media (max-width: 767px) {
  .site-header {
    padding:
      calc(18px + var(--safe-top))
      calc(16px + var(--safe-right))
      0
      calc(20px + var(--safe-left));
  }

  .brand-logo img {
    width: 88px;
    height: 27px;
  }

  .lang-btn {
    padding: 10px 12px;
    min-height: 44px;
    font-size: 14px;
    line-height: 20px;
  }

  .hero {
    padding:
      28px
      calc(20px + var(--safe-right))
      calc(8px + var(--safe-bottom))
      calc(20px + var(--safe-left));
    gap: 28px;
    align-items: stretch;
  }

  .hero-copy {
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
    gap: 16px;
  }

  .hero-title {
    font-size: clamp(38px, 10.6vw, 50px);
    line-height: 0.96;
    letter-spacing: -0.4px;
    text-wrap: balance;
  }

  .hero-subtitle {
    font-size: clamp(15.5px, 4.1vw, 17px);
    line-height: 1.48;
    max-width: 100%;
  }

  .cta-group {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    margin-top: 6px;
  }

  .cta-btn {
    width: 100%;
    height: 64px;
    min-height: 64px;
    padding: 8px 18px;
    gap: 14px;
    border-radius: 16px;
  }

  .cta-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    padding: 2px;
  }

  .cta-overline {
    font-size: 12px;
    line-height: 15px;
  }

  .cta-platform {
    font-size: 20px;
    line-height: 26px;
  }

  /* On mobile iOS, gently promote iOS button to top without hiding Android */
  .is-mobile-ios #ctaIos {
    order: -1;
    border-color: var(--primary);
    background-color: rgba(186, 207, 131, 0.12);
    color: var(--on-surface);
  }

  .is-mobile-ios #ctaIos .cta-platform {
    color: var(--primary);
  }

  /* Crisp centered mobile showcase of the 3-phone mockup */
  .hero-visual {
    width: 100%;
    max-width: 420px;
    margin: 4px auto 0;
    align-self: center;
  }

  .mockup-frame {
    aspect-ratio: 870 / 780;
  }

  .mockup-img {
    left: -37.41%;
    width: 161.62%;
    height: 104.48%;
  }

  .mockup-frame::after {
    height: 22%;
  }
}

/* Narrow phones (360px) micro-refinement */
@media (max-width: 375px) {
  .hero {
    padding-top: 22px;
    gap: 24px;
  }

  .hero-title {
    font-size: 36px;
    line-height: 0.98;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .cta-btn {
    height: 60px;
    min-height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
