  :root{
    --bg:#14120F;
    --bg-alt:#1A1712;
    --surface:#201C17;
    --surface-2:#2A241D;
    --line:#3A342B;
    --line-soft:#2A251E;
    --porcelain:#F3ECDF;
    --amber:#E8A455;
    --amber-soft:#8C5E2C;
    --text:#EDE6D8;
    --text-muted:#9C9284;
    --danger:#D96C56;
    --radius:3px;
  }
  *{box-sizing:border-box;}
  html,body{height:100%;}
  body{
    margin:0;
    background:var(--bg);
    color:var(--text);
    font-family:'Inter',system-ui,sans-serif;
    -webkit-font-smoothing:antialiased;
  }
  @media (prefers-reduced-motion: reduce){
    *{animation-duration:0.001ms !important; transition-duration:0.001ms !important;}
  }

  .app{
    display:grid;
    grid-template-columns: 336px 1fr 300px;
    min-height:100vh;
  }
  @media (max-width: 1320px){
    .app{ grid-template-columns: 336px 1fr; }
    .ad-rail{ display:none; }
  }
  @media (max-width: 880px){
    .app{ grid-template-columns: 1fr; }
  }

  /* ---------- AD RAIL (espaço para anúncios) ---------- */
  .ad-rail{
    background:var(--bg-alt);
    border-left:1px solid var(--line);
    padding:28px 20px 40px;
  }
  .ad-rail-sticky{
    position:sticky;
    top:28px;
    min-height:1px;
  }

  /* ---------- RAIL (controls) ---------- */
  .rail{
    background:var(--bg-alt);
    border-right:1px solid var(--line);
    padding:28px 24px 40px;
    display:flex;
    flex-direction:column;
    gap:26px;
  }
  .brand{
    display:flex;
    flex-direction:column;
    gap:4px;
    margin-bottom:4px;
  }
  .brand .mark{
    font-family:'Fraunces',serif;
    font-style:italic;
    font-weight:500;
    font-size:22px;
    color:var(--porcelain);
    letter-spacing:0.2px;
  }
  .brand .mark b{ color:var(--amber); font-style:normal; font-weight:600;}
  .brand .sub{
    font-size:11.5px;
    color:var(--text-muted);
    letter-spacing:0.3px;
    line-height:1.5;
  }

  .dropzone{
    border:1px dashed var(--line);
    border-radius:var(--radius);
    padding:18px 14px;
    text-align:center;
    cursor:pointer;
    transition:border-color .15s ease, background .15s ease;
    background:var(--surface);
  }
  .dropzone:hover, .dropzone.drag{
    border-color:var(--amber);
    background:var(--surface-2);
  }
  .dropzone input{ display:none; }
  .dropzone .dz-title{
    font-size:13px; font-weight:600; color:var(--text);
  }
  .dropzone .dz-sub{
    font-size:11px; color:var(--text-muted); margin-top:4px;
  }
  .dropzone .dz-file{
    font-size:11px; color:var(--amber); margin-top:8px; word-break:break-all;
    font-family:'IBM Plex Mono',monospace;
  }

  .group{ display:flex; flex-direction:column; gap:14px; }
  .group-label{
    font-size:10.5px;
    letter-spacing:1.4px;
    text-transform:uppercase;
    color:var(--text-muted);
    border-bottom:1px solid var(--line-soft);
    padding-bottom:8px;
  }

  .shape-select{ display:flex; flex-wrap:wrap; gap:6px; }
  .shape-btn{
    flex:1 1 calc(50% - 3px); min-width:70px; display:flex; flex-direction:column; align-items:center; gap:6px;
    padding:10px 4px 9px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:var(--surface);
    color:var(--text-muted);
    font-family:'Inter',sans-serif;
    font-size:10.5px;
    letter-spacing:.2px;
    cursor:pointer;
    transition:border-color .15s ease, color .15s ease, background .15s ease;
  }
  .shape-btn svg{ opacity:.65; transition:opacity .15s ease; }
  .shape-btn:hover{ border-color:var(--amber-soft); color:var(--text); }
  .shape-btn.active{ border-color:var(--amber); color:var(--amber); background:var(--surface-2); }
  .shape-btn.active svg{ opacity:1; }
  .shape-btn:focus-visible{ outline:2px solid var(--amber); outline-offset:2px; }
  #bendGroup.disabled{ opacity:.45; pointer-events:none; }

  .field{ display:flex; flex-direction:column; gap:6px; }
  .field-head{
    display:flex; justify-content:space-between; align-items:baseline;
  }
  .field-head label{ font-size:12.5px; color:var(--text); font-weight:500; }
  .field-head .val{
    font-family:'IBM Plex Mono',monospace;
    font-size:12px;
    color:var(--amber);
  }

  input[type=range]{
    -webkit-appearance:none;
    width:100%;
    height:2px;
    background:var(--line);
    border-radius:2px;
    outline:none;
  }
  input[type=range]::-webkit-slider-thumb{
    -webkit-appearance:none;
    width:13px; height:13px;
    border-radius:50%;
    background:var(--amber);
    border:2px solid var(--bg-alt);
    box-shadow:0 0 0 1px var(--amber);
    cursor:pointer;
    margin-top:-6px;
  }
  input[type=range]::-moz-range-thumb{
    width:11px; height:11px; border-radius:50%;
    background:var(--amber); border:2px solid var(--bg-alt);
    box-shadow:0 0 0 1px var(--amber); cursor:pointer;
  }
  input[type=range]::-webkit-slider-runnable-track{
    height:2px; background:var(--line); border-radius:2px;
  }

  .toggle-row{
    display:flex; align-items:center; justify-content:space-between;
    font-size:12.5px;
  }
  .switch{
    display:block; position:relative; width:36px; height:20px; flex:none; cursor:pointer;
  }
  .switch input{ opacity:0; width:0; height:0; }
  .switch .track{
    position:absolute; inset:0; background:var(--line); border-radius:20px;
    transition:background .15s ease; cursor:pointer;
  }
  .switch .track::after{
    content:''; position:absolute; width:14px; height:14px; border-radius:50%;
    background:var(--porcelain); top:3px; left:3px; transition:transform .15s ease;
  }
  .switch input:checked + .track{ background:var(--amber-soft); }
  .switch input:checked + .track::after{ transform:translateX(16px); background:var(--amber); }
  .switch input:focus-visible + .track{ outline:2px solid var(--amber); outline-offset:2px; }

  .spec{
    background:var(--surface);
    border:1px solid var(--line-soft);
    border-radius:var(--radius);
    padding:12px 14px;
    font-family:'IBM Plex Mono',monospace;
    font-size:11.5px;
    color:var(--text-muted);
    line-height:1.9;
  }
  .spec b{ color:var(--porcelain); font-weight:500; }
  .spec .row{ display:flex; justify-content:space-between; gap:10px; }

  button.primary{
    appearance:none; border:none; cursor:pointer;
    background:var(--amber); color:#1A1204;
    font-family:'Inter',sans-serif; font-weight:600; font-size:13px;
    padding:12px 16px; border-radius:var(--radius);
    transition:filter .15s ease, transform .1s ease;
  }
  button.primary:hover:not(:disabled){ filter:brightness(1.08); }
  button.primary:active:not(:disabled){ transform:translateY(1px); }
  button.primary:disabled{
    background:var(--surface-2); color:var(--text-muted); cursor:not-allowed;
  }
  button.primary:focus-visible{ outline:2px solid var(--porcelain); outline-offset:2px; }

  button.ghost{
    appearance:none; cursor:pointer; width:100%;
    background:var(--surface); color:var(--text);
    border:1px solid var(--line); font-family:'Inter',sans-serif; font-weight:600; font-size:12.5px;
    padding:9px 12px; border-radius:var(--radius);
    transition:background .15s ease, border-color .15s ease;
  }
  button.ghost:hover{ background:var(--surface-2); border-color:var(--amber-soft); }
  button.ghost:active{ transform:translateY(1px); }
  button.ghost:focus-visible{ outline:2px solid var(--amber); outline-offset:2px; }

  .adjust-actions{ display:flex; gap:8px; margin-top:2px; }
  .adjust-actions button.ghost{ flex:1; }

  .foot-note{ font-size:10.5px; color:var(--text-muted); line-height:1.6; }
  .foot-note a{ color:var(--amber); }

  /* ---------- STAGE ---------- */
  .stage{
    padding:32px 40px 48px;
    display:flex;
    flex-direction:column;
    gap:22px;
    min-width:0;
  }
  @media (max-width:640px){ .stage{ padding:22px 18px 40px; } }

  .stage-head h1{
    font-family:'Fraunces',serif;
    font-weight:500;
    font-size:20px;
    margin:0 0 4px;
    color:var(--porcelain);
  }
  .stage-head p{
    margin:0; font-size:12.5px; color:var(--text-muted); max-width:56ch;
  }

  .row-cards{
    display:grid;
    grid-template-columns: 260px 1fr;
    gap:22px;
    align-items:stretch;
    flex:1;
    min-height:0;
  }
  @media (max-width:880px){
    .row-cards{ grid-template-columns:1fr; }
  }

  .card{
    background:var(--surface);
    border:1px solid var(--line-soft);
    border-radius:var(--radius);
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }
  .card-label{
    display:flex; justify-content:space-between; align-items:center;
    padding:11px 14px;
    border-bottom:1px solid var(--line-soft);
    font-size:10.5px; letter-spacing:1.2px; text-transform:uppercase;
    color:var(--text-muted);
  }
  .card-label .tag{
    font-family:'IBM Plex Mono',monospace; letter-spacing:0; text-transform:none;
    color:var(--amber); font-size:11px;
  }

  .proof-card{ min-height:220px; }
  .proof-body{
    flex:1; display:flex; align-items:center; justify-content:center;
    padding:14px; background:
      repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 8px);
  }
  .proof-body canvas{
    max-width:100%; max-height:280px;
    image-rendering:auto;
    box-shadow:0 0 0 1px var(--line);
  }
  .empty-hint{
    text-align:center; color:var(--text-muted); font-size:12px; padding:20px;
  }
  .proof-controls{
    flex:none;
    padding:16px 14px 18px;
    border-top:1px solid var(--line-soft);
    background:var(--surface);
  }
  .proof-controls .group{ gap:14px; }

  .viewer-card{ position:relative; min-height:420px; }
  .viewer-body{
    position:relative; flex:1; min-height:380px;
    background:
      radial-gradient(60% 55% at 50% 42%, rgba(232,164,85,0.16), rgba(232,164,85,0) 70%),
      var(--surface);
  }
  .viewer-body canvas{ display:block; width:100%; height:100%; }
  .viewer-toolbar{
    position:absolute; top:10px; right:10px;
    display:flex; gap:6px;
  }
  .chip{
    font-family:'IBM Plex Mono',monospace;
    font-size:10.5px;
    padding:6px 10px;
    border-radius:20px;
    border:1px solid var(--line);
    background:rgba(20,18,15,0.65);
    color:var(--text-muted);
    cursor:pointer;
    backdrop-filter:blur(4px);
    user-select:none;
    transition:border-color .15s ease, color .15s ease;
  }
  .chip.on{ color:var(--amber); border-color:var(--amber-soft); }
  .viewer-hint{
    position:absolute; bottom:10px; left:12px;
    font-size:10.5px; color:var(--text-muted);
    font-family:'IBM Plex Mono',monospace;
  }
  .empty-3d{
    position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
    flex-direction:column; gap:10px; text-align:center; padding:20px;
  }
  .empty-3d svg{ opacity:0.5; }
  .empty-3d p{ color:var(--text-muted); font-size:12.5px; max-width:32ch; margin:0; }

  .sr-only{
    position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0);
  }

  /* ---------- TOP NAV ---------- */
  .topnav{
    background:var(--bg-alt);
    border-bottom:1px solid var(--line);
    padding:0 24px;
  }
  .topnav-inner{
    max-width:1400px;
    margin:0 auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    height:54px;
    gap:16px;
  }
  .topnav-brand{
    font-family:'Fraunces',serif;
    font-style:italic;
    font-weight:500;
    font-size:17px;
    color:var(--porcelain);
    white-space:nowrap;
  }
  .topnav-brand b{ color:var(--amber); font-style:normal; font-weight:600; }
  .topnav-links{ display:flex; gap:4px; }
  .nav-link{
    appearance:none; border:none; background:transparent; cursor:pointer;
    color:var(--text-muted);
    font-family:'Inter',sans-serif; font-size:12.5px; font-weight:500;
    padding:8px 14px; border-radius:var(--radius);
    transition:color .15s ease, background .15s ease;
  }
  .nav-link:hover{ color:var(--text); background:var(--surface); }
  .nav-link.active{ color:var(--amber); background:var(--surface); }
  .nav-link:focus-visible{ outline:2px solid var(--amber); outline-offset:2px; }

  /* ---------- PAGE VIEWS (Blog / Ajuda) ---------- */
  .page-view{ display:none; }
  .page-view.active{ display:block; }

  .content-page{
    min-height:calc(100vh - 54px);
    padding:52px 24px 90px;
    display:flex;
    justify-content:center;
    background:var(--bg);
  }
  .content-inner{ max-width:720px; width:100%; }
  .content-inner .eyebrow{
    font-family:'IBM Plex Mono',monospace;
    font-size:10.5px; letter-spacing:1.4px; text-transform:uppercase;
    color:var(--amber); margin:0 0 10px;
  }
  .content-inner h1{
    font-family:'Fraunces',serif; 
    font-weight:500; 
    font-style:italic;
    font-size:30px;
    line-height: 1.3;
    color:var(--porcelain); 
    margin:0 0 20px;
  }
  .content-inner > p.lead{
    color:var(--text-muted); font-size:13.5px; line-height:1.7;
    max-width:60ch; margin:0 0 40px;
  }

  .blog-post{
    background:var(--surface);
    border:1px solid var(--line-soft);
    border-radius:var(--radius);
    padding:26px 28px;
    margin-bottom:20px;
  }
  .blog-post .meta{
    font-family:'IBM Plex Mono',monospace; font-size:10.5px;
    color:var(--amber); text-transform:uppercase; letter-spacing:1px;
    margin:0 0 10px;
  }
  .blog-post h2{
    font-family:'Fraunces',serif; font-weight:600; font-size:21px;
    color:var(--porcelain); margin:0 0 12px;
  }
  .blog-post p{
    font-size:15.5px; line-height:1.8; color:var(--text); margin:0 0 12px;
  }
  .blog-post p:last-child{ margin-bottom:0; }
  .blog-post-icon{
    width:46px; height:46px; margin:0 0 16px; color:var(--amber);
  }
  .blog-post-icon svg{ width:100%; height:100%; display:block; }
  .blog-post-img{
    width:100%; height:auto; display:block; border-radius:var(--radius);
    border:1px solid var(--line-soft); margin:0 0 14px;
  }

  a.blog-post{
    text-decoration:none;
    display:block;
    cursor:pointer;
    transition:border-color .15s ease, background .15s ease, transform .1s ease;
  }
  a.blog-post:hover{ border-color:var(--amber-soft); background:var(--surface-2); }
  a.blog-post:active{ transform:translateY(1px); }
  a.blog-post:focus-visible{ outline:2px solid var(--amber); outline-offset:2px; }
  a.blog-post p{ color:var(--text-muted); }
  .blog-post-more{
    display:inline-flex; align-items:center; gap:4px;
    margin-top:4px;
    font-family:'IBM Plex Mono',monospace; font-size:11px;
    color:var(--amber); letter-spacing:.3px;
  }

  .back-link{
    appearance:none; border:none; cursor:pointer;
    background:transparent; color:var(--text-muted);
    font-family:'Inter',sans-serif; font-size:12.5px; font-weight:500;
    padding:0; margin:0 0 18px;
    display:inline-flex; align-items:center; gap:6px;
    transition:color .15s ease;
  }
  .back-link:hover{ color:var(--amber); }
  .back-link:focus-visible{ outline:2px solid var(--amber); outline-offset:2px; }

  .blog-post-body p{
    font-size:17.5px; line-height:1.9; color:var(--text); margin:0 0 18px;
    max-width:64ch;
  }
  .blog-post-body p:last-child{ margin-bottom:0; }
  .blog-post-body-icon{
    width:68px; height:68px; margin:0 0 22px; color:var(--amber);
  }
  .blog-post-body-icon svg{ width:100%; height:100%; display:block; }
  .blog-post-body-img{
    width:100%; height:auto; display:block; border-radius:var(--radius);
    border:1px solid var(--line-soft); margin:0 0 26px;
  }
  .blog-post-body-caption{
    font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--text-muted);
    margin:-18px 0 26px; letter-spacing:.2px;
  }

  .help-section{ margin-bottom:30px; }
  .help-section h2{
    font-family:'Fraunces',serif; font-weight:600; font-size:15px;
    color:var(--porcelain); margin:0 0 4px;
    border-bottom:1px solid var(--line-soft); padding-bottom:10px;
  }
  .help-item{
    display:flex; gap:14px; padding:16px 0; border-bottom:1px solid var(--line-soft);
  }
  .help-item:last-child{ border-bottom:none; }
  .help-item-icon{
    flex:none; width:30px; height:30px; margin-top:1px; border-radius:var(--radius);
    background:var(--surface); border:1px solid var(--line-soft);
    display:flex; align-items:center; justify-content:center; color:var(--amber);
  }
  .help-item-body h3{
    font-size:13px; font-weight:600; color:var(--text); margin:0 0 4px;
  }
  .help-item-body p{
    font-size:12.5px; color:var(--text-muted); line-height:1.65; margin:0;
  }

  /* ---------- LEGAL PAGES (Privacidade / Termos) ---------- */
  .legal-updated{
    font-family:'IBM Plex Mono',monospace; font-size:10.5px;
    color:var(--text-muted); letter-spacing:.3px; margin:-26px 0 34px;
  }
  .legal-section{ margin-bottom:28px; }
  .legal-section h2{
    font-family:'Fraunces',serif; font-weight:600; font-size:15px;
    color:var(--porcelain); margin:0 0 10px;
    border-bottom:1px solid var(--line-soft); padding-bottom:10px;
  }
  .legal-section p{
    font-size:13px; line-height:1.75; color:var(--text); margin:0 0 12px;
  }
  .legal-section p:last-child{ margin-bottom:0; }
  .legal-section ul{
    margin:0 0 12px; padding-left:18px;
  }
  .legal-section li{
    font-size:13px; line-height:1.75; color:var(--text); margin-bottom:6px;
  }
  .legal-note{
    background:var(--surface); border:1px solid var(--line-soft);
    border-left:2px solid var(--amber); border-radius:var(--radius);
    padding:14px 18px; margin:0 0 34px;
  }
  .legal-note p{
    font-size:12.5px; color:var(--text-muted); line-height:1.7; margin:0;
  }

  /* ---------- SITE FOOTER ---------- */
  .site-footer{
    grid-column:1 / -1;
    border-top:1px solid var(--line);
    background:var(--bg-alt);
    padding:34px 40px 40px;
  }
  .footer-inner{
    max-width:1160px; margin:0 auto;
    display:flex; flex-wrap:wrap; gap:22px 40px;
    align-items:flex-start; justify-content:space-between;
  }
  .footer-brand{ max-width:340px; }
  .footer-mark{
    font-family:'Fraunces',serif; font-style:italic; font-weight:500;
    font-size:16px; color:var(--porcelain); margin-bottom:6px;
  }
  .footer-mark b{ color:var(--amber); font-style:normal; font-weight:600; }
  .footer-tagline{
    font-size:12px; line-height:1.65; color:var(--text-muted); margin:0;
  }
  .footer-links{
    display:flex; flex-wrap:wrap; gap:8px 22px;
  }
  .footer-link{
    background:none; border:none; padding:0; margin:0;
    font-family:'Inter',system-ui,sans-serif; font-size:12.5px;
    color:var(--text-muted); cursor:pointer; letter-spacing:.2px;
    transition:color .15s ease;
  }
  .footer-link:hover{ color:var(--porcelain); }
  .footer-link.active{ color:var(--amber); }
  .footer-copy{
    width:100%; font-size:11px; color:var(--text-muted);
    border-top:1px solid var(--line-soft); margin-top:18px; padding-top:16px;
    letter-spacing:.2px;
  }
  @media (max-width: 880px){
    .site-footer{ padding:28px 24px 34px; }
  }

  /* ---------- Real <a> links used instead of SPA buttons ---------- */
  .nav-link, .footer-link, .back-link{ text-decoration:none; display:inline-block; }
  a.footer-link{ display:inline; }
  .blog-post-more{ text-decoration:none; }