*{box-sizing:border-box;margin:0;padding:0;}

:root{
  --bg:#222831;
  --panel:#2b3136;
  --button:#1e2327;
  --yellow:#f6e96b;
  --accent:#ff5c38;
  --text: #e8e8e8;
  --border:rgba(255,255,255,0.1);
}

/* Light Theme */
body.light-mode {
  background: linear-gradient(180deg, #e8f4f8, #d4e7f0);
}

body.light-mode header {
  background: linear-gradient(180deg, #ffffff, #e6e6e6d7);
  border: 2px solid rgba(0,0,0,0.1);
  box-shadow: 0 15px 32px rgba(0,0,0,0.10);
}

body.light-mode nav a {
  color: hsl(43 1% 0%);
}

body.light-mode .icon-btn {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  border: 1.5px solid rgba(0,0,0,0.15);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

body.light-mode .icon-btn svg {
  fill: #2c3e50;
}

body.light-mode .icon-btn.theme-toggle svg {
  fill: #f39c12;
}

body.light-mode .calculator-card {
  background: linear-gradient(145deg, #ffffff, #f5f7fa);
  border: 2px solid rgba(0,0,0,0.1);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

body.light-mode .calculator-card:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  border-color: #3498db;
}

body.light-mode .card-icon {
  background: linear-gradient(145deg, #3498db, #2980b9);
}

body.light-mode .card-title {
  color: #2c3e50;
}

body.light-mode .card-description {
  color: rgba(44,62,80,0.7);
}

body.light-mode .section-title {
  color: #2c3e50;
}

body.light-mode .quick-nav {
  background: linear-gradient(145deg, #ffffff, #f5f7fa);
  border: 2px solid rgba(0,0,0,0.1);
}

body.light-mode .quick-nav-btn {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  color: #2c3e50;
  border: 2px solid rgba(0,0,0,0.1);
}

body.light-mode .quick-nav-btn:hover {
  background: linear-gradient(145deg, #3498db, #2980b9);
  color: #fff;
}

body.light-mode .back-to-top {
  background: linear-gradient(145deg, #3498db, #2980b9);
}

body.light-mode .back-to-top svg {
  fill: #fff;
}

body.light-mode footer {
  background: linear-gradient(180deg, #2c3e50, #1a252f);
}

body.light-mode .footer-link {
  color: rgba(255,255,255,0.8);
}

body{
  min-height:100vh;
  background:linear-gradient(180deg,#0d1113,#1a1f22);
  font-family:"Inter",Roboto,Arial,sans-serif;
  padding-top: 90px;
}

header {
  background:linear-gradient(180deg,#2e3539,#1f2326);
  border: 1px solid rgba(44, 44, 44, 0.4);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.10);
  width: 100%;
  height: 70px;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  z-index: 1000;
}

.brand-logo{margin-right: auto;} 
.brand-logo svg path {fill: var(--text);} 

body.light-mode .brand-logo svg path{fill: #2c3e50;}

nav a{
  text-decoration: none;
  color: hsl(43 1% 0%);
  font-size: 1.8rem;
  font-weight: 500;
  padding: 2px 4px;
  text-shadow: 1px 1px 2px hsla(0, 0%, 100%, 0.205),
  0 0 1px hsla(0, 0%, 0%, 0.3);
  transition: all 0.3s;
}

nav a:hover {
  text-decoration: underline;
  font-weight: 600;
  text-shadow: 1px 1px 2px hsla(0, 0%, 67%, 0.245),
  0 0 1px hsla(0, 0%, 0%, 0.418);
}

.header-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-left: auto;
}

.icon-btn {
  width: 45px;
  height: 45px;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  border: 1.5px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {transform: scale(1.1);}

.icon-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4) inset;
}

.icon-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s;
  fill: #e3e3e3;
}

.icon-btn:hover svg {transform: rotate(20deg);}

/* Quick Navigation */
.quick-nav {
  background: linear-gradient(145deg, #2e3539, #1f2326);
  border: 2px solid var(--border);
  border-radius: 15px;
  padding: 20px;
  margin: 20px auto;
  max-width: 1200px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.quick-nav h2 {
  color: var(--yellow);
  font-size: 1.5rem;
  margin-bottom: 15px;
  text-align: center;
}

.quick-nav-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.quick-nav-btn {
  background: linear-gradient(145deg, #3a4147, #2a3035);
  color: #fff;
  border: 2px solid var(--border);
  border-radius: 25px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

.quick-nav-btn:hover {
  background: linear-gradient(145deg, var(--yellow), var(--accent));
  color: #222831;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(246,233,107,0.4);
}

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

.page-title {
  text-align: center;
  color: var(--yellow);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

body.light-mode .page-title {color: #2c3e50;}

.page-subtitle {
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

body.light-mode .page-subtitle {color: rgba(44,62,80,0.7);}

/* Section */
.calculator-section {
  margin-bottom: 50px;
  scroll-margin-top: 90px;
}

.section-title {
  color: var(--yellow);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--yellow);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Calculator Cards Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.calculator-card {
  background: linear-gradient(145deg, #2e3539, #1f2326);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
}

.calculator-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
  border-color: var(--yellow);
}

.calculator-card:active {transform: translateY(-4px);}

.card-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(145deg, var(--yellow), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 5px 15px rgba(246,233,107,0.3);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.card-description {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 110px;
  right: 30px;
  width: 55px;
  height: 55px;
  background: linear-gradient(145deg, var(--yellow), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  box-shadow: 0 5px 15px rgba(0,0,0,0.4);
  z-index: 999;
  border: none;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(246,233,107,0.5);
}

.back-to-top svg {
  width: 28px;
  height: 28px;
  fill: #222831;
}

/* Footer CSS */
footer {
  background: linear-gradient(180deg, #1f2326, #0d1113);
  border-top: 2px solid rgba(255,255,255,0.1);
  padding: 40px 20px 20px;
  margin-top: 60px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
}

/* Light Mode Footer */
body.light-mode footer {
  background: linear-gradient(180deg, #2c3e50, #1a252f);
}

/* Responsive Design */
@media (max-width: 380px) {
  header {
    height: 80px;
    padding: 10px;
    flex-wrap: wrap;
  }

  .brand-logo svg {
    height: 35px;
  }

  nav {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
  }

  nav a {
    font-size: 0.9rem;
  }

  .icon-btn {
    width: 35px;
    height: 35px;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .calculator-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .calculator-card {
    padding: 20px;
  }

  .card-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-description {
    font-size: 0.85rem;
  }

  .quick-nav {
    padding: 15px;
  }

  .quick-nav h2 {
    font-size: 1.2rem;
  }

  .quick-nav-btn {
    font-size: 0.85rem;
    padding: 8px 15px;
  }

  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }
}

@media (min-width: 381px) and (max-width: 600px) {
  .calculator-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .page-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.7rem;
  }
  nav a {
      font-size: 1.4rem;
  }
}

@media (min-width: 601px) and (max-width: 768px) {
  .calculator-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .page-title {
    font-size: 2.2rem;
  }

  .section-title {
    font-size: 1.8rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .calculator-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
  }
}

@media (min-width: 1025px) {
  .container {
    padding: 30px 40px 60px;
  }

  .calculator-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
  }
}
