/* ===============================
   ArchitectLine — tool styles
=============================== */

:root{
  --gz-accent:#1f6fff;
  --gz-accent-soft:rgba(31,111,255,.12);
  --gz-border:rgba(0,0,0,.1);
  --gz-text:#111827;
}

/* ============================================================
   Dedicated hero (self-contained al-hero-* — on par with
   StreetArt / TraceLine, no gz-hero dependency)
   ============================================================ */
.al-hero-wrap{
  padding: 2rem 1.5rem 0.5rem;
}

.al-hero-card{
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  background: #0d1424;
}

/* readability scrim + subtle blueprint tint over the photo */
.al-hero-card::before{
  content: "";
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8,14,28,.82) 0%, rgba(8,14,28,.55) 42%, rgba(8,14,28,.10) 68%, rgba(8,14,28,0) 100%),
    linear-gradient(180deg, rgba(31,111,255,.10) 0%, rgba(31,111,255,0) 45%);
}

.al-hero-media{
  position: relative;
  display: block;
  width: 100%;
  height: clamp(380px, 46vh, 480px);
  overflow: hidden;
}
.al-hero-media picture{ display: contents; }
.al-hero-img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 60% 35%;
  display: block;
}

.al-hero-badge{
  position: absolute; z-index: 2;
  top: 22px; left: 24px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(13,20,36,.55);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #dbe4ff;
  font-size: .76rem; font-weight: 700; letter-spacing: .02em;
}
.al-hero-badge svg{ color: #7aa2ff; }

.al-hero-copy{
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  padding: 48px 55px; max-width: 640px;
}
.al-hero-title{
  margin: 0 0 14px; color: #fff; font-weight: 800;
  letter-spacing: -0.02em; font-size: clamp(2.0rem, 3.6vw, 2.8rem);
  line-height: 1.15;
  text-shadow: 0 2px 14px rgba(0,0,0,.35);
}
.al-hero-lead{
  margin: 0 0 24px; color: rgba(255,255,255,.92);
  line-height: 1.6; font-size: 0.98rem; max-width: 52ch;
  font-weight: 500;
  text-shadow: 0 1px 8px rgba(0,0,0,.35);
}
.al-hero-cta{
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; text-decoration: none;
  background: var(--gz-accent); color: #fff; font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 8px 22px rgba(31,111,255,.35);
  transition: transform .18s ease, opacity .18s ease;
}
.al-hero-cta:hover{ opacity: .94; transform: translateY(-1px); }
.al-hero-arrow{ transition: transform .18s ease; }
.al-hero-cta:hover .al-hero-arrow{ transform: translateX(4px); }

/* SP */
@media (max-width: 640px){
  .al-hero-wrap{ padding: 0 0 25px; }
  .al-hero-card{ border-radius: 22px; margin: 0 1.25rem; }
  .al-hero-card::before{
    background:
      linear-gradient(180deg, rgba(8,14,28,0) 0%, rgba(8,14,28,0) 36%, rgba(8,14,28,.55) 66%, rgba(8,14,28,.86) 100%);
  }
  .al-hero-media{ height: auto; aspect-ratio: 4/5; }
  .al-hero-img{ object-position: 58% 28%; }
  .al-hero-copy{ justify-content: flex-end; align-items: stretch; padding: 28px 26px 32px; max-width: none; }
  .al-hero-title{ text-align: center; font-size: 1.85rem; margin-bottom: 10px; }
  .al-hero-lead{ text-align: center; margin-bottom: 18px; }
  .al-hero-cta{ width: 100%; justify-content: center; }
  .al-hero-badge{ top: 16px; left: 16px; }
}

/* ===============================
   Upload area — standalone dropzone
   (no white card wrapper, like TraceLine)
=============================== */

/* the [hidden] attribute must always win over display:flex/grid rules
   (gz-filemeta / gzCanvasWrap etc.), so empty UI never leaks pre-upload */
#gzUploadCard [hidden]{ display: none !important; }

#gzUploadCard.gz-card{
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 auto;
}

