:root{
  --bg:#f5f7fb;
  --surface:#ffffff;
  --surface-2:#fafbfc;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --line-2:#dbe1ea;
  --primary:#111111;
  --primary-2:#1f2937;
  --accent:#2563eb;
  --shadow-sm:0 2px 10px rgba(0,0,0,0.04);
  --shadow-md:0 8px 28px rgba(0,0,0,0.07);
  --shadow-lg:0 16px 38px rgba(0,0,0,0.10);
  --radius-sm:10px;
  --radius-md:14px;
  --radius-lg:18px;
  --radius-xl:24px;
  --max-width:1280px;
  --header-height:76px;
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

img{
  max-width:100%;
  display:block;
}

a{
  color:inherit;
}

button,
input,
select,
textarea{
  font:inherit;
}

.container{
  width:min(94%, var(--max-width));
  margin:0 auto;
}

/* Header */
.header{
  position:sticky;
  top:0;
  z-index:1000;
  background:rgba(255,255,255,0.88);
  backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(229,231,235,0.85);
}

.header .container{
  min-height:var(--header-height);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.logo{
  font-size:28px;
  font-weight:800;
  letter-spacing:-0.8px;
  color:var(--text);
  white-space:nowrap;
}

.nav{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.nav a{
  text-decoration:none;
  color:var(--text);
  font-size:14px;
  font-weight:700;
  padding:11px 14px;
  border-radius:999px;
  transition:all .18s ease;
}

.nav a:hover{
  background:#f3f4f6;
}

.nav a.active{
  background:#111111;
  color:#ffffff;
}

/* Footer */
.footer{
  margin-top:40px;
  background:#ffffff;
  border-top:1px solid var(--line);
}

.footer-container{
  min-height:74px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-size:14px;
}

/* Common page shells */
.page-section,
.hero-section,
.tools-section,
.tool-page{
  position:relative;
}

.section-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow-md);
}

/* Typography helpers */
.page-title,
.section-title{
  margin:0 0 12px;
  font-size:44px;
  line-height:1.1;
  letter-spacing:-0.8px;
  color:var(--text);
}

.page-subtitle,
.section-subtitle{
  margin:0;
  color:var(--muted);
  font-size:18px;
  line-height:1.7;
}

.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#eef2ff;
  color:#3730a3;
  font-size:12px;
  font-weight:800;
  letter-spacing:.3px;
  text-transform:uppercase;
}

/* Buttons */
.btn,
.button,
.tool-btn{
  appearance:none;
  border:none;
  outline:none;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:46px;
  padding:12px 18px;
  border-radius:12px;
  font-size:14px;
  font-weight:800;
  transition:transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.btn:hover,
.button:hover,
.tool-btn:hover{
  transform:translateY(-1px);
}

.btn:disabled,
button:disabled{
  opacity:.5;
  cursor:not-allowed;
  transform:none;
}

.btn-primary,
.btn,
.tool-btn{
  background:#111111;
  color:#ffffff;
  box-shadow:0 8px 18px rgba(0,0,0,0.12);
}

.btn-primary:hover,
.btn:hover,
.tool-btn:hover{
  background:#1f2937;
}

.btn-secondary{
  background:#ffffff;
  color:#111111;
  border:1px solid var(--line-2);
  box-shadow:none;
}

.btn-secondary:hover{
  background:#f9fafb;
}

/* Inputs */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="search"],
input[type="url"],
select,
textarea{
  width:100%;
  border:1px solid var(--line-2);
  background:#ffffff;
  color:var(--text);
  border-radius:12px;
  padding:12px 14px;
  outline:none;
  transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus{
  border-color:#9ca3af;
  box-shadow:0 0 0 4px rgba(17,17,17,0.05);
}

input[type="range"]{
  width:100%;
}

/* Hero blocks */
.hero{
  text-align:center;
  padding:20px 0 8px;
}

.hero h1{
  margin:0 0 14px;
  font-size:54px;
  line-height:1.04;
  letter-spacing:-1px;
}

.hero p{
  max-width:860px;
  margin:0 auto;
  color:var(--muted);
  font-size:18px;
  line-height:1.8;
}

/* Cards / grids */
.grid{
  display:grid;
  gap:22px;
}

.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:var(--shadow-sm);
  padding:20px;
}

.card:hover{
  box-shadow:var(--shadow-md);
}

/* Tool cards */
.tool-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow-sm);
  padding:20px;
}

