
:root{
  /* ...your existing vars... */

  /* ✅ Lusano-like safe frame (outer breathing space) */
  --frame-x: 28px;            /* left/right gutter */
  --frame-top-extra: 26px;    /* extra space below topbar */
  --frame-bottom-extra: 28px; /* extra space above bottombar */
}

@media (max-width: 1024px){
  :root{
    --frame-x: 18px;
    --frame-top-extra: 18px;
    --frame-bottom-extra: 18px;
  }
}

@media (max-width: 560px){
  :root{
    --frame-x: 14px;
    --frame-top-extra: 14px;
    --frame-bottom-extra: 14px;
  }
}


:root{
  --bg:#E9E3D6;
  --ink:#1a1713;
  --grid: rgba(26,23,19,.02);
  --gridBold: rgba(26,23,19,.06);

  --tileW:260px;
  --tileH:320px;
  --border:rgba(26,23,19,.14);
  --shadow:0 14px 40px rgba(0,0,0,.08);
  --accent:#2f3b20;
}


*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background:var(--bg);
  color:#551912;
  overflow:hidden;
  overscroll-behavior:none;
  font-family: 'Qanelas-Regular', sans-serif;
}

/* Background */
.viewport{
  position:fixed;
  inset:0;
  user-select:none;
  touch-action:none; /* ✅ enables touch/pen drag; no effect on desktop mouse */

  background:
    linear-gradient(to right, var(--grid) 1px, transparent 2px) 0 0 / 24px 24px,
    linear-gradient(to bottom, var(--grid) 1px, transparent 2px) 0 0 / 24px 24px,
    linear-gradient(to right, var(--grid) 1px, transparent 2px) 0 0 / 24px 24px,
    linear-gradient(to bottom, var(--grid) 1px, transparent 2px) 0 0 / 24px 24px,
    var(--bg);
}

.world{
  position:absolute;
  inset:0;
  will-change: transform;
  transform-origin: 0 0;
}

.tiles{
  position:absolute;
  left:0; top:0;
  width: 1px; height: 1px;
}

/* Tile */
.tile{
  position:absolute;
  width:var(--tileW);
  height:var(--tileH);
  text-decoration:none;
  color:inherit;
  -webkit-tap-highlight-color: transparent;
}

.tile__imgWrap{
  width:100%;
  height:calc(var(--tileH) - 44px);
  border-radius:var(--radius);
  overflow:hidden;
  border:1px solid var(--border);
  background:#e9dfd1;
  box-shadow: var(--shadow);

  transform: translateZ(0);
  transform-origin: 50% 100%; /* bottom-center */
  will-change: transform;

  transition:
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 260ms ease,
    border-color 260ms ease;
}

/* ✅ Card “pull-in” hover (scales the whole card container) */
@media (hover:hover) and (pointer:fine){
  .tile:hover{ z-index:50; }

  .tile:hover .tile__imgWrap{
    transform: translateY(-10px) scale(1.26); /* increase scale for more pull */
    border-color: rgba(26,23,19,.22);
  }
}

.tile img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  filter:saturate(.98) contrast(1.02);
}

/* Lusano vibe: label subtle on hover */
.tile__label{
  margin-top:10px;
  font-size: 22px;
  opacity:0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
  line-height:1.2;
  font-family: "Qanelas", sans-serif;
  font-weight: 500; /* Medium */
}
.tile:hover .tile__label{
  opacity:.88;
  transform: translateY(0);
}

/* Top bar */
.topbar{
  position:fixed;
  top:0; left:0; right:0;
  height:74px;
  padding:18px 22px;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  pointer-events:none;
}
.brand, .pill, .meta{ pointer-events:auto; }

.brand{ font-size:16px; opacity:.92; }
.meta{ font-size:13px; opacity:.85; }

.pill{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(26,23,19,.14);
  background: rgba(255,255,255,.28);
  backdrop-filter: blur(6px);
}
.pill__btn{
  border:0;
  background:transparent;
  font-size:16px;
  cursor:pointer;
  color:inherit;
}
.pill__text{ font-size:13px; opacity:.9; }

/* Bottom bar */
.bottombar{
  position:fixed;
  left:0; right:0; bottom:0;
  height:92px;
  padding:18px 22px;
  z-index:20;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  pointer-events:none;
}

/* ✅ View switch (replaces filters UI) */
.viewSwitch{ pointer-events:auto; }

.viewSwitch{
  display:flex;
  gap:8px;
  padding:8px;
  border-radius:999px;
  border:1px solid rgba(26,23,19,.14);
  background: rgba(255,255,255,.28);
  backdrop-filter: blur(6px);
  max-width: calc(100vw - 44px);
}

.viewSwitch__btn{
  appearance:none;
  border:1px solid rgba(26,23,19,.14);
  background: rgba(255,255,255,.18);
  color:inherit;
  cursor:pointer;
  border-radius:10px;
  width:46px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  line-height:1;
  opacity:.92;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}
.viewSwitch__btn:active{ transform: translateY(1px); }

.viewSwitch__btn.is-active{
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  opacity:1;
}

.viewSwitch__icon{
  width:18px;
  height:18px;
  display:block;
}

.viewSwitch__icon--solid rect{ fill: currentColor; }
.viewSwitch__icon--outline rect{ fill:none; stroke: currentColor; stroke-width:1.4; }
.viewSwitch__icon--outline line{ stroke: currentColor; stroke-width:1.4; stroke-linecap:round; }