#gzUploadCard #gzDropzone{
  width: 100%;
  margin: 0;
  padding: 3.2rem 1.5rem;
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(17,24,39,.05);
  transition: border-color .2s ease, background .2s ease;
}
#gzUploadCard #gzDropzone:hover,
#gzUploadCard #gzDropzone.is-dragover{
  border-color: var(--gz-accent);
  background: #f5f8ff;
}
#gzUploadCard .gz-drop-text{
  color: var(--gz-accent);
  margin-top: .6rem;
}

/* file meta as a clean bar below the dropzone */
#gzUploadCard .gz-filemeta{
  margin: 14px 0 0;
  padding: 11px 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

/* low-resolution notice — suggests upscaling with LinePrep first */
.al-lowres-notice{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 0;
  padding: 11px 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  color: #9a3412;
  font-size: .85rem;
  line-height: 1.45;
}
.al-lowres-notice svg{ color: #ea580c; flex: 0 0 auto; }
.al-lowres-notice span{ flex: 1 1 240px; min-width: 0; }
.al-lowres-notice a{
  color: var(--gz-accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.al-lowres-notice a:hover{ text-decoration: underline; }

/* ============================================================
   Workspace — layout decided by VIEWPORT WIDTH only
   (never by image aspect ratio)
     wide (>=768px) : preview left  + controls right  (horizontal)
     narrow (<768px): stacked (preview on top, controls below)
   ============================================================ */
.al-workspace{
  display: flex;
  flex-direction: column;     /* narrow default: stacked */
  gap: 22px;
  margin-top: 18px;
  align-items: stretch;
}

@media (min-width: 768px){
  .al-workspace{
    flex-direction: row;
    align-items: flex-start;
    gap: 26px;
  }
  /* fixed proportion so wide (landscape) images aren't crushed */
  .al-workspace #gzCanvasWrap{
    flex: 0 0 62%;
    width: 62%;
    max-width: 62%;
  }
  .al-workspace #gzMainControls{
    flex: 1 1 38%;
    min-width: 0;
  }
}

/* ===============================
   Preview frame — fixed-size box; the image fits inside (contain)
   at any ratio: portrait fits to height, landscape fits to width.
=============================== */
#gzCanvasWrap{
  position: relative;
  width: 100%;
  height: clamp(340px, 56vh, 600px);
  display: flex;                 /* center inner via margin:auto (scroll-safe) */
  overflow: auto;
  background:#f3f4f6;
  border:1px solid #e5e7eb;
  border-radius:12px;
  -webkit-overflow-scrolling: touch;
}

#gzCanvasInner{
  width: max-content;
  height: max-content;
  margin: auto;                  /* centers both axes; scrollable when zoomed */
}

#gzCanvas{
  display:block;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  background:#fff;
}

/* controls column: always single-column sliders for readability */
#gzUploadCard #gzMainControls .gz-settings-grid{
  grid-template-columns: 1fr;
}

/* wide layout: stack action buttons full-width inside the controls column */
@media (min-width: 768px){
  .al-workspace .gz-al-actions{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 22px;
  }
  .al-workspace .gz-al-actions .gz-primary-btn,
  .al-workspace .gz-al-actions .gz-secondary-btn{
    width: 100%;
    min-width: 0;
    margin: 0;
  }
}

/* Busy overlay (re-tracing) */
#gzBusy{
  display:none;
  position:absolute;
  inset:0;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.45);
  z-index:60;
  pointer-events:none;
}
#gzBusy .gz-spinner{
  width:34px;height:34px;
  border:3px solid rgba(31,111,255,.25);
  border-top-color:var(--gz-accent);
  border-radius:50%;
  animation:gzspin .7s linear infinite;
}
@keyframes gzspin{ to{ transform:rotate(360deg);} }

.gz-filemeta{ margin-bottom: 15px; }

