/* =====================================================
   TIERLISTMAKER.RUN — Editorial Warm Design System
   ===================================================== */

/* ── Design Tokens ── */
:root {
  --bg:        #FDFAF5;
  --bg-alt:    #F5EFE3;
  --text:      #1A1208;
  --muted:     #6B5744;
  --accent:    #E8721C;
  --accent-dk: #B85510;
  --warm:      #C4956A;
  --border:    #E8DCC8;
  --surface:   #FFFFFF;
  --shadow-sm: 0 1px 4px rgba(26,18,8,.07);
  --shadow-md: 0 4px 16px rgba(26,18,8,.1);
  --shadow-lg: 0 8px 32px rgba(26,18,8,.13);
  --r:         12px;
  --r-sm:      8px;
  --r-lg:      20px;
}

/* ── Reset ── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;font-size:16px}
body{font-family:'Inter',sans-serif;background:var(--bg);color:var(--text);line-height:1.65;overflow-x:hidden}
a{color:inherit;text-decoration:none}
button{cursor:pointer;font-family:inherit;border:none;background:none}
img{max-width:100%;display:block}
input{font-family:inherit}
ul,ol{list-style:none}

/* ── Typography ── */
h1,h2{font-family:'Playfair Display',serif;line-height:1.15}
h3,h4{font-family:'DM Sans',sans-serif;font-weight:700}

/* ── Container ── */
.container{max-width:1200px;margin:0 auto;padding:0 24px}

/* ── Buttons ── */
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 22px;border-radius:var(--r-sm);
  font-family:'DM Sans',sans-serif;font-weight:600;font-size:15px;
  transition:all .2s ease;cursor:pointer;border:2px solid transparent;
}
.btn-primary{background:var(--accent);color:#fff;border-color:var(--accent)}
.btn-primary:hover{background:var(--accent-dk);border-color:var(--accent-dk);transform:translateX(2px);box-shadow:0 4px 12px rgba(232,114,28,.35)}
.btn-ghost{background:transparent;color:var(--muted);border-color:var(--border)}
.btn-ghost:hover{border-color:var(--warm);color:var(--text)}
.btn-lg{padding:14px 30px;font-size:17px;border-radius:10px}

/* ── Scroll-reveal ── */
.reveal{opacity:0;transform:translateY(24px);transition:opacity .55s ease,transform .55s ease}
.reveal.visible{opacity:1;transform:none}

/* =====================================================
   HEADER
   ===================================================== */
.header{
  position:sticky;top:0;z-index:100;
  background:rgba(253,250,245,.93);backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
}
.header-inner{display:flex;align-items:center;gap:28px;height:64px}
.logo{display:flex;align-items:center;gap:10px;flex-shrink:0}
.logo-icon{width:36px;height:36px}
.logo-text{font-family:'DM Sans',sans-serif;font-weight:700;font-size:18px;letter-spacing:-.4px}
.logo-dot{color:var(--accent)}
.nav{display:flex;gap:24px;margin-left:auto}
.nav-link{font-family:'DM Sans',sans-serif;font-size:14px;font-weight:500;color:var(--muted);transition:color .2s}
.nav-link:hover{color:var(--accent)}
.nav-cta{padding:8px 18px;font-size:14px}
.nav-hamburger{display:none;font-size:22px;color:var(--text);padding:6px}

/* =====================================================
   HERO
   ===================================================== */
.hero{
  padding:88px 0 64px;background:var(--bg);text-align:center;
  position:relative;overflow:hidden;
}
.hero::before{
  content:'';position:absolute;inset:0;pointer-events:none;
  background:
    radial-gradient(ellipse 60% 50% at 15% 50%,rgba(232,114,28,.07) 0%,transparent 70%),
    radial-gradient(ellipse 50% 40% at 85% 20%,rgba(196,149,106,.06) 0%,transparent 70%);
}
.hero-inner{position:relative}
.hero-badge{
  display:inline-flex;align-items:center;gap:6px;margin-bottom:24px;
  background:rgba(232,114,28,.1);color:var(--accent);
  padding:6px 18px;border-radius:100px;font-size:13px;font-weight:600;
  font-family:'DM Sans',sans-serif;border:1px solid rgba(232,114,28,.22);
}
.hero-title{
  font-size:clamp(38px,6.5vw,66px);font-weight:800;
  margin-bottom:18px;letter-spacing:-1.5px;
}
.hero-title em{font-style:italic;color:var(--accent)}
.hero-sub{
  font-size:17px;color:var(--muted);max-width:640px;
  margin:0 auto 32px;line-height:1.75;
}
.hero-cta-group{display:flex;flex-direction:column;align-items:center;gap:12px}
.hero-note{font-size:13px;color:var(--muted);font-family:'DM Sans',sans-serif}
.hero-scroll-hint{font-size:22px;color:var(--warm);margin-top:36px;animation:bounce 2s infinite}
@keyframes bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(7px)}}