.viewSwitch__label{ display:none; }

/* Normal page placeholder */
.normalPage{
  position:fixed;
  inset:0;
  z-index:5;
  display:none;
  align-items:center;
  justify-content:center;
  background: var(--bg);
  padding: 24px;
}

.normalCard{
  width:min(520px, calc(100vw - 48px));
  border:1px solid rgba(26,23,19,.14);
  border-radius:18px;
  background: rgba(255,255,255,.34);
  backdrop-filter: blur(6px);
  padding: 18px 18px 16px;
  box-shadow: 0 18px 70px rgba(0,0,0,.10);
}

.normalTitle{
  font-size:16px;
  opacity:.92;
  margin-bottom:6px;
}

.normalText{
  font-size:13px;
  opacity:.72;
  line-height:1.4;
}

/* View toggling */
body[data-view="normal"] #viewport{ display:none; }
body[data-view="normal"] #normalPage{ display:flex; }

/* Crosshair */
.crosshair{
  position:fixed;
  left:50%;
  top:50%;
  width:14px;
  height:14px;
  transform:translate(-50%,-50%);
  opacity:.35;
  pointer-events:none;
  z-index:10;
}
.crosshair::before,
.crosshair::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  background:rgba(26,23,19,.55);
  transform:translate(-50%,-50%);
}
.crosshair::before{ width:14px; height:1px; }
.crosshair::after{ width:1px; height:14px; }

/* Loader */
.loader{
  position:fixed;
  inset:0;
  background:var(--bg);
  z-index:999;
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  padding:22px;
  transition: opacity 240ms ease, visibility 240ms ease;
}
.loader.is-hidden{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}
.loader__pct{
  font-size:16px;
  letter-spacing:.10em;
}

/* ===========================
   Tablet + Mobile ONLY
   (desktop unchanged)
   =========================== */
@media (max-width: 1024px){
  .topbar{
    height:66px;
    padding:14px 16px;
  }
  .bottombar{
    height:82px;
    padding:14px 16px;
  }
  .tile__label{
    font-size:12px;
    margin-top:8px;
  }
}

@media (max-width: 560px){
  .topbar{
    height:60px;
    padding:12px 14px;
  }
  .bottombar{
    height:74px;
    padding:12px 14px;
  }
  .brand{ font-size:14px; }
  .meta{ font-size:12px; }
}
.brand{
  display:flex;
  align-items:center;
  pointer-events:auto;
}

.brand img{
  height: 22px;      /* change if you want bigger */
  width: auto;
  display:block;
  object-fit: contain;
}

/* ===========================
   ✅ NEW: Modern minimal view switch
   (replace your old .viewSwitch styles with this)
   =========================== */

/* Bottom bar stays as-is (no change needed) */
/* .bottombar { ... } */

.viewSwitch{
  pointer-events:auto;
  position:relative;
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px;

  border-radius:999px;
  border:1px solid rgba(26,23,19,.10);
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 18px 60px rgba(0,0,0,.10);

  max-width: calc(100vw - 44px);
}

.viewSwitch__btn{
  position:relative;
  width:44px;
  height:44px;
  border-radius:999px;

  display:grid;
  place-items:center;

  text-decoration:none;
  color: rgba(85,25,18,.92); /* matches your body ink */
  background: transparent;
  border:0;

  opacity:.95;
  transition:
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.viewSwitch__btn::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  box-shadow: inset 0 0 0 1px rgba(26,23,19,.10);
  pointer-events:none;
  opacity:.85;
  transition: opacity 180ms ease, box-shadow 180ms ease;
}

@media (hover:hover) and (pointer:fine){
  .viewSwitch__btn:hover{
    background: rgba(255,255,255,.26);
    transform: translateY(-1px);
  }
  .viewSwitch__btn:hover::after{ opacity:1; }
}

.viewSwitch__btn:active{
  transform: translateY(0) scale(.98);
}

.viewSwitch__btn:focus-visible{
  outline:none;
  box-shadow: 0 0 0 3px rgba(47,59,32,.18);
}

/* Active state */
.viewSwitch__btn.is-active{
  background: var(--accent);
  color:#fff;
  opacity:1;
  box-shadow: 0 12px 30px rgba(47,59,32,.22);
}

.viewSwitch__btn.is-active::after{
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
  opacity:1;
}

.viewSwitch__icon{
  width:18px;
  height:18px;
  display:block;
}

.viewSwitch__icon--solid rect{ fill: currentColor; }
.viewSwitch__icon--outline rect{ fill:none; stroke: currentColor; stroke-width:1.4; }
.viewSwitch__icon--outline line{ stroke: currentColor; stroke-width:1.4; stroke-linecap:round; }

/* Keep labels for accessibility but visually hidden */
.viewSwitch__label{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip: rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ===========================
   Qanelas (self-hosted)
   Put files in /fonts and keep names the same
   =========================== */
@font-face{
  font-family:"Qanelas";
  src:url("../fonts/Qanelas-Regular.otf") format("otf");
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Qanelas";
  src:url("../fonts/Qanelas-Medium.ttf") format("ttf");
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Qanelas";
  src:url("../fonts/Qanelas-SemiBold.ttf") format("ttf");
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Qanelas";
  src:url("../fonts/Qanelas-Bold.ttf") format("ttf");;
  font-style:normal;
  font-display:swap;
}

#clock{
  font-family: "Qanelas", sans-serif;
  font-weight: 500; /* Medium */
}
