/*
 * LOVIAN Pro home — mobile editorial layout
 * This file is loaded on phones, portrait tablets up to 1024px, and short
 * coarse-pointer landscape phones. Keep every rule scoped to the home-page
 * body so the desktop experience and the other pages stay intact.
 */
@media (max-width: 600px), (max-width: 1024px) and (orientation: portrait), (max-height: 500px) and (hover: none) and (pointer: coarse) {
  body.renewal-home {
    --mobile-gutter: 16px;
    --mobile-panel-pad: 20px;
    --mobile-panel-shadow: 0 20px 54px rgba(13, 43, 37, .11);
    --mobile-section-space: 72px;
    --mobile-scene-overlay: linear-gradient(180deg, rgba(13, 43, 37, .02) 42%, rgba(13, 43, 37, .3) 100%);
    --body-copy-size: 15px;
    background: #f7f4ed;
  }

  body.renewal-home #main-content {
    background: #f7f4ed;
    overflow: clip;
  }

  body.renewal-home .scroll-cue,
  body.renewal-home .auto-scroll-control { display: none !important; }

  body.renewal-home .oem-anchor-target {
    top: calc(var(--mobile-section-space, 72px) + 56.25vw - 46px);
    scroll-margin-top: 84px;
  }

  body.renewal-home .home-frame-layer,
  body.renewal-home .hero-visual.mobile-original-only,
  body.renewal-home .origin-image.mobile-original-only {
    display: none !important;
  }

  body.renewal-home .mobile-home-only { display: block; }

  body.renewal-home .scrolly-stage,
  body.renewal-home .scrolly-products-beat {
    position: relative;
    display: block;
  }

  body.renewal-home .home-shell {
    width: calc(100% - (var(--mobile-gutter) * 2));
    max-width: none;
  }

  body.renewal-home .section-space { padding-block: var(--mobile-section-space); }

  body.renewal-home .eyebrow {
    margin-bottom: 16px;
    font-size: 10px;
    line-height: 1.45;
    letter-spacing: .2em;
  }

  body.renewal-home .eyebrow::before {
    width: 22px;
    margin-right: 10px;
  }

  body.renewal-home :is(.section-heading h2, .origin-copy h2, .oem-copy h2, .contact-banner h2) {
    font-size: clamp(30px, 8.7vw, 38px);
    line-height: 1.42;
    letter-spacing: -.045em;
  }

  body.renewal-home .button {
    min-height: 56px;
    padding-inline: 18px;
  }

  body.renewal-home .text-link {
    min-height: 34px;
    align-items: center;
    font-size: 12px;
  }

  /* Shared cinematic Scene window */
  body.renewal-home .mobile-home-scene {
    --scene-focus: 50%;
    position: relative;
    z-index: 1;
    width: calc(100% - (var(--mobile-gutter) * 2));
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    background: var(--ink-deep);
    box-shadow: 0 18px 46px rgba(13, 43, 37, .14);
    isolation: isolate;
    overflow: hidden;
  }

  body.renewal-home .mobile-home-scene-01 { --scene-focus: 64%; }
  body.renewal-home .mobile-home-scene-02 { --scene-focus: 56%; }
  body.renewal-home .mobile-home-scene-03 { --scene-focus: 60%; }
  body.renewal-home .mobile-home-scene-04 { --scene-focus: 36%; }
  body.renewal-home .mobile-home-scene-05 { --scene-focus: 51%; }
  body.renewal-home .mobile-home-scene-06 { --scene-focus: 52%; }

  body.renewal-home .mobile-home-scene picture,
  body.renewal-home .mobile-home-scene img {
    width: 100%;
    height: 100%;
  }

  body.renewal-home .mobile-home-scene picture {
    position: absolute;
    inset: 0;
    display: block;
  }

  body.renewal-home .mobile-home-scene img {
    object-fit: cover;
    object-position: var(--scene-focus) center;
    filter: saturate(.86) contrast(1.025);
    transform: scale(1.002);
  }

  body.renewal-home .mobile-home-scene::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: var(--mobile-scene-overlay);
    content: "";
    pointer-events: none;
  }

  html.js-enabled.reveal-ready body.renewal-home .mobile-home-scene.reveal-on-scroll {
    opacity: 0;
    transform: translateY(14px) scale(.992);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
  }

  html.js-enabled.reveal-ready body.renewal-home .mobile-home-scene.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: none;
  }

  /* Hero */
  html.frames-ready body.renewal-home .home-hero.frame-target,
  body.renewal-home .home-hero {
    min-height: 0;
    padding: 14px 0 0;
    background:
      radial-gradient(circle at 92% 2%, rgba(201, 214, 200, .54), transparent 37%),
      var(--cream);
    overflow: hidden;
  }

  body.renewal-home .home-hero .hero-noise { opacity: .1; }

  body.renewal-home .home-hero .mobile-home-scene {
    width: calc(100% - 16px);
    margin-inline: 8px;
  }

  body.renewal-home .home-hero .hero-grid {
    position: relative;
    z-index: 2;
    display: block;
    width: calc(100% - (var(--mobile-gutter) * 2));
    margin: -28px auto 0;
    padding: 30px var(--mobile-panel-pad) 34px;
    background: rgba(251, 250, 246, .965);
    box-shadow: var(--mobile-panel-shadow);
  }

  body.renewal-home .home-hero .hero-copy {
    display: block;
    padding: 0;
  }

  body.renewal-home .hero-eyebrow { color: var(--gold); }

  body.renewal-home .hero-title {
    min-width: 0;
    font-size: clamp(38px, 10.8vw, 48px);
    line-height: 1.28;
    letter-spacing: -.07em;
  }

  body.renewal-home .hero-title > span > :is(span, em) {
    overflow-wrap: normal;
  }

  body.renewal-home .hero-lead {
    margin-top: 26px;
    color: #405850;
    font-size: 15px;
    line-height: 1.95;
  }

  body.renewal-home .hero-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    margin-top: 28px;
  }

  body.renewal-home .hero-actions .button-primary { width: 100%; }
  body.renewal-home .hero-actions .text-link { align-self: flex-start; }

  body.renewal-home .hero-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }

  body.renewal-home .hero-facts div,
  body.renewal-home .hero-facts div:last-child {
    grid-column: auto;
    min-width: 0;
    padding: 0 8px;
    border-left: 1px solid var(--line);
  }

  body.renewal-home .hero-facts div:first-child {
    padding-left: 0;
    border-left: 0;
  }

  body.renewal-home .hero-facts dt { font-size: 15px; }
  body.renewal-home .hero-facts dd {
    margin-top: 7px;
    font-size: 10px;
    line-height: 1.65;
    letter-spacing: .02em;
  }

  body.renewal-home .hero-grid::after {
    display: block;
    margin-top: 28px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .2em;
    text-align: right;
    content: "SCROLL  ↓";
  }

  /* Philosophy */
  html.frames-ready body.renewal-home .philosophy.frame-target,
  body.renewal-home .philosophy {
    padding: var(--mobile-section-space) 0 0;
    background: #f2efe8;
  }

  html.frames-ready body.renewal-home .philosophy.frame-target .philosophy-grid {
    position: relative;
    z-index: 2;
    display: block;
    width: calc(100% - (var(--mobile-gutter) * 2));
    margin: -28px auto 0;
    padding: 32px var(--mobile-panel-pad) 38px;
    background: rgba(251, 250, 246, .97);
    box-shadow: var(--mobile-panel-shadow);
  }

  html.frames-ready body.renewal-home .philosophy.frame-target .philosophy-grid > * {
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  body.renewal-home .philosophy-grid .philosophy-body {
    max-width: none;
    margin-top: 28px;
    padding: 0;
  }

  body.renewal-home .philosophy-body .large-copy {
    margin-bottom: 22px;
    font-size: clamp(19px, 5.5vw, 23px);
    line-height: 1.75;
  }

  body.renewal-home .philosophy-body > p:not(.large-copy) {
    color: #455c55;
    font-size: 15px;
    line-height: 2;
  }

  body.renewal-home .philosophy-body .text-link { margin-top: 24px; }

  html.frames-ready body.renewal-home .philosophy.frame-target .principle-grid,
  body.renewal-home .principle-grid {
    position: relative;
    display: grid;
    width: 100%;
    max-width: none;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(80vw, 340px);
    gap: 12px;
    margin: 48px 0 0;
    padding: 38px var(--mobile-gutter) 20px;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: var(--mobile-gutter);
    scroll-snap-type: x mandatory;
    scrollbar-color: var(--gold) rgba(20, 58, 50, .12);
    scrollbar-width: thin;
  }

  body.renewal-home .principle-grid::before {
    position: absolute;
    top: 0;
    left: var(--mobile-gutter);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .2em;
    content: "SWIPE  01 — 03";
  }

  body.renewal-home .principle-grid::-webkit-scrollbar { height: 3px; }
  body.renewal-home .principle-grid::-webkit-scrollbar-track { background: rgba(20, 58, 50, .1); }
  body.renewal-home .principle-grid::-webkit-scrollbar-thumb { background: var(--gold); }

  body.renewal-home .principle-grid:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
  }

  body.renewal-home .principle-card,
  body.renewal-home .principle-card:last-child {
    min-height: 276px;
    padding: 36px var(--mobile-panel-pad) 40px;
    color: var(--cream);
    border: 0;
    background: #143a32;
    box-shadow: 0 22px 56px rgba(0, 0, 0, .22);
    scroll-snap-align: start;
  }

  body.renewal-home .principle-card .principle-number {
    color: rgba(245, 241, 232, .58);
  }

  body.renewal-home .principle-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 27px;
  }

  body.renewal-home .principle-card .eyebrow {
    color: #a8b9b1;
  }

  body.renewal-home .principle-card h3 {
    margin-bottom: 12px;
    color: var(--gold);
    font-size: clamp(27px, 7.8vw, 32px);
  }

  body.renewal-home .principle-card > p:last-child {
    color: rgba(245, 241, 232, .82);
    font-size: 15px;
    line-height: 2;
  }

  /* The free-from table must remain fully opaque and high contrast. */
  html.frames-ready body.renewal-home .philosophy.frame-target .free-standard,
  body.renewal-home .free-standard {
    width: calc(100% - (var(--mobile-gutter) * 2));
    margin: 52px auto 0;
    padding: 30px var(--mobile-panel-pad) 28px;
    color: var(--ink);
    border: 1px solid rgba(20, 58, 50, .18);
    background: #fff;
    box-shadow: 0 18px 48px rgba(13, 43, 37, .08);
  }

  body.renewal-home .free-standard-intro {
    display: block;
  }

  html.frames-ready body.renewal-home .philosophy.frame-target .free-standard .eyebrow {
    margin-bottom: 16px;
    color: var(--ink);
  }

  html.frames-ready body.renewal-home .philosophy.frame-target .free-standard-intro h3 {
    color: var(--ink);
    font-size: clamp(27px, 7.8vw, 34px);
    line-height: 1.48;
  }

  html.frames-ready body.renewal-home .philosophy.frame-target .free-standard-intro > p:last-child {
    margin-top: 18px;
    color: #455c55;
    font-size: 14px;
    line-height: 1.9;
  }

  html.frames-ready body.renewal-home .philosophy.frame-target .free-standard-list,
  body.renewal-home .free-standard-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 26px;
    border-top-color: var(--line);
    border-left-color: var(--line);
    background: #fff;
  }

  html.frames-ready body.renewal-home .philosophy.frame-target .free-standard-list li,
  body.renewal-home .free-standard-list li {
    min-height: 76px;
    padding: 12px 10px;
    border-right-color: var(--line);
    border-bottom-color: var(--line);
    color: var(--gold);
    background: #fff;
    font-family: var(--serif);
    font-size: clamp(15px, 4.25vw, 18px);
    font-weight: 500;
    line-height: 1.55;
  }

  html.frames-ready body.renewal-home .philosophy.frame-target .free-standard-list li::before {
    flex: 0 0 auto;
    margin-right: 6px;
    color: var(--gold);
  }

  body.renewal-home .free-standard-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    margin-top: 22px;
  }

  html.frames-ready body.renewal-home .philosophy.frame-target .free-standard-foot p {
    color: #52645e;
    font-size: 12px;
    line-height: 1.8;
  }

  html.frames-ready body.renewal-home .philosophy.frame-target .free-standard .text-link {
    color: var(--ink);
  }

  /* Products */
  html.frames-ready body.renewal-home .products-showcase.frame-target,
  body.renewal-home .products-showcase {
    padding: var(--mobile-section-space) 0 20px;
    background: #e7e2d7;
  }

  body.renewal-home .products-head {
    position: relative;
    z-index: 2;
    display: block;
    width: calc(100% - (var(--mobile-gutter) * 2));
    margin: -28px auto 0;
    padding: 32px var(--mobile-panel-pad) 36px;
    background: rgba(247, 244, 237, .97);
    box-shadow: var(--mobile-panel-shadow);
  }

  body.renewal-home .products-head > div:last-child {
    max-width: none;
    margin-top: 26px;
    padding: 0;
  }

  body.renewal-home .products-head > div:last-child p {
    margin-bottom: 24px;
    color: #455c55;
    font-size: 15px;
    line-height: 1.95;
  }

  body.renewal-home .products-head .button { width: 100%; }

  body.renewal-home .product-rail {
    position: relative;
    display: grid;
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(4, min(80vw, 340px));
    gap: 12px;
    margin: 46px 0 0;
    padding: 38px var(--mobile-gutter) 20px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: var(--mobile-gutter);
    scroll-snap-type: x mandatory;
    scrollbar-color: var(--gold) rgba(20, 58, 50, .12);
    scrollbar-width: thin;
  }

  body.renewal-home .product-rail::before {
    position: absolute;
    top: 0;
    left: var(--mobile-gutter);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .2em;
    content: "SWIPE  01 — 04";
  }

  body.renewal-home .product-rail::-webkit-scrollbar { height: 3px; }
  body.renewal-home .product-rail::-webkit-scrollbar-track { background: rgba(20, 58, 50, .1); }
  body.renewal-home .product-rail::-webkit-scrollbar-thumb { background: var(--gold); }

  body.renewal-home .feature-product {
    min-height: 458px;
    padding: 20px;
  }

  body.renewal-home .feature-product-image { width: 96%; }
  body.renewal-home .feature-product-image.portrait { width: 67%; }
  body.renewal-home .feature-product-copy h3 { font-size: 23px; }
  body.renewal-home .feature-product-copy p { font-size: 13px; }

  /* Origin */
  html.frames-ready body.renewal-home .origin-story.frame-target,
  body.renewal-home .origin-story {
    display: block;
    padding: var(--mobile-section-space) 0 0;
    background: var(--ink-deep);
  }

  body.renewal-home .origin-story .scrolly-stage { display: block; }

  html.frames-ready body.renewal-home .origin-story.frame-target .origin-copy,
  body.renewal-home .origin-copy {
    position: relative;
    z-index: 2;
    display: block;
    width: calc(100% - (var(--mobile-gutter) * 2));
    margin: -28px auto 0;
    padding: 36px var(--mobile-panel-pad) 40px;
    color: var(--cream);
    background: #143a32;
    box-shadow: 0 22px 56px rgba(0, 0, 0, .22);
  }

  body.renewal-home .origin-copy > p:not(.eyebrow),
  html.frames-ready body.renewal-home .origin-story.frame-target .origin-copy > p:not(.eyebrow) {
    margin-top: 24px;
    color: rgba(245, 241, 232, .82);
    font-size: 15px;
    line-height: 2;
  }

  body.renewal-home .origin-copy .button {
    width: 100%;
    margin-top: 30px;
  }

  /* OEM */
  html.frames-ready body.renewal-home .oem-section.frame-target,
  body.renewal-home .oem-section {
    padding: var(--mobile-section-space) 0 0;
    background: #f2efe8;
  }

  body.renewal-home .oem-section .home-shell {
    position: relative;
    z-index: 2;
    width: calc(100% - (var(--mobile-gutter) * 2));
    margin: -28px auto 0;
  }

  html.frames-ready body.renewal-home .oem-section.frame-target .oem-panel,
  body.renewal-home .oem-panel {
    display: block;
    min-height: 0;
    padding: 38px var(--mobile-panel-pad) 32px;
    border: 0;
    background: #143a32;
    box-shadow: var(--mobile-panel-shadow);
  }

  body.renewal-home .oem-index {
    top: 14px;
    right: 16px;
    font-size: 9px;
  }

  body.renewal-home .oem-copy h2 { font-size: clamp(29px, 8.3vw, 37px); }

  body.renewal-home .oem-copy > p:not(.eyebrow) {
    margin-top: 24px;
    color: rgba(255, 255, 255, .82);
    font-size: 15px;
    line-height: 1.95;
  }

  body.renewal-home .oem-copy .button {
    width: 100%;
    margin-top: 28px;
  }

  body.renewal-home .oem-steps,
  html.frames-ready body.renewal-home .oem-section.frame-target .oem-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, .2);
    border-left: 1px solid rgba(255, 255, 255, .2);
  }

  body.renewal-home .oem-steps li {
    min-height: 104px;
    grid-template-columns: 24px minmax(0, 1fr);
    align-content: center;
    padding: 13px 10px;
    border-right: 1px solid rgba(255, 255, 255, .2);
    border-bottom: 1px solid rgba(255, 255, 255, .2);
  }

  body.renewal-home .oem-steps li span { font-size: 10px; }
  body.renewal-home .oem-steps strong { font-size: 15px; }
  body.renewal-home .oem-steps small {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.55;
  }

  body.renewal-home .oem-watermark { display: none; }

  /* Scene 06 continues directly from News into Contact. */
  html.frames-ready body.renewal-home .news-section.frame-target,
  body.renewal-home .news-section {
    padding: var(--mobile-section-space) 0 0;
    background: var(--paper);
  }

  html.frames-ready body.renewal-home .news-section.frame-target .news-grid,
  body.renewal-home .news-grid {
    position: relative;
    z-index: 2;
    display: block;
    width: calc(100% - (var(--mobile-gutter) * 2));
    margin: -28px auto 0;
    padding: 32px var(--mobile-panel-pad) 38px;
    border: 0;
    background: #fff;
    box-shadow: var(--mobile-panel-shadow);
  }

  body.renewal-home .news-grid .section-heading .text-link { margin-top: 22px; }

  body.renewal-home .news-list {
    margin-top: 32px;
    border-top-color: var(--line);
    background: #fff;
  }

  body.renewal-home .news-empty {
    min-height: 116px;
    padding: 24px 4px;
    background: #fff;
    font-size: 14px;
  }

  html.frames-ready body.renewal-home .contact-banner.frame-target,
  body.renewal-home .contact-banner {
    padding: 12px var(--mobile-gutter) calc(64px + env(safe-area-inset-bottom));
    background: var(--paper);
  }

  html.frames-ready body.renewal-home .contact-banner.frame-target .contact-banner-inner,
  body.renewal-home .contact-banner-inner {
    display: block;
    width: 100%;
    margin: 0;
    padding: 34px var(--mobile-panel-pad) 30px;
    border: 0;
    background: var(--sage);
    box-shadow: 0 18px 48px rgba(13, 43, 37, .1);
  }

  body.renewal-home .contact-banner .eyebrow { margin-bottom: 14px; }

  html[lang="ja"] body.renewal-home .contact-banner h2 i {
    display: block;
    margin-top: 8px;
    font-size: clamp(20px, 6.2vw, 25px);
    letter-spacing: -.04em;
    white-space: nowrap;
  }

  body.renewal-home .contact-circle {
    width: 100%;
    min-height: 56px;
    aspect-ratio: auto;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    margin-top: 28px;
    padding: 0 18px;
    border-radius: 0;
    font-size: 12px;
  }

  body.renewal-home .contact-circle:hover { transform: none; }

  /* The top-page footer is tightened only on mobile. */
  body.renewal-home .site-footer-main {
    width: calc(100% - (var(--mobile-gutter) * 2));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 38px 20px;
    padding: 58px 0 46px;
  }

  body.renewal-home .footer-brand-block,
  body.renewal-home .footer-company-block {
    grid-column: 1 / -1;
  }

  body.renewal-home .footer-brand-block { padding-bottom: 30px; }
  body.renewal-home .footer-brand-block img { width: 176px; }

  body.renewal-home .footer-company-block {
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, .12);
  }

  body.renewal-home .site-footer-bottom {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 22px var(--mobile-gutter) calc(22px + env(safe-area-inset-bottom));
    letter-spacing: .06em;
  }

  body.renewal-home .site-footer-bottom a { justify-self: start; }

  /* Translation-specific measures keep headings readable without orphaned glyphs. */
  html[data-current-lang="en"] body.renewal-home .hero-title {
    font-size: clamp(33px, 9.3vw, 42px);
    line-height: 1.3;
    letter-spacing: -.045em;
  }

  html[data-current-lang="en"] body.renewal-home .philosophy .section-heading h2 i::before {
    content: " ";
  }

  html[data-current-lang="en"] body.renewal-home :is(.section-heading h2, .origin-copy h2, .oem-copy h2, .contact-banner h2),
  html[data-current-lang="th"] body.renewal-home :is(.section-heading h2, .origin-copy h2, .oem-copy h2, .contact-banner h2) {
    font-size: clamp(28px, 8vw, 35px);
    letter-spacing: -.025em;
  }

  html[data-current-lang="th"] body.renewal-home .hero-title {
    font-size: clamp(30px, 8.4vw, 38px);
    line-height: 1.45;
    letter-spacing: -.015em;
  }

  html[data-current-lang="th"] body.renewal-home :is(.hero-lead, .philosophy-body > p:not(.large-copy), .products-head > div:last-child p, .origin-copy > p:not(.eyebrow), .oem-copy > p:not(.eyebrow)) {
    line-height: 1.85;
  }

  @media (max-width: 350px) {
    body.renewal-home {
      --mobile-gutter: 12px;
      --mobile-panel-pad: 18px;
    }

    body.renewal-home .hero-title { font-size: 34px; }

    body.renewal-home .hero-facts {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 18px 0;
    }

    body.renewal-home .hero-facts div:last-child { grid-column: 1 / -1; }
    body.renewal-home .free-standard-list li { padding-inline: 8px; font-size: 15px; }
    body.renewal-home .oem-copy h2 { font-size: 24px; line-height: 1.5; }
    html[lang="ja"] body.renewal-home .contact-banner h2 i { font-size: 18px; }
  }

  @media (prefers-reduced-motion: reduce) {
    body.renewal-home .mobile-home-scene {
      opacity: 1 !important;
      transform: none !important;
    }
  }
}