/* =====================================================
   AD SLOT
   ===================================================== */
.ad-slot{display:flex;justify-content:center;padding:8px 0;min-height:0}

/* =====================================================
   TOOL SECTION
   ===================================================== */
.tool-section{background:var(--bg-alt);padding:12px 0 56px}
.tool-container{max-width:1120px;margin:0 auto;padding:0 24px}

/* Toolbar */
.toolbar{
  display:flex;align-items:center;justify-content:space-between;
  gap:8px;padding:14px 0;flex-wrap:wrap;
}
.toolbar-left{display:flex;gap:6px;flex-wrap:wrap}
.toolbar-right{display:flex;gap:8px}
.tool-btn{
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 14px;border-radius:var(--r-sm);
  background:var(--surface);border:1.5px solid var(--border);
  color:var(--muted);font-family:'DM Sans',sans-serif;
  font-size:13px;font-weight:500;transition:all .18s ease;
}
.tool-btn svg{width:15px;height:15px;flex-shrink:0}
.tool-btn:hover{border-color:var(--warm);color:var(--text);background:var(--bg)}
.tool-btn-danger:hover{border-color:#c0392b;color:#c0392b}
.btn-export{
  background:var(--accent)!important;color:#fff!important;
  border-color:var(--accent)!important;font-size:14px!important;padding:9px 20px!important;
}
.btn-export:hover{background:var(--accent-dk)!important;border-color:var(--accent-dk)!important;box-shadow:0 4px 14px rgba(232,114,28,.35)!important}

/* Modal */
.modal-overlay{
  position:fixed;inset:0;z-index:200;
  display:flex;align-items:center;justify-content:center;
  background:rgba(26,18,8,.48);backdrop-filter:blur(5px);
}
.modal-box{
  background:var(--surface);border-radius:var(--r-lg);
  padding:32px;width:100%;max-width:440px;box-shadow:var(--shadow-lg);
}
.modal-title{font-size:20px;margin-bottom:16px;color:var(--text)}
.modal-input{
  width:100%;padding:11px 16px;border-radius:var(--r-sm);
  border:1.5px solid var(--border);font-size:15px;
  color:var(--text);background:var(--bg);margin-bottom:16px;
  outline:none;transition:border-color .2s;
}
.modal-input:focus{border-color:var(--accent)}
.modal-actions{display:flex;gap:10px}

/* Title input */
.tierlist-title-wrapper{padding:16px 0 4px}
.tierlist-title-input{
  width:100%;background:transparent;border:none;
  border-bottom:2px solid var(--border);
  font-family:'DM Sans',sans-serif;font-size:22px;font-weight:700;
  color:var(--text);padding:4px 0;outline:none;transition:border-color .2s;
}
.tierlist-title-input:focus{border-color:var(--accent)}

/* Tier List Grid */
.tier-list{
  display:flex;flex-direction:column;gap:2px;
  background:var(--surface);border-radius:var(--r);
  overflow:hidden;border:1.5px solid var(--border);
  box-shadow:var(--shadow-sm);margin-top:10px;
}

/* Tier Row */
.tier-row{
  display:flex;align-items:stretch;min-height:76px;
  border-bottom:1px solid var(--border);position:relative;
  transition:background .15s;
}
.tier-row:last-child{border-bottom:none}
.tier-row.drag-over .tier-items{
  outline:2px dashed var(--accent);outline-offset:-2px;border-radius:var(--r-sm);
  background:rgba(232,114,28,.06);
}

/* Tier Label */
.tier-label-cell{
  width:72px;flex-shrink:0;display:flex;align-items:center;justify-content:center;
  border-right:1px solid rgba(255,255,255,.15);position:relative;cursor:pointer;
}
.tier-label-input{
  font-family:'DM Sans',sans-serif;font-size:20px;font-weight:800;
  color:#fff;text-shadow:0 1px 4px rgba(0,0,0,.25);
  border:none;background:transparent;
  width:100%;height:100%;display:flex;align-items:center;justify-content:center;
  text-align:center;outline:none;cursor:text;padding:0;
}
.tier-color-dot{
  position:absolute;bottom:5px;right:5px;
  width:14px;height:14px;border-radius:50%;
  background:rgba(255,255,255,.35);border:none;
  opacity:0;transition:opacity .15s;cursor:pointer;padding:0;
}
.tier-label-cell:hover .tier-color-dot{opacity:1}
.tier-color-pick{display:none}

/* Tier Items */
.tier-items{
  flex:1;display:flex;flex-wrap:wrap;align-content:flex-start;
  gap:5px;padding:6px;min-height:76px;
}

/* Tier Controls (hover side) */
.tier-controls{
  display:flex;flex-direction:column;justify-content:center;
  gap:2px;padding:4px 6px;opacity:0;transition:opacity .15s;
}
.tier-row:hover .tier-controls{opacity:1}
.tier-ctrl{
  width:22px;height:22px;border-radius:4px;font-size:13px;
  color:var(--muted);display:flex;align-items:center;justify-content:center;
  transition:all .15s;
}
.tier-ctrl:hover{background:var(--bg-alt);color:var(--text)}

/* Item Cards */
.item-card{
  width:64px;height:64px;border-radius:6px;overflow:hidden;
  cursor:grab;position:relative;flex-shrink:0;
  transition:transform .15s,box-shadow .15s;
  border:2px solid transparent;user-select:none;
}
.item-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-md)}
.item-card.dragging{opacity:.7;transform:scale(1.05) rotate(2deg);cursor:grabbing}
.item-card.mobile-selected{border-color:var(--accent);box-shadow:0 0 0 3px rgba(232,114,28,.4);transform:translateY(-3px)}
.item-card.drag-over-card{border-color:var(--accent)}
.item-card img{width:100%;height:100%;object-fit:cover;pointer-events:none;display:block}
.item-label{
  width:100%;height:100%;display:flex;align-items:center;justify-content:center;
  font-family:'DM Sans',sans-serif;font-size:11px;font-weight:600;
  color:#fff;padding:5px;text-align:center;word-break:break-word;line-height:1.25;
}
.item-remove{
  position:absolute;top:2px;right:2px;width:16px;height:16px;
  border-radius:50%;background:rgba(26,18,8,.72);color:#fff;
  font-size:10px;display:none;align-items:center;justify-content:center;
  border:none;cursor:pointer;line-height:1;
}
.item-card:hover .item-remove{display:flex}

