:root{
  --ink:#20252a;
  --muted:#9ba1aa;
  --line:#e5e7ea;
  --panel:rgba(255,255,255,.82);
  --panel-w:clamp(350px,24.5vw,405px);
  --panel-gap:clamp(16px,1.5vw,24px);
  --swatch-size:32px;
  --swatch-gap:10px;
}

*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0}
html{overflow:hidden}
body{
  font-family:'Inter',sans-serif;
  background:#f4f5f6;
  color:var(--ink);
  overflow:hidden;
}
button{font-family:inherit}

.configurator-page,.hero-stage{
  width:100%;
  height:100vh;
  height:100dvh;
}
.hero-stage{
  position:relative;
  overflow:hidden;
  background:#f7f8f9;
}

/* Background stays behind a transparent PlayCanvas iframe. */
.mountain-bg{
  position:absolute;
  inset:0;
  background:url('assets/mountain-bg.jpg') center/cover no-repeat;
  z-index:0;
}
.mountain-bg:after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(90deg,rgba(255,255,255,.72) 0%,rgba(255,255,255,.45) 47%,rgba(255,255,255,.26) 70%,rgba(255,255,255,.42) 100%);
}

/* Header */
.topbar{
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:clamp(72px,9.5vh,90px);
  padding:0 clamp(24px,3vw,48px);
  z-index:30;
  background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(255,255,255,.64) 65%,rgba(255,255,255,0));
}
.brand{gap:16px;color:#22272c}
.brand-mark{width:39px;height:28px;display:inline-block;position:relative;flex:0 0 auto}
.brand-mark span{position:absolute;bottom:1px;width:25px;height:4px;background:#252a2f;transform-origin:left center;border-radius:2px}
.brand-mark span:first-child{left:1px;transform:rotate(-48deg)}
.brand-mark span:last-child{left:17px;transform:rotate(48deg)}
.brand-name{font-size:clamp(16px,1.25vw,20px);font-weight:700;letter-spacing:clamp(3.8px,.35vw,5.5px);white-space:nowrap}
.brand-divider{height:28px;width:1px;background:#d6d9dd;margin-left:28px}
.tagline{font-size:11px;letter-spacing:4.1px;color:#9ca1aa;margin-left:32px;font-weight:500;white-space:nowrap}
.nav-links{gap:clamp(20px,2.2vw,36px)}
.nav-links a{color:#7e858d;text-decoration:none;font-size:13px;font-weight:500}
.nav-divider{width:1px;height:28px;background:#e1e3e6;margin-left:4px}
.icon-btn,.avatar-btn{border:0;background:transparent;color:#2d3338;padding:0;display:flex;align-items:center;justify-content:center}
.icon-btn{font-size:26px}
.avatar-btn{width:38px;height:38px;border-radius:50%;background:rgba(215,219,223,.68);font-size:24px;flex:0 0 auto}

/* Left marketing copy */
.hero-copy{
  position:absolute;
  left:clamp(32px,3.35vw,55px);
  top:clamp(98px,12.3vh,118px);
  z-index:12;
  width:clamp(270px,21vw,330px);
  pointer-events:none;
}
.eyebrow{font-size:12px;letter-spacing:5px;font-weight:700;margin-bottom:15px;color:#343a3f}
.hero-copy h1{margin:0;font-size:clamp(36px,3vw,44px);line-height:1.03;letter-spacing:-1.3px;font-weight:800;color:#24292e}
.hero-copy p{font-size:16px;color:#8b929b;margin:14px 0 0;font-weight:400}
.red-line{width:58px;height:2px;background:#ed4036;margin-top:34px}

/* PlayCanvas area */
.iframe-shell{
  position:absolute;
  inset:0 calc(var(--panel-w) + var(--panel-gap) + 18px) 0 0;
  z-index:3;
  pointer-events:auto;
}
#app{
  width:100%;
  height:100%;
  border:0;
  display:block;
  background:transparent;
  position:relative;
  z-index:2;
}

.bottom-copy{
  position:absolute;
  left:clamp(32px,3vw,50px);
  bottom:clamp(34px,6.3vh,59px);
  z-index:12;
  display:grid;
  gap:3px;
  color:#a0a7b1;
  font-size:10px;
  letter-spacing:4px;
  font-weight:500;
  pointer-events:none;
}
.bottom-line{position:absolute;width:47px;height:1px;background:#cfd3d8;left:170px;top:17px}

/* Controls */
.control-panel{
  position:absolute;
  z-index:20;
  top:clamp(76px,9.2vh,86px);
  right:var(--panel-gap);
  width:var(--panel-w);
  height:calc(100vh - clamp(96px,11.7vh,112px));
  height:calc(100dvh - clamp(96px,11.7vh,112px));
  min-height:0;
  padding:clamp(22px,1.75vw,28px);
  background:var(--panel);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  border:1px solid rgba(255,255,255,.8);
  border-radius:23px;
  box-shadow:0 18px 60px rgba(95,105,115,.10);
  overflow-y:auto;
  overflow-x:hidden;
  scrollbar-width:none;
  overscroll-behavior:contain;
}
.control-panel::-webkit-scrollbar{display:none}
.panel-head h2{font-size:20px;line-height:1.2;margin:0;font-weight:700;color:#20252a;letter-spacing:-.4px}
.panel-head p{font-size:14px;color:#a3a8af;margin:5px 0 26px}
.option-group{margin-bottom:28px;min-width:0}
.option-group h3{font-size:14px;font-weight:700;margin:0 0 13px;color:#20252a}

/* Fixed-size grid keeps every color inside the card at desktop/laptop widths. */
.swatches{
  display:grid;
  grid-template-columns:repeat(8,var(--swatch-size));
  gap:var(--swatch-gap);
  align-items:center;
  max-width:100%;
  overflow:visible;
}
.swatch{
  width:var(--swatch-size);
  height:var(--swatch-size);
  border-radius:50%;
  border:0;
  background:var(--swatch);
  box-shadow:0 4px 10px rgba(0,0,0,.08);
  position:relative;
  padding:0;
  transition:.18s ease;
  cursor:pointer;
}
.swatch:after{content:"";position:absolute;inset:-4px;border:1.7px solid transparent;border-radius:50%;transition:.18s ease}
.swatch.active:after{border-color:#1d252b}
.swatch:hover{transform:translateY(-1px)}
.swatch.rainbow{background:conic-gradient(#ff4056,#ffcc2f,#3fd84a,#2f9bff,#7730df,#ff4056)}
.panel-divider{height:1px;background:#e4e7ea;margin:1px 0 28px}
.camera-group{margin-bottom:25px}
.camera-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;width:100%;min-width:0}
.camera-btn{
  min-width:0;
  height:clamp(70px,8.6vh,82px);
  padding:6px 2px;
  border:1px solid #e1e4e8;
  border-radius:12px;
  background:rgba(255,255,255,.45);
  color:#363c42;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:11px;
  line-height:1.1;
  transition:.18s ease;
}
.camera-btn i{font-size:23px;line-height:1}
.camera-btn.active{border-color:#9cc1ff;background:#eef6ff;box-shadow:0 5px 13px rgba(63,122,208,.10)}
.camera-btn:hover{background:#f6f8fa}
.flip-x{display:inline-block;transform:scaleX(-1)}
.action-btn{width:100%;height:56px;border-radius:12px;border:0;margin-bottom:12px;font-size:14px;font-weight:500;display:flex;align-items:center;justify-content:center;gap:12px}
.action-btn i{font-size:21px}
.action-secondary{background:#edf0f3;color:#2b3035}
.action-primary{background:#23282d;color:#fff}
.panel-foot{text-align:center;color:#b0b5bc;font-size:13px;letter-spacing:.15px;margin-top:13px;padding-bottom:2px}

/* Small laptop / compact desktop */
@media (max-width:1199.98px){
  :root{
    --panel-w:350px;
    --panel-gap:14px;
    --swatch-size:30px;
    --swatch-gap:9px;
  }
  .topbar{padding:0 28px}
  .brand{gap:13px}
  .brand-divider{margin-left:18px}
  .tagline{margin-left:22px;letter-spacing:3px}
  .hero-copy{left:30px;width:280px}
  .hero-copy h1{font-size:38px}
  .control-panel{padding:22px}
  .panel-head p{margin-bottom:22px}
  .option-group{margin-bottom:24px}
  .panel-divider{margin-bottom:24px}
}

/* Tablet portrait: model stays visible above, controls scroll independently below. */
@media (max-width:991.98px){
  :root{
    --swatch-size:32px;
    --swatch-gap:11px;
  }
  body{overflow:hidden}
  .configurator-page,.hero-stage{height:100vh;height:100dvh;min-height:0}

  .mountain-bg{
    inset:0 0 auto 0;
    height:58vh;
    height:58dvh;
    background-position:center 42%;
  }
  .mountain-bg:after{background:linear-gradient(90deg,rgba(255,255,255,.70),rgba(255,255,255,.33) 58%,rgba(255,255,255,.46))}

  .topbar{
    height:68px;
    padding:0 22px;
    background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(255,255,255,.58) 72%,transparent);
  }
  .brand-name{font-size:16px;letter-spacing:4px}
  .nav-links{gap:15px}

  .hero-copy{left:26px;top:88px;width:245px}
  .eyebrow{font-size:10px;letter-spacing:4px;margin-bottom:11px}
  .hero-copy h1{font-size:33px}
  .hero-copy p{font-size:14px;margin-top:10px}
  .red-line{margin-top:24px;width:50px}

  .iframe-shell{
    position:absolute;
    inset:0 0 auto 0;
    width:100%;
    height:58vh;
    height:58dvh;
  }

  .bottom-copy{display:none}

  .control-panel{
    position:absolute;
    top:auto;
    left:12px;
    right:12px;
    bottom:10px;
    width:auto;
    height:40vh;
    height:40dvh;
    padding:22px 24px 26px;
    border-radius:22px;
    background:rgba(255,255,255,.93);
    overflow-y:auto;
    overflow-x:hidden;
  }
  .swatches{grid-template-columns:repeat(8,var(--swatch-size));gap:var(--swatch-gap)}
  .camera-btn{height:72px}
}

/* Phones: exact 50/50 split. Top 50% is fixed 3D; bottom 50% is the only scroll area. */
@media (max-width:767.98px){
  :root{
    --swatch-size:28px;
    --swatch-gap:7px;
  }
  html,body,.configurator-page,.hero-stage{
    height:100vh;
    height:100dvh;
    min-height:0;
    overflow:hidden;
  }

  .mountain-bg{
    position:fixed;
    top:0;
    left:0;
    right:0;
    bottom:auto;
    height:50vh;
    height:50dvh;
    background-position:center 48%;
    z-index:0;
  }
  .mountain-bg:after{background:linear-gradient(90deg,rgba(255,255,255,.63),rgba(255,255,255,.24) 55%,rgba(255,255,255,.48))}

  .topbar{
    position:fixed;
    top:0;
    left:0;
    right:0;
    height:58px;
    padding:0 14px;
    z-index:40;
    background:linear-gradient(180deg,rgba(255,255,255,.93),rgba(255,255,255,.48) 72%,transparent);
  }
  .brand{gap:10px}
  .brand-mark{width:30px;height:22px}
  .brand-mark span{width:20px;height:3px}
  .brand-mark span:last-child{left:13px}
  .brand-name{font-size:13px;letter-spacing:3px}
  .brand-divider,.tagline{display:none!important}
  .nav-links{gap:12px}
  .icon-btn{font-size:21px}
  .avatar-btn{width:31px;height:31px;font-size:19px}

  /* Marketing copy is hidden on phones so it never covers the 3D product. */
  .hero-copy,.bottom-copy{display:none}

  .iframe-shell{
    position:fixed;
    top:0;
    left:0;
    right:0;
    bottom:auto;
    width:100%;
    height:50vh;
    height:50dvh;
    z-index:3;
  }
  #app{width:100%;height:100%}

  .control-panel{
    position:fixed;
    top:auto;
    left:0;
    right:0;
    bottom:0;
    width:100%;
    height:50vh;
    height:50dvh;
    min-height:0;
    max-height:none;
    margin:0;
    padding:18px 16px max(20px,env(safe-area-inset-bottom));
    border-radius:20px 20px 0 0;
    border-left:0;
    border-right:0;
    border-bottom:0;
    background:rgba(255,255,255,.97);
    box-shadow:0 -10px 34px rgba(67,76,85,.12);
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    z-index:50;
  }
  .panel-head h2{font-size:18px}
  .panel-head p{font-size:12px;margin:4px 0 19px}
  .option-group{margin-bottom:21px}
  .option-group h3{font-size:13px;margin-bottom:12px}
  .swatches{
    grid-template-columns:repeat(8,var(--swatch-size));
    gap:var(--swatch-gap);
    width:max-content;
    max-width:100%;
  }
  .swatch:after{inset:-3px}
  .panel-divider{margin:0 0 20px}
  .camera-group{margin-bottom:20px}
  .camera-grid{gap:6px}
  .camera-btn{height:66px;border-radius:10px;font-size:10px;gap:6px;padding:5px 1px}
  .camera-btn i{font-size:19px}
  .action-btn{height:50px;margin-bottom:10px;font-size:13px;border-radius:10px}
  .action-btn i{font-size:18px}
  .panel-foot{font-size:12px;margin-top:10px}
}

/* Very narrow phones */
@media (max-width:359.98px){
  :root{
    --swatch-size:26px;
    --swatch-gap:6px;
  }
  .control-panel{padding-left:13px;padding-right:13px}
  .brand-name{font-size:12px;letter-spacing:2.4px}
  .camera-btn{font-size:9px}
}

/* Short laptop screens */
@media (min-width:992px) and (max-height:760px){
  .control-panel{top:72px;height:calc(100dvh - 86px);padding:19px 22px}
  .panel-head p{margin-bottom:18px}
  .option-group{margin-bottom:20px}
  .panel-divider{margin-bottom:19px}
  .camera-btn{height:64px}
  .action-btn{height:48px}
  .panel-foot{margin-top:7px}
  .hero-copy{top:92px}
  .hero-copy h1{font-size:36px}
  .hero-copy p{font-size:14px}
  .red-line{margin-top:24px}
}


/* Share Design — URL-only dialog injected by save-design.js */
.sd-overlay[hidden]{display:none!important}
.sd-overlay{
  position:fixed;
  inset:0;
  z-index:1000;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(21,27,33,.47);
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
}
.sd-dialog{
  width:min(100%,560px);
  max-height:calc(100dvh - 36px);
  overflow-y:auto;
  background:#fff;
  border:1px solid rgba(255,255,255,.7);
  border-radius:22px;
  box-shadow:0 25px 85px rgba(15,25,35,.24);
  padding:28px;
  color:#20252a;
}
.sd-head{position:relative;padding-right:32px}
.sd-kicker{color:#e0463b;font-size:10px;font-weight:800;letter-spacing:2.1px;margin-bottom:9px}
.sd-head h2{font-size:25px;font-weight:800;letter-spacing:-.7px;line-height:1.25;margin:0}
.sd-head p{font-size:13px;color:#9098a2;margin:7px 0 22px}
.sd-close{position:absolute;right:0;top:0;width:32px;height:32px;border:1px solid #e5e7ea;border-radius:50%;background:#fff;color:#535d67;font-size:23px;line-height:1;cursor:pointer}
.sd-form{padding:18px;border:1px solid #e9ebee;border-radius:15px;background:#f8f9fa}
.sd-form label{display:block;font-size:10px;font-weight:800;letter-spacing:1.3px;margin-bottom:9px;color:#535c66}
.sd-input-row{display:flex;gap:8px;align-items:center}
.sd-input-row input{flex:1;min-width:0;height:43px;border:1px solid #dfe3e7;border-radius:9px;padding:0 12px;background:#fff;color:#252a30;font:500 12px 'Inter',sans-serif;outline:0}
.sd-input-row input:focus{border-color:#8bb5ff;box-shadow:0 0 0 3px rgba(111,164,255,.15)}
.sd-copy{flex:0 0 auto;height:43px;padding:0 17px;background:#23282d;border:0;border-radius:9px;color:#fff;font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap}
.sd-copy:hover{background:#3b434b}
.sd-note{text-align:center;color:#9098a2;font-size:11px;line-height:1.6;margin:17px 4px 0}
.sd-toast{position:fixed;z-index:1100;left:50%;bottom:24px;transform:translate(-50%,15px);max-width:min(90vw,460px);padding:12px 18px;border-radius:11px;background:#23282d;color:#fff;font-size:12px;font-weight:600;text-align:center;box-shadow:0 8px 30px rgba(0,0,0,.2);opacity:0;visibility:hidden;transition:opacity .2s,transform .2s,visibility .2s;pointer-events:none}
.sd-toast-visible{opacity:1;visibility:visible;transform:translate(-50%,0)}
.sd-toast-error{background:#aa4039}
@media(max-width:480px){
  .sd-overlay{padding:12px}
  .sd-dialog{padding:20px;max-height:calc(100dvh - 24px);border-radius:18px}
  .sd-head h2{font-size:22px}
  .sd-input-row{flex-direction:column;align-items:stretch}
  .sd-copy{width:100%}
  .sd-toast{bottom:15px}
}