.tool-card:hover{
  border-color:#d1d5db;
  box-shadow:var(--shadow-md);
}

.tool-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:16px;
}

.tool-icon{
  width:58px;
  height:58px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f3f4f6;
  font-size:28px;
  flex-shrink:0;
}

.tool-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
  padding:7px 10px;
  border-radius:999px;
  background:#f3f4f6;
  color:#374151;
  font-size:12px;
  font-weight:800;
}

.tool-title{
  margin:0 0 10px;
  font-size:24px;
  line-height:1.2;
  letter-spacing:-0.4px;
}

.tool-desc{
  margin:0 0 16px;
  color:var(--muted);
  font-size:15px;
  line-height:1.75;
}

.tool-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:18px;
}

.meta-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 10px;
  border-radius:999px;
  background:#f9fafb;
  border:1px solid #eceff3;
  color:#4b5563;
  font-size:12px;
  font-weight:800;
}

.tool-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:auto;
}

/* Upload areas */
.upload-box{
  border:2px dashed #d1d5db;
  border-radius:18px;
  background:linear-gradient(180deg,#ffffff 0%, #f9fafb 100%);
  transition:border-color .16s ease, background .16s ease, transform .16s ease;
}

.upload-box:hover{
  border-color:#9ca3af;
}

.upload-box.dragover{
  border-color:#111111 !important;
  background:#f3f4f6 !important;
  transform:scale(1.004);
}

/* Panels used in tools */
.top-panel,
.workspace-card,
.panel{
  background:#ffffff;
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow-md);
}

.workspace-card{
  box-shadow:var(--shadow-sm);
}

.preview-result,
.picker-stage,
.cropper-stage{
  background:#fafafa;
  border:1px dashed #e5e7eb;
  border-radius:14px;
}

.stat-box,
.control-box,
.compare-card,
.color-card,
.tile-card{
  background:#fafafa;
  border:1px solid #eceff3;
  border-radius:14px;
}

.stat-label,
.panel-title{
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.stat-value{
  color:var(--text);
  font-weight:800;
}

.notice{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:12px;
}

.progress{
  background:#e5e7eb;
}

.progress-bar{
  background:#111111;
}

/* Homepage style helpers */
.hero-surface{
  background:
    radial-gradient(circle at top left, rgba(37,99,235,0.10), transparent 34%),
    radial-gradient(circle at top right, rgba(17,24,39,0.06), transparent 26%),
    linear-gradient(180deg,#ffffff 0%, #f8fafc 100%);
  border:1px solid var(--line);
  border-radius:30px;
  box-shadow:var(--shadow-lg);
  padding:40px 26px;
}

.feature-list{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
}

.feature-card{
  background:#ffffff;
  border:1px solid var(--line);
  border-radius:20px;
  padding:20px;
  box-shadow:var(--shadow-sm);
}

.feature-card h3{
  margin:0 0 10px;
  font-size:20px;
}

.feature-card p{
  margin:0;
  color:var(--muted);
  line-height:1.7;
}

/* Simple responsive helpers */
.hide-mobile{
  display:block;
}

.show-mobile{
  display:none;
}

@media(max-width:1100px){
  .feature-list{
    grid-template-columns:1fr 1fr;
  }
}

@media(max-width:860px){
  .header .container{
    min-height:auto;
    padding:14px 0;
    align-items:flex-start;
    flex-direction:column;
  }

  .nav{
    width:100%;
    gap:6px;
  }

  .nav a{
    padding:10px 12px;
    font-size:13px;
  }

  .hero h1,
  .page-title,
  .section-title{
    font-size:38px;
  }

  .hero p,
  .page-subtitle,
  .section-subtitle{
    font-size:16px;
  }

  .feature-list{
    grid-template-columns:1fr;
  }

  .hide-mobile{
    display:none;
  }

  .show-mobile{
    display:block;
  }
}

@media(max-width:640px){
  :root{
    --header-height:68px;
  }

  .container{
    width:min(94%, 100%);
  }

  .logo{
    font-size:24px;
  }

  .hero h1,
  .page-title,
  .section-title{
    font-size:32px;
  }

  .tool-title{
    font-size:22px;
  }

  .tool-desc{
    font-size:14px;
  }

  .hero-surface{
    padding:28px 18px;
    border-radius:22px;
  }

  .card,
  .tool-card,
  .feature-card{
    padding:18px;
  }
}