/* Item Pool */
.item-pool-wrapper{margin-top:14px}
.item-pool-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:8px 0 6px;font-family:'DM Sans',sans-serif;font-size:13px;color:var(--muted);
  border-bottom:1px solid var(--border);margin-bottom:8px;
}
.pool-label{font-weight:600;color:var(--text)}
.pool-hint{font-size:12px}
.item-pool{
  min-height:96px;display:flex;flex-wrap:wrap;gap:6px;
  padding:10px;background:var(--surface);border-radius:var(--r);
  border:1.5px dashed var(--border);transition:border-color .15s,background .15s;
}
.item-pool.drag-over{border-color:var(--accent);background:rgba(232,114,28,.03)}
.pool-empty{
  width:100%;display:flex;flex-direction:column;align-items:center;
  gap:12px;padding:24px;color:var(--muted);text-align:center;
}
.pool-empty svg{opacity:.5}
.pool-empty p{font-size:14px;line-height:1.5}
.tool-notice{
  margin-top:10px;font-size:12px;color:var(--muted);
  font-family:'DM Sans',sans-serif;text-align:center;opacity:.7;
}

/* Color Picker Popup */
.color-popup{
  position:absolute;z-index:50;background:var(--surface);
  border:1.5px solid var(--border);border-radius:var(--r);
  padding:12px;box-shadow:var(--shadow-lg);
  display:grid;grid-template-columns:repeat(5,28px);gap:6px;
}
.color-swatch{
  width:28px;height:28px;border-radius:6px;cursor:pointer;border:2px solid transparent;
  transition:transform .15s,border-color .15s;
}
.color-swatch:hover{transform:scale(1.15);border-color:var(--text)}