/* ===============================
   Settings grid (2-col compact)
=============================== */
#gzUploadCard .gz-settings-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 30px;
  margin-top: 20px;
}
#gzUploadCard .gz-setting{
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}
#gzUploadCard .gz-setting--wide{ grid-column: 1 / -1; }
#gzUploadCard .gz-setting-label{
  display:block;
  font-size: .9rem;
  color: #111827;
  margin: 16px 0 4px;
}
#gzUploadCard .gz-setting-hint{
  display:block;
  font-size:.72rem;
  color:#9ca3af;
  font-weight:400;
  margin-top:2px;
}
#gzUploadCard .gz-setting-control{
  display:grid;
  grid-template-columns: 1fr 34px;
  align-items:center;
  gap: 5px;
  justify-items: end;
}
#gzUploadCard .gz-setting-value{
  width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color:#4b5563;
}

@media (max-width: 640px){
  #gzUploadCard .gz-settings-grid{ grid-template-columns: 1fr; gap: 4px 10px; }
  #gzUploadCard .gz-setting-control{ grid-template-columns: 1fr 38px; }
}

/* ===============================
   Actions
=============================== */
.gz-al-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:28px;
  justify-content:center;
}
.gz-al-actions .gz-secondary-btn,
.gz-al-actions .gz-primary-btn{
  min-height:50px;
  min-width:150px;
  margin:8px 6px 0;
}
.gz-primary-btn{ background:var(--gz-accent); color:#fff; }
.gz-secondary-btn{
  background:#fff;
  border:1px solid var(--gz-border);
  color:var(--gz-text);
}
.gz-primary-btn[disabled],
.gz-secondary-btn[disabled]{ opacity:.5; cursor:not-allowed; }

.gz-al-format-note{
  margin-top:1.2rem;
  font-size:.78rem;
  color:#6b7280;
  text-align:center;
}

/* ===============================
   Range sliders
=============================== */
.gz-range{
  flex:1;
  min-width:0;
  width:100%;
  height:44px;
  padding:10px 0;
  -webkit-appearance:none;
  appearance:none;
  background:#e5e7eb;
  height:6px;
  border-radius:10px;
  -webkit-tap-highlight-color:transparent;
  touch-action:pan-y;
}
.gz-range::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:20px;height:20px;
  background:#fff;
  border:2px solid #1f6fff;
  border-radius:50%;
  cursor:pointer;
  box-shadow:0 1px 3px rgba(0,0,0,0.2);
}

#gzUploadCard button,
#gzUploadCard a,
#gzUploadCard input[type="range"]{ touch-action: manipulation; }

/* ============================================================
   Guide section (shared gz-guide-* styles)
   ============================================================ */
.gz-guide-section{ background: transparent; padding-bottom: 80px; }
@media (max-width: 640px){ .gz-guide-section{ padding-bottom: 56px; } }
.gz-guide-inner{ max-width: 800px; margin: 0 auto; padding: 0 24px; }
.gz-guide-body{ margin-top: 40px; }
.gz-guide-subheading{
  font-size: 1.15rem; font-weight: 700; color: #111827;
  margin: 40px 0 16px; padding-bottom: 8px; border-bottom: 2px solid #e5e7eb;
}
.gz-guide-subheading:first-child{ margin-top: 0; }
.gz-guide-steps{ padding-left: 24px; margin: 0 0 8px; }
.gz-guide-step{ font-size: 1rem; line-height: 1.75; color: #374151; margin-bottom: 16px; padding-left: 8px; }
.gz-guide-text{ font-size: 1rem; line-height: 1.8; color: #374151; margin: 0 0 16px; }
.gz-guide-img{ width: 100%; max-width: 720px; height: auto; border-radius: 12px; margin: 16px 0 24px; display: block; }
.gz-guide-blog-cta{ margin-top: 40px; padding-top: 32px; border-top: 1px solid #e5e7eb; text-align: center; }
.gz-guide-blog-link{
  display: inline-block; font-size: 1rem; font-weight: 600; color: #1f6fff;
  text-decoration: none; padding: 10px 24px; border: 2px solid #1f6fff;
  border-radius: 8px; transition: background 0.15s, color 0.15s;
}
.gz-guide-blog-link:hover{ background: #1f6fff; color: #fff; }
@media (max-width: 640px){
  .gz-guide-inner{ padding: 0 16px; }
  .gz-guide-subheading{ font-size: 1.05rem; }
  .gz-guide-steps{ padding-left: 20px; }
}
