:root{--bg:#f4f4f2;--card:#fff;--text:#171717;--muted:#737373;--line:#e4e4e1;--pink:#ef2b73;--pink2:#ff4f8d;--black:#151515;--shadow:0 18px 55px rgba(18,18,18,.08)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Manrope,Arial,sans-serif;color:var(--text);background:var(--bg)}button,input{font:inherit}.topbar{height:92px;background:transparent;border:0;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 42px;gap:20px;position:fixed;top:0;left:0;right:0;z-index:50;pointer-events:none}.topbar-nav{display:contents}.back-link{width:42px;height:42px;border:1px solid var(--line);border-radius:12px;display:grid;place-items:center;text-decoration:none;color:#222;background:#fff;font-size:24px;line-height:1;font-weight:600;transition:background .16s ease,border-color .16s ease,transform .16s ease}.back-link:hover{background:#f8f8f7;border-color:#cfcfcb;transform:translateX(-1px)}.back-link:focus-visible,.brand:focus-visible{outline:3px solid rgba(238,52,112,.25);outline-offset:3px}.brand{display:flex;align-items:center;text-decoration:none;color:inherit;flex:0 0 auto}.brand-logo{display:block;width:190px;height:68px;object-fit:contain;object-position:left center}.topbar-title{margin:auto;font-size:14px;font-weight:700;color:#666}.ghost-btn,.icon-btn,.tool-btn{border:1px solid var(--line);background:#fff;color:#222;border-radius:12px;cursor:pointer}.ghost-btn{padding:11px 16px;font-size:13px;font-weight:700}.page-shell{max-width:1500px;margin:0 auto;padding:38px 32px 48px}.intro{display:flex;justify-content:space-between;gap:40px;align-items:flex-end;margin-bottom:25px}.eyebrow,.panel-kicker{font-size:11px;letter-spacing:.15em;font-weight:800;color:var(--pink)}.intro h1{font-size:32px;line-height:1.12;max-width:780px;margin:8px 0 9px;letter-spacing:-.035em}.intro p{margin:0;color:var(--muted);font-size:14px}.steps{display:flex;gap:9px;white-space:nowrap}.step{background:#fff;border:1px solid var(--line);border-radius:999px;padding:7px 11px 7px 7px;font-size:11px;color:#777;font-weight:700}.step i{font-style:normal;width:22px;height:22px;border-radius:50%;background:#eee;display:inline-grid;place-items:center;margin-right:4px}.step.active{border-color:#f6a6c2;color:#222}.step.active i{background:var(--pink);color:#fff}.constructor-grid{display:grid;grid-template-columns:minmax(480px,1.05fr) minmax(560px,.95fr);gap:22px}.panel{background:var(--card);border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow);overflow:hidden}.panel-head{padding:23px 24px 16px;display:flex;align-items:center;justify-content:space-between}.panel-head.compact{padding-bottom:12px}.panel-head h2{font-size:20px;margin:4px 0 0}.viewer-actions{display:flex;gap:8px}.icon-btn{width:38px;height:38px;font-size:18px}.viewer{height:650px;position:relative;background:radial-gradient(circle at 50% 42%,#fff 0,#f5f5f3 52%,#ecece8 100%);overflow:hidden}.viewer canvas{display:block;width:100%;height:100%}.viewer-hint{position:absolute;bottom:14px;left:50%;transform:translateX(-50%);background:rgba(255,255,255,.86);backdrop-filter:blur(10px);padding:8px 12px;border:1px solid rgba(0,0,0,.06);border-radius:999px;font-size:10px;color:#777;white-space:nowrap;pointer-events:none}.loader{position:absolute;inset:0;display:flex;flex-direction:column;gap:12px;align-items:center;justify-content:center;background:#f5f5f3;z-index:2;color:#555;font-size:12px}.loader span{width:30px;height:30px;border:3px solid #ddd;border-top-color:var(--pink);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.viewer-footer{padding:13px 20px;display:flex;justify-content:space-between;border-top:1px solid var(--line);font-size:10px;color:#777}.status-dot{display:inline-block;width:7px;height:7px;background:#20b15a;border-radius:50%;margin-right:5px}.size-badge{font-size:11px;font-weight:800;background:#f6f6f4;padding:8px 10px;border-radius:10px}.editor-panel{padding-bottom:18px}.upload-zone{margin:0 20px 14px;border:1.5px dashed #d9d9d5;border-radius:16px;min-height:77px;display:flex;align-items:center;gap:12px;padding:13px;cursor:pointer;background:#fcfcfb;transition:.2s}.upload-zone.drag{border-color:var(--pink);background:#fff4f8}.upload-icon{font-size:26px;width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:#f1f1ee;color:#777}.upload-zone>span:nth-child(3){display:flex;flex-direction:column;flex:1}.upload-zone b{font-size:12px}.upload-zone small{font-size:9px;color:#999;margin-top:4px}.pink-btn,.dark-btn{border:0;border-radius:12px;padding:12px 16px;color:#fff;font-weight:800;font-size:12px;cursor:pointer}.pink-btn{background:linear-gradient(135deg,var(--pink),var(--pink2))}.pink-btn.small{padding:10px 13px;font-size:10px}.dark-btn{background:var(--black)}.canvas-toolbar{padding:0 20px 8px;display:flex;justify-content:space-between;align-items:center;font-size:10px;color:#777}.canvas-toolbar>span{font-weight:800;color:#555}.canvas-toolbar>div{display:flex;gap:5px}.tool-btn{font-size:9px;padding:7px 9px;border-radius:8px}.print-stage-wrap{position:relative;margin:0 20px 16px;padding:22px 0 0 34px}.print-stage-wrap canvas{width:100%;aspect-ratio:210/85;background:#f7f7f4;border:1px solid #d9d9d5;display:block;touch-action:none;cursor:grab}.print-stage-wrap canvas:active{cursor:grabbing}.ruler{position:absolute;color:#aaa;font-size:8px;display:flex}.ruler-top{left:34px;right:0;top:6px;justify-content:space-between}.ruler-left{left:0;top:22px;bottom:0;flex-direction:column;justify-content:space-between}.safe-note{position:absolute;bottom:7px;right:9px;background:rgba(255,255,255,.86);font-size:8px;color:#999;padding:4px 6px;border-radius:6px;pointer-events:none}.controls{padding:3px 20px 8px}.control-row{margin-bottom:9px}.control-row label{display:flex;justify-content:space-between;font-size:9px;font-weight:700;color:#666;margin-bottom:5px}.control-row output{color:var(--pink)}input[type=range]{width:100%;accent-color:var(--pink);height:4px}.nudge-grid{display:flex;align-items:center;gap:5px;margin-top:2px}.nudge-grid button{width:31px;height:29px;border-radius:8px;border:1px solid var(--line);background:#fff;cursor:pointer}.nudge-grid span{font-size:9px;color:#999;margin-left:4px}.download-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:7px 20px 0}.tips{margin-top:18px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px 18px;font-size:11px;display:flex;gap:13px;color:#777}.tips b{color:#222}footer{text-align:center;padding:22px;color:#999;font-size:10px}
@media(max-width:1050px){.constructor-grid{grid-template-columns:1fr}.viewer{height:540px}.intro{align-items:flex-start;flex-direction:column}.steps{align-self:stretch;overflow:auto}.topbar-title{display:none}}
@media(max-width:650px){.topbar{height:68px;padding:0 14px;gap:12px}.topbar-nav{gap:8px}.back-link{width:38px;height:38px;border-radius:10px;font-size:22px}.brand-logo{width:132px;height:54px}.ghost-btn{padding:9px 10px;font-size:10px}.page-shell{padding:24px 12px}.intro h1{font-size:25px}.constructor-grid{display:block}.viewer-panel{margin-bottom:14px}.viewer{height:420px}.panel{border-radius:18px}.print-stage-wrap{margin:0 12px 14px}.upload-zone,.canvas-toolbar,.controls{margin-left:12px;margin-right:12px}.download-row{padding-left:12px;padding-right:12px;grid-template-columns:1fr}.viewer-footer{font-size:9px}.tips{flex-direction:column}}

.mug-color-control{padding:0 24px 16px;display:flex;align-items:center;justify-content:space-between;gap:16px}.mug-color-label{display:flex;flex-direction:column;gap:3px;font-size:11px;font-weight:800}.mug-color-label output{font-size:9px;color:#999;font-weight:600}.mug-color-swatches{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.color-swatch{width:32px;height:32px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #d8d8d5;cursor:pointer;display:grid;place-items:center;transition:transform .16s ease,box-shadow .16s ease;background:var(--swatch)}.color-swatch:hover{transform:scale(1.08)}.color-swatch.active{box-shadow:0 0 0 2px var(--pink);transform:scale(1.08)}.color-swatch[data-mug-color="#ffffff"]{background:#fff}.viewer-panel .viewer{border-top:1px solid var(--line)}
@media(max-width:650px){.mug-color-control{padding:0 16px 14px;align-items:flex-start;flex-direction:column}.mug-color-swatches{justify-content:flex-start}.color-swatch{width:36px;height:36px}}

.topbar .back-link{grid-column:1;grid-row:1;justify-self:start}
.topbar .brand{grid-column:2;grid-row:1;justify-self:center}
.topbar .topbar-title{display:none}
.topbar .ghost-btn{grid-column:3;grid-row:1;justify-self:end}
.back-link{font-family:Arial,sans-serif;font-size:26px;font-weight:400}
@media(max-width:650px){
  .topbar{grid-template-columns:1fr auto 1fr;height:68px;padding:0 12px;gap:8px}
  .topbar .back-link{justify-self:start}
  .topbar .brand{justify-self:center}
  .topbar .ghost-btn{justify-self:end;margin:0}
  .back-link{font-size:24px}
}

.back-link{
  width:46px;
  height:46px;
  border:0;
  border-radius:50%;
  background:#fff;
  box-shadow:0 8px 22px rgba(0,0,0,.10);
  display:grid;
  place-items:center;
  color:#202020;
  transition:transform .16s ease,box-shadow .16s ease,background .16s ease;
}
.back-link:hover{
  background:#fff;
  transform:translateX(-1px);
  box-shadow:0 10px 26px rgba(0,0,0,.13);
}
.back-chevron{
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:2.2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
@media(max-width:650px){
  .back-link{width:44px;height:44px}
  .back-chevron{width:21px;height:21px}
}

.topbar .back-link,
.topbar .brand,
.topbar .ghost-btn{pointer-events:auto}

.topbar .brand-logo{
  width:220px;
  height:78px;
}

.page-shell{
  padding-top:118px;
}

@media(max-width:650px){
  .topbar{
    height:78px;
    padding:0 12px;
    gap:8px;
    background:transparent;
    border:0;
  }
  .topbar .brand-logo{
    width:154px;
    height:62px;
  }
  .topbar .back-link{
    width:44px;
    height:44px;
  }
  .topbar .ghost-btn{
    justify-self:end;
    margin:0;
    padding:9px 10px;
    font-size:10px;
    white-space:nowrap;
  }
  .page-shell{
    padding-top:98px;
  }
}

/* --- Fixed background logo + foreground controls --- */
.topbar{
  grid-template-columns:1fr 1fr;
  z-index:60;
  pointer-events:none;
}
.topbar .back-link{
  grid-column:1;
  justify-self:start;
  pointer-events:auto;
}
.topbar .ghost-btn{
  grid-column:2;
  justify-self:end;
  pointer-events:auto;
}
.topbar .brand{display:none!important}

.floating-brand{
  position:fixed;
  top:4px;
  left:50%;
  transform:translateX(-50%);
  z-index:1;
  display:block;
  width:290px;
  height:100px;
  pointer-events:auto;
  text-decoration:none;
}
.floating-brand-logo{
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center top;
  display:block;
}

.page-shell{
  position:relative;
  z-index:10;
}

.intro-copy{
  position:relative;
  z-index:2;
  padding:16px 20px 17px;
  margin:-16px 0 -17px -20px;
  border-radius:20px;
  background:rgba(255,255,255,.56);
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
}

@supports not ((backdrop-filter:blur(8px)) or (-webkit-backdrop-filter:blur(8px))){
  .intro-copy{background:rgba(255,255,255,.82)}
}

@media(max-width:650px){
  .topbar{
    grid-template-columns:1fr 1fr;
  }
  .floating-brand{
    top:1px;
    width:205px;
    height:76px;
  }
  .page-shell{
    padding-top:102px;
  }
  .intro-copy{
    padding:14px 14px 15px;
    margin:-14px 0 -15px -14px;
    border-radius:17px;
    background:rgba(255,255,255,.60);
  }
}

/* --- Intro alignment and slightly smaller typography --- */
.intro-copy{
  margin:-12px 0 -13px 0;
  padding:12px 16px 13px;
}
.intro h1{
  font-size:29px;
  line-height:1.14;
  max-width:740px;
}
.intro p{
  font-size:13px;
  line-height:1.5;
}
.intro .eyebrow{
  font-size:10px;
}

@media(max-width:650px){
  .intro-copy{
    margin:-10px 0 -11px 0;
    padding:10px 12px 11px;
  }
  .intro h1{
    font-size:23px;
    line-height:1.16;
  }
  .intro p{
    font-size:12px;
  }
  .intro .eyebrow{
    font-size:9px;
  }
}

/* --- Intro block matches the 3D viewer column width --- */
@media(min-width:1051px){
  .intro{
    display:grid;
    grid-template-columns:minmax(480px,1.05fr) minmax(560px,.95fr);
    gap:22px;
    align-items:end;
  }

  .intro-copy{
    grid-column:1;
    width:100%;
    box-sizing:border-box;
    margin:-10px 0 -11px 0;
    padding:10px 16px 11px;
  }

  .intro .steps{
    grid-column:2;
    justify-self:end;
  }

  .intro .eyebrow,
  .intro h1,
  .intro p{
    white-space:nowrap;
  }

  .intro h1{
    font-size:24px;
    line-height:1.12;
    max-width:none;
    letter-spacing:-.03em;
  }

  .intro p{
    font-size:11.5px;
    line-height:1.35;
  }

  .intro .eyebrow{
    font-size:9px;
  }
}

@media(min-width:1051px) and (max-width:1220px){
  .intro h1{font-size:21px}
  .intro p{font-size:10px}
  .intro .eyebrow{font-size:8px}
}

/* On narrow screens keep normal wrapping so the page stays usable. */
@media(max-width:1050px){
  .intro-copy{
    width:100%;
    box-sizing:border-box;
  }
  .intro .eyebrow,
  .intro h1,
  .intro p{
    white-space:normal;
  }
}

/* --- Corrected header logo click + intro geometry --- */
.floating-brand{
  pointer-events:none;
}
.floating-brand-hitbox{
  position:fixed;
  top:4px;
  left:50%;
  transform:translateX(-50%);
  width:290px;
  height:100px;
  z-index:75;
  display:block;
  background:transparent;
  border:0;
}
.floating-brand-hitbox:focus-visible{
  outline:3px solid rgba(238,52,112,.25);
  outline-offset:2px;
  border-radius:14px;
}

/* On desktop the text card occupies exactly the first constructor column:
   same left edge and same right edge as the 3D mug panel below. */
@media(min-width:1051px){
  .intro{
    display:grid;
    grid-template-columns:minmax(480px,1.05fr) minmax(560px,.95fr);
    gap:22px;
    align-items:end;
  }
  .intro-copy{
    grid-column:1;
    width:100%;
    max-width:none;
    box-sizing:border-box;
    margin:0;
    padding:10px 16px 11px;
    border-radius:18px;
  }
  .intro .steps{
    grid-column:2;
    justify-self:end;
  }
  .intro h1{
    margin:6px 0 7px;
    font-size:22px;
    line-height:1.12;
    letter-spacing:-.03em;
    white-space:nowrap;
    max-width:none;
  }
  .intro p{
    margin:0;
    font-size:10.5px;
    line-height:1.35;
    white-space:nowrap;
  }
  .intro .eyebrow{
    font-size:8.5px;
    white-space:nowrap;
  }
}

@media(min-width:1051px) and (max-width:1220px){
  .intro h1{font-size:19px}
  .intro p{font-size:9.2px}
  .intro .eyebrow{font-size:7.8px}
}

@media(max-width:650px){
  .floating-brand-hitbox{
    top:1px;
    width:205px;
    height:76px;
  }
}
