/* ownvirtual.land: phones and tablets. Loaded after app.css and appeal.css.
   Breakpoints follow the rest of the site: 860px (tablet / nav drawer) and 620px (phone). */

/* ---------- Page header and the menu drawer ---------- */
.page-top {
  position: relative;
  z-index: 20;
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-left: max(1.3rem, env(safe-area-inset-left));
  padding-right: max(1.3rem, env(safe-area-inset-right));
}
.page-top .nav-inline { align-items: center; }
.page-top .nav-inline .btn { min-height: 40px; }
.nav-drawer { display: none; position: relative; margin-left: auto; }
.nav-drawer summary, .menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.45rem 0.95rem 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 8, 16, 0.55);
  backdrop-filter: blur(12px);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.nav-drawer summary::-webkit-details-marker { display: none; }
.nav-burger { position: relative; width: 16px; height: 2px; border-radius: 2px; background: currentColor; box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor; transition: transform .2s ease, box-shadow .2s ease; }
details[open] > summary .nav-burger { transform: rotate(45deg); box-shadow: 0 0 0 currentColor, 0 0 0 currentColor; }
details[open] > summary .nav-burger::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; transform: rotate(90deg); }
.page-top .drawer-panel, .menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 30;
  display: grid;
  gap: 2px;
  align-content: start;
  grid-auto-rows: max-content;
  width: min(320px, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 6rem - env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 0.45rem;
  border-radius: 18px;
  background: rgba(12, 12, 22, 0.96);
  border: 1px solid rgba(255, 236, 190, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
}
.page-top .drawer-panel a, .menu-panel a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.9rem;
  border-radius: 12px;
  color: var(--text);
  font-size: 1.02rem;
  text-decoration: none;
}
.page-top .drawer-panel a:hover, .menu-panel a:hover, .page-top .drawer-panel a[aria-current="page"] { background: rgba(246, 213, 106, 0.12); color: #fff; }
.page-top .drawer-panel a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold); }
.page-top .drawer-panel .btn, .page-top .drawer-panel form { width: 100%; margin-top: 0.35rem; }
.page-top .drawer-panel .btn { min-height: 48px; justify-content: center; color: #1b1022; }
.page-top .drawer-panel .btn-ghost { color: #fff; }
.top .menu-panel { display: grid; gap: 2px; }
.menu-panel .menu-sub { margin: 0.5rem 0.9rem 0.1rem; color: #f6d56a; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; }
.menu-panel a.menu-fine { min-height: 44px; font-size: 0.92rem; color: var(--muted); }

@media (max-width: 860px) {
  .page-top { padding-bottom: 0.6rem; gap: 0.6rem; }
  .page-top .nav-inline { display: none; }
  .page-top .nav-drawer { display: block; }
  .page-top .logo, .top .logo { display: inline-flex; align-items: center; min-height: 44px; }
  .menu-panel { position: fixed; right: max(0.75rem, env(safe-area-inset-right)); top: calc(env(safe-area-inset-top) + 4.4rem); }
}
@media (max-width: 620px) {
  .page-top .pill { display: none; }
}

/* ---------- Never scroll sideways ---------- */
html, body { overflow-x: clip; }
img, svg, video, canvas { max-width: 100%; }
.wrap { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.prose, .auth-card, .reveal, .glass { overflow-wrap: anywhere; }
.prose pre, .prose code { white-space: pre-wrap; }

/* ---------- Footer: links big enough to tap, clear of the home indicator ---------- */
.legal-foot { padding-bottom: max(2rem, calc(1rem + env(safe-area-inset-bottom))); padding-left: max(1.4rem, env(safe-area-inset-left)); padding-right: max(1.4rem, env(safe-area-inset-right)); }
@media (max-width: 860px) {
  .legal-foot nav { gap: 0 1rem; }
  .legal-foot nav a { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
  .home-legal nav a { min-height: 40px; }
}

/* ---------- Tap targets and forms ---------- */
@media (max-width: 860px) {
  main button, main select, main textarea,
  main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]) { min-height: 44px; }
  .inline-form button:not(.btn) { padding: 0.45rem 0.9rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.08); color: inherit; }
  .choices button, .swatch { min-height: 44px; padding: 0.35rem 0.9rem; }
  input[type="color"] { width: 48px; height: 44px; }
  .check { min-height: 44px; align-items: center; }
  .check input, .switch input { width: 22px; height: 22px; flex: none; }
  .switch { min-height: 48px; }
  .switch label { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; }
  .legal-doc ul li a, .legal-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .cards article h3 a, .stack h3 a { display: inline-flex; align-items: center; min-height: 44px; }
  .stat a { display: flex; align-items: center; min-height: 44px; }
  .btn { min-height: 46px; }
}
@media (max-width: 620px) {
  /* Forms run the full width of their card on phones. */
  main form .field, main form label.field { width: 100%; }
  main form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
  main form select, main form textarea { width: 100%; max-width: 100%; }
  .auth-card form > .btn, .auth-card form > button[type="submit"], .auth-card > .btn, .prose form > .btn, .glass form > button[type="submit"] { width: 100%; }
  .inline-form button { min-width: 44px; }
  .auth-card, .prose, .reveal { width: calc(100% - 1.25rem); padding: 1.15rem 1rem 1rem; border-radius: 20px; }
  .wrap { width: calc(100% - 1.25rem); }
  .page h1, .wrap > h1 { font-size: clamp(2.1rem, 9.5vw, 2.8rem); overflow-wrap: anywhere; }
  .lede { font-size: 1.2rem; }
  .btn-row > .btn { flex: 1 1 auto; }
}

/* ---------- Tables: scroll sideways inside their box, never the page ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; max-width: 100%; }
@media (max-width: 860px) {
  .table-wrap table { min-width: 560px; }
  .table-wrap td, .table-wrap th { white-space: nowrap; }
  .table-wrap { mask-image: linear-gradient(90deg, #000 85%, rgba(0,0,0,0.35)); }
  .table-wrap:hover, .table-wrap:focus-within { mask-image: none; }
  .switches { grid-template-columns: 1fr; }
  .desk-stats, .stats { grid-template-columns: 1fr 1fr; }
  .stat strong, .stat a { font-size: 1.4rem; overflow-wrap: anywhere; }
}

/* ---------- Deed and passport: scale to fit the phone ---------- */
@media (max-width: 860px) {
  .deed-wrap { min-height: 0; padding-top: 0.5rem; }
  .deed { padding: 1.6rem 1.1rem 1.2rem; }
  .deed h1 { font-size: clamp(1.9rem, 8.5vw, 2.6rem); overflow-wrap: anywhere; }
  .deed.framed { outline-width: 6px; outline-offset: 5px; width: calc(100% - 22px); }
  .seal-row { flex-wrap: wrap; }
  .wax, .wax-seal-deed { width: 88px; height: 88px; }
  .sign { font-size: 1.35rem; }
  .stage { min-height: 0; gap: 1rem; padding-top: 0.5rem; }
  .cover { width: min(300px, 100%); margin: 0 auto; aspect-ratio: auto; min-height: 340px; }
  .spread { min-height: 0; }
  .spread .page-in { padding: 1.1rem 1rem; }
  .spread .page-in + .page-in { border-top: 1px dashed rgba(36, 24, 15, 0.25); }
  .seal { width: 92px; height: 92px; font-size: 0.6rem; }
  .flag-stage { height: 190px; }
  .designer { gap: 0.8rem; }
}

/* ---------- Land page globe: drag sideways to turn, pinch to zoom, swipe up/down scrolls the page ---------- */
.land-globe canvas { touch-action: pan-y !important; }
@media (max-width: 860px) {
  .land-layout { min-height: 0; gap: 0.8rem; }
  .land-globe { min-height: 0; height: min(62vh, 440px); border-radius: 22px; }
  .land-layout .claim { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
}

/* ---------- Home globe: full screen, the globe owns every touch, the page itself never scrolls or bounces ---------- */
body:has(.globe-full) { height: 100%; overflow: hidden; overscroll-behavior: none; }
html:has(.globe-full) { height: 100%; overflow: hidden; overscroll-behavior: none; }
.globe-full canvas { touch-action: none; }
.globe-full { height: 100dvh; }
.top { padding-top: max(1.1rem, env(safe-area-inset-top)); padding-left: max(1.4rem, env(safe-area-inset-left)); padding-right: max(1.4rem, env(safe-area-inset-right)); z-index: 7; }
@media (max-width: 860px) {
  .top { padding-top: max(0.8rem, env(safe-area-inset-top)); padding-left: max(0.9rem, env(safe-area-inset-left)); padding-right: max(0.9rem, env(safe-area-inset-right)); gap: 0.55rem; }
  .top .btn { min-height: 44px; padding: 0.45rem 1rem; }
  .hero-copy { bottom: calc(4.9rem + env(safe-area-inset-bottom)); left: max(1rem, env(safe-area-inset-left)); right: max(1rem, env(safe-area-inset-right)); }
  .home-legal { padding-bottom: max(0.35rem, env(safe-area-inset-bottom)); }
  body:has(.home-legal) .ticker { bottom: calc(2.6rem + env(safe-area-inset-bottom)); }
  .zoom-ctl button { width: 44px; height: 44px; }
}
@media (max-width: 620px) {
  .hero-copy h1 { font-size: clamp(2.3rem, 11vw, 2.9rem); line-height: 0.95; }
  .find-home input { font-size: 16px; } /* 16px stops iOS zooming the page on focus */
  .legal-line { font-size: 0.82rem; }
}

/* ---------- Claim card: a bottom sheet on phones and tablets ---------- */
.pc-grab { display: none; }
@media (max-width: 860px) {
  .place-card {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    width: auto;
    max-width: 560px;
    margin: 0 auto;
    transform: none;
    max-height: min(82dvh, 640px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.4rem max(1.1rem, env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(1.1rem, env(safe-area-inset-left));
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    touch-action: pan-y;
    background: linear-gradient(180deg, rgba(40, 46, 78, .86), rgba(16, 18, 34, .94));
  }
  .place-card.is-in { animation: sheet-up .45s cubic-bezier(.2, .8, .2, 1); }
  .place-card.is-dragging { transition: none; animation: none; }
  .place-card.is-settling { transition: transform .25s ease; }
  .pc-grab { display: block; width: 100%; height: 26px; margin: 0 0 0.2rem; border: 0; padding: 0; background: transparent; cursor: grab; touch-action: none; }
  .pc-grab::before { content: ""; display: block; width: 44px; height: 5px; margin: 0 auto; border-radius: 99px; background: rgba(255, 255, 255, .38); }
  .pc-close { width: 44px; height: 44px; top: 0.5rem; right: max(0.6rem, env(safe-area-inset-right)); font-size: 1.3rem; }
  .pc-claim, .pc-gift { min-height: 52px; }
  .pc-more { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 0.3rem; }
  .fly-status { bottom: calc(5rem + env(safe-area-inset-bottom)); }
}

/* ---------- Crown page ---------- */
@media (max-width: 860px) {
  .crown-page { overflow-x: clip; padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
  .crown-chip { min-height: 44px; }
  .crown-style { min-height: 44px; padding-inline: 0.9rem; }
  .crown-flag-chip { min-width: 44px; min-height: 44px; }
  .crown-name input { min-height: 44px; }
  .crown-page summary { display: flex; align-items: center; min-height: 44px; }
}
@media (max-width: 620px) {
  .passport-book { max-width: calc(100vw - 2.5rem); margin-top: 0.2rem; }
}

/* ---------- Gift, wishlist, reveal ---------- */
@media (max-width: 620px) {
  .occasions { grid-template-columns: 1fr 1fr; }
  .occasions button, .occasions a { min-height: 52px; }
  .wrap-gift { width: 120px; height: 86px; }
}
@keyframes sheet-up { from { opacity: 0.6; transform: translateY(40%); } to { opacity: 1; transform: none; } }

/* Land page: places inside this area, as a tappable list */
.inside-list { list-style: none; margin: 0.3rem 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.35rem; }
.inside-list a { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.35rem; min-height: 44px; padding: 0.3rem 0.7rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); text-decoration: none; line-height: 1.2; }
.inside-list a span { text-decoration: underline; text-decoration-color: rgba(255,255,255,0.35); text-underline-offset: 3px; }
.inside-list a small { color: var(--muted); font-size: 0.78rem; }
.inside-list a:hover { border-color: rgba(246,213,106,0.55); background: rgba(246,213,106,0.08); }

@media (max-width: 860px) {
  .press-shots figcaption { padding-bottom: 0.2rem; }
  .press-page a { min-height: 44px; display: inline-flex; align-items: center; }
}
