/* ============================================
   CamCrop — Main Stylesheet
   A clean, professional image cropping tool
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #1e293b;
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -0.02em;
}


/* --- Layout Helpers --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}


/* --- Navigation --- */
.site-nav {
  background: #1a1f2e;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0070d2, #6b3fa0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.nav-logo-text {
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: rgba(255,255,255,.7);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  transition: color .2s, background .2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: transform .3s, opacity .3s;
}

.mobile-menu {
  display: none;
  background: #1a1f2e;
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 12px 20px;
}

.mobile-menu a {
  display: block;
  color: rgba(255,255,255,.7);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  transition: color .2s, background .2s;
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.mobile-menu.open {
  display: block;
}


/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, #0070d2, #6b3fa0);
  padding: 60px 0;
  color: #fff;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero p {
  font-size: 18px;
  opacity: .85;
  line-height: 1.7;
  max-width: 520px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  background: #fff;
  color: #1a1f2e;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  transition: opacity .2s;
}

.hero-cta:hover {
  opacity: .9;
}

.hero-image {
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}


/* --- Crop Tool Section --- */
.crop-section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
}

.section-header p {
  color: #64748b;
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto;
}

/* Upload Area */
.upload-area {
  max-width: 580px;
  margin: 0 auto;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 60px 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: #f8fafc;
}

.upload-area:hover {
  border-color: #0070d2;
  background: #f0f7ff;
}

.upload-area.hidden {
  display: none;
}

.upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: .4;
}

.upload-area h3 {
  font-size: 18px;
  color: #1e293b;
  margin-bottom: 6px;
}

.upload-area p {
  color: #94a3b8;
  font-size: 14px;
  margin-bottom: 16px;
}

.upload-btn {
  display: inline-block;
  background: #0070d2;
  color: #fff;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background .2s;
}

.upload-btn:hover {
  background: #005bb5;
}

/* Canvas Workspace */
.canvas-workspace {
  display: none;
  max-width: 580px;
  margin: 0 auto;
}

.canvas-workspace.visible {
  display: block;
}

.canvas-wrapper {
  position: relative;
  margin: 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  max-width: 400px;
}

.canvas-wrapper canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: move;
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.tool-btn:hover {
  border-color: #0070d2;
  background: #f0f7ff;
}

.tool-btn svg {
  width: 16px;
  height: 16px;
}

.drag-hint {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  margin-top: 14px;
}

.download-row {
  text-align: center;
  margin-top: 24px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0070d2, #6b3fa0);
  color: #fff;
  padding: 14px 32px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}

.download-btn:hover {
  opacity: .9;
}


/* --- How-To Section --- */
.howto {
  background: #faf9f7;
  padding: 80px 0;
}

.howto ol {
  max-width: 680px;
  margin: 0 auto;
  counter-reset: steps;
}

.howto li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 28px;
  counter-increment: steps;
}

.step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0070d2, #6b3fa0);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.howto li p {
  padding-top: 8px;
  color: #475569;
  font-size: 15px;
  line-height: 1.7;
}


/* --- Features Grid --- */
.features {
  padding: 80px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.feature-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow .3s, transform .2s;
}

.feature-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}


/* --- Other Shapes --- */
.shapes-section {
  background: #f5f7fb;
  padding: 80px 0;
}

.shapes-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.shape-link {
  background: #fff;
  border-radius: 12px;
  padding: 24px 12px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow .3s, transform .2s;
}

.shape-link:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  transform: translateY(-3px);
}

.shape-link .shape-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
  color: #0070d2;
}

.shape-link span:last-child {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
}


/* --- Footer --- */
.site-footer {
  background: #1a1f2e;
  color: #fff;
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-grid h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
}

.footer-grid p {
  color: rgba(255,255,255,.5);
  font-size: 14px;
  line-height: 1.7;
}

.footer-links a {
  display: block;
  color: rgba(255,255,255,.5);
  font-size: 14px;
  padding: 4px 0;
  transition: color .2s;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 20px 20px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center;
  color: rgba(255,255,255,.3);
  font-size: 13px;
}


/* --- Responsive --- */
@media (max-width: 1024px) {
  .hero h1 {
    font-size: 34px;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .shapes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: block;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-grid > div:last-child {
    display: none;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero p {
    margin: 0 auto;
    font-size: 16px;
  }
  .hero-cta {
    margin-top: 20px;
  }

  .section-header h2 {
    font-size: 24px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
  .shapes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 480px) {
  .toolbar {
    gap: 6px;
  }
  .tool-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}