/* =====================================================
   SECTION COMMONS
   ===================================================== */
.section-header{text-align:center;margin-bottom:56px}
.section-badge{
  display:inline-block;background:rgba(232,114,28,.1);color:var(--accent);
  padding:4px 16px;border-radius:100px;font-size:12px;font-weight:600;
  font-family:'DM Sans',sans-serif;margin-bottom:14px;
  letter-spacing:.6px;text-transform:uppercase;
}
.section-title{
  font-size:clamp(28px,4.5vw,44px);font-weight:800;
  margin-bottom:14px;letter-spacing:-.5px;
}
.section-sub{font-size:16px;color:var(--muted);max-width:560px;margin:0 auto;line-height:1.75}

/* =====================================================
   FEATURES
   ===================================================== */
.features-section{padding:96px 0;background:var(--bg)}
.features-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:24px}
.feature-card{
  background:var(--surface);border:1.5px solid var(--border);
  border-radius:var(--r-lg);padding:36px 32px;
  transition:transform .22s,box-shadow .22s,border-color .22s;
}
.feature-card:hover{transform:translateY(-5px);box-shadow:var(--shadow-lg);border-color:var(--warm)}
.feature-icon{width:52px;height:52px;margin-bottom:20px}
.feature-card h3{font-size:20px;margin-bottom:10px;color:var(--text)}
.feature-card p{font-size:15px;color:var(--muted);line-height:1.75}

/* =====================================================
   HOW IT WORKS
   ===================================================== */
.how-section{padding:96px 0;background:var(--bg-alt)}
.steps-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:40px}
.step-card{text-align:center;padding:0 8px}
.step-number{
  font-family:'Playfair Display',serif;font-size:64px;font-weight:800;
  color:rgba(232,114,28,.14);line-height:1;margin-bottom:16px;
}
.step-card h3{font-size:21px;margin-bottom:12px}
.step-card p{font-size:15px;color:var(--muted);line-height:1.75}

/* =====================================================
   USE CASES
   ===================================================== */
.usecases-section{padding:96px 0;background:var(--bg)}
.usecases-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:20px}
.usecase-card{
  background:var(--bg-alt);border:1.5px solid var(--border);
  border-radius:var(--r);padding:32px 28px;
  transition:transform .2s,box-shadow .2s;
}
.usecase-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-md)}
.usecase-emoji{font-size:34px;margin-bottom:14px}
.usecase-card h3{font-size:17px;margin-bottom:8px}
.usecase-card p{font-size:14px;color:var(--muted);line-height:1.75}

/* =====================================================
   WHY US
   ===================================================== */
.whyus-section{padding:96px 0;background:var(--bg-alt)}
.whyus-inner{display:grid;grid-template-columns:1fr 1fr;gap:72px;align-items:center}
.whyus-text .section-badge{text-align:left}
.whyus-text .section-title{text-align:left;font-size:clamp(24px,3.8vw,38px)}
.whyus-text>p{font-size:15px;color:var(--muted);line-height:1.85;margin-bottom:28px}
.whyus-list{display:flex;flex-direction:column;gap:14px}
.whyus-list li{display:flex;align-items:flex-start;gap:12px;font-size:15px}
.check{color:var(--accent);font-weight:700;flex-shrink:0;margin-top:1px;font-size:16px}
.whyus-visual{display:flex;justify-content:center;align-items:center}
.whyus-mockup{
  background:var(--surface);border-radius:var(--r-lg);overflow:hidden;
  box-shadow:var(--shadow-lg);border:1.5px solid var(--border);width:100%;max-width:360px;
}
.mock-tier{
  display:flex;align-items:center;gap:16px;padding:16px 20px;
  font-family:'DM Sans',sans-serif;
  border-bottom:1px solid rgba(255,255,255,.12);
}
.mock-tier:last-child{border-bottom:none}
.mock-label{font-size:22px;font-weight:800;color:#fff;min-width:28px;text-align:center}
.mock-desc{font-size:13px;font-weight:500;color:rgba(255,255,255,.9)}
.mock-s{background:#E8721C}
.mock-a{background:#D4A017}
.mock-b{background:#8B9D6A}
.mock-c{background:#9E7B5A}
.mock-f{background:#6B5744}

/* =====================================================
   FAQ
   ===================================================== */
.faq-section{padding:96px 0;background:var(--bg)}
.faq-list{max-width:780px;margin:0 auto;display:flex;flex-direction:column;gap:6px}
.faq-item{border:1.5px solid var(--border);border-radius:var(--r);overflow:hidden;transition:border-color .2s}
.faq-item:has(.faq-q[aria-expanded="true"]){border-color:var(--warm)}
.faq-q{
  display:flex;align-items:center;justify-content:space-between;
  width:100%;padding:20px 24px;text-align:left;background:var(--surface);
  font-family:'DM Sans',sans-serif;font-size:16px;font-weight:600;
  color:var(--text);gap:12px;transition:background .15s;
}
.faq-q:hover{background:var(--bg)}
.faq-icon{
  font-size:20px;color:var(--accent);flex-shrink:0;
  transition:transform .25s ease;font-weight:300;
}
.faq-q[aria-expanded="true"] .faq-icon{transform:rotate(45deg)}
.faq-a{
  padding:0 24px;max-height:0;overflow:hidden;
  transition:max-height .35s ease,padding .35s ease;background:var(--bg);
}
.faq-a:not([hidden]){padding:18px 24px;max-height:400px}
.faq-a p{font-size:15px;color:var(--muted);line-height:1.8}

/* =====================================================
   FOOTER
   ===================================================== */
.footer{background:var(--bg-alt);border-top:1px solid var(--border);padding:56px 0 32px}
.footer-inner{display:flex;flex-direction:column;gap:32px;align-items:center;text-align:center}
.footer-brand{display:flex;flex-direction:column;align-items:center;gap:10px}
.footer-tagline{font-size:14px;color:var(--muted);max-width:400px;line-height:1.6}
.footer-links{display:flex;gap:28px;flex-wrap:wrap;justify-content:center}
.footer-links a{font-family:'DM Sans',sans-serif;font-size:14px;font-weight:500;color:var(--muted);transition:color .2s}
.footer-links a:hover{color:var(--accent)}
.footer-copy p{font-size:13px;color:var(--muted)}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media(max-width:900px){
  .whyus-inner{grid-template-columns:1fr;gap:48px}
  .whyus-visual{order:-1}
  .nav{display:none}
  .nav-hamburger{display:block}
}
@media(max-width:640px){
  .hero{padding:60px 0 44px}
  .hero-title{letter-spacing:-.5px}
  .features-section,.how-section,.usecases-section,.whyus-section,.faq-section{padding:64px 0}
  .section-header{margin-bottom:40px}
  .tool-btn span,.tool-btn-text{display:none}
  .toolbar{gap:4px}
  .nav-cta{display:none}
}
@media(max-width:400px){
  .item-card{width:56px;height:56px}
  .tier-label-cell{width:60px}
}

/* Window-level file drop overlay (F4 spec) */
body.window-drag-over::after{
  content:'Drop images here to add them';
  position:fixed;inset:0;z-index:9999;
  background:rgba(232,114,28,.12);
  border:3px dashed var(--accent);
  display:flex;align-items:center;justify-content:center;
  font-family:'DM Sans',sans-serif;font-size:22px;font-weight:700;
  color:var(--accent);pointer-events:none;
}
