/* =========================================
   FENCE CALCULATOR
   Main Stylesheet
========================================= */


/* =========================================
   RESET
========================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;

  background: #ffffff;
  color: #17211b;
  line-height: 1.6;
}


/* =========================================
   GENERAL
========================================= */

.container {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}


/* =========================================
   HEADER
========================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;

  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid #e4e9e5;

  backdrop-filter: blur(10px);
}

.header-inner {
  min-height: 96px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 30px;
}

.logo {
  color: #176b3a;

  font-size: 28px;
  font-weight: 800;

  text-decoration: none;
  letter-spacing: -0.5px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 38px;
}

.main-nav a {
  color: #4b554f;

  font-size: 18px;
  font-weight: 600;

  text-decoration: none;

  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.main-nav a:hover {
  color: #176b3a;
  transform: translateY(-1px);
}


/* =========================================
   HERO
========================================= */

.hero {
  padding: 70px 0 45px;
}

.hero h1 {
  max-width: 1000px;

  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.08;

  letter-spacing: -2px;

  color: #111a14;

  margin-bottom: 22px;
}

.hero p {
  max-width: 850px;

  font-size: 21px;
  line-height: 1.7;

  color: #61706a;
}


/* =========================================
   CALCULATOR SECTION
========================================= */

.calculator-section {
  padding: 25px 0 90px;
}

.calculator-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 38px;

  align-items: start;
}


/* =========================================
   CALCULATOR CARD
========================================= */

.calculator-card,
.result-card {
  background: #ffffff;

  border: 1px solid #dfe6e1;

  border-radius: 22px;

  padding: 42px;

  box-shadow:
    0 15px 45px rgba(22, 44, 31, 0.055);
}

.calculator-card h2,
.result-card h2 {
  color: #152019;

  font-size: 30px;
  line-height: 1.2;

  margin-bottom: 30px;

  letter-spacing: -0.7px;
}


/* =========================================
   FORM
========================================= */

.form-group {
  margin-bottom: 27px;
}

.form-group label {
  display: block;

  margin-bottom: 10px;

  color: #101812;

  font-size: 18px;
  font-weight: 700;
}

.input-row {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    165px;

  gap: 14px;
}

.input-with-unit {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    165px;

  gap: 14px;
}

.input-with-unit span {
  min-height: 66px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 18px;

  background: #f5f8f6;

  border: 1px solid #dce4de;

  border-radius: 13px;

  color: #52635a;

  font-size: 18px;
}


/* =========================================
   INPUTS
========================================= */

input,
select {
  width: 100%;

  min-height: 66px;

  padding: 0 18px;

  border: 1px solid #d3ddd6;
  border-radius: 13px;

  background: #ffffff;

  color: #18221c;

  font-size: 18px;

  outline: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

input:focus,
select:focus {
  border-color: #1b7040;

  box-shadow:
    0 0 0 4px rgba(27, 112, 64, 0.09);
}

select {
  cursor: pointer;
}


/* =========================================
   BUTTONS
========================================= */

.calculate-button {
  width: 100%;

  min-height: 62px;

  border: none;
  border-radius: 13px;

  background: #176b3a;
  color: #ffffff;

  font-size: 19px;
  font-weight: 800;

  cursor: pointer;

  margin-top: 7px;

  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.calculate-button:hover {
  background: #125a30;

  transform: translateY(-1px);

  box-shadow:
    0 8px 22px rgba(23, 107, 58, 0.2);
}

.calculate-button:active {
  transform: translateY(0);
}

.reset-button {
  width: 100%;

  min-height: 52px;

  margin-top: 12px;

  border: 1px solid #d7e0da;
  border-radius: 12px;

  background: #ffffff;
  color: #4d5c53;

  font-size: 16px;
  font-weight: 700;

  cursor: pointer;

  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.reset-button:hover {
  background: #f5f8f6;
  border-color: #bfcfc4;
}


/* =========================================
   RESULTS
========================================= */

.result-card {
  position: sticky;
  top: 125px;
}

.result-label {
  margin-bottom: 9px;

  color: #176b3a;

  font-size: 16px;
  font-weight: 900;

  letter-spacing: 2px;
}

.result-card h2 {
  font-size: 38px;
  margin-bottom: 38px;
}


/* =========================================
   RESULT GRID
========================================= */

.results-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 18px;
}

.result-box {
  min-height: 132px;

  padding: 25px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  background: #ffffff;

  border: 1px solid #dfe7e1;

  border-radius: 17px;
}

.result-box span {
  color: #66766d;

  font-size: 17px;
}

.result-box strong {
  margin-top: 10px;

  color: #176b3a;

  font-size: 35px;
  line-height: 1;

  font-weight: 800;
}


/* =========================================
   IMPORTANT NOTE
========================================= */

.estimate-note {
  margin-top: 24px;

  padding: 24px;

  border-radius: 17px;

  background: #dcf8e6;

  color: #24533a;
}

.estimate-note strong {
  display: block;

  margin-bottom: 8px;

  color: #176b3a;

  font-size: 18px;
}

.estimate-note p {
  font-size: 16px;
  line-height: 1.75;
}


/* =========================================
   CONTENT SECTIONS
========================================= */

.content-section {
  padding: 90px 0;
}

.alternate-section {
  background: #f7faf8;
}

.content-section h2 {
  margin-bottom: 24px;

  color: #142019;

  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.15;

  letter-spacing: -1px;
}

.content-section > .container > p {
  max-width: 900px;

  margin-bottom: 22px;

  color: #53635a;

  font-size: 18px;
  line-height: 1.8;
}

.content-section h3 {
  margin-top: 38px;
  margin-bottom: 12px;

  color: #18231c;

  font-size: 25px;
}

.content-section h3:first-of-type {
  margin-top: 34px;
}


/* =========================================
   FORMULA CARDS
========================================= */

.formula-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 22px;

  margin-top: 38px;
}

.info-card {
  padding: 30px;

  border: 1px solid #dfe7e1;
  border-radius: 18px;

  background: #ffffff;

  box-shadow:
    0 10px 30px rgba(20, 45, 29, 0.04);
}

.info-card h3 {
  margin: 0 0 12px;

  font-size: 23px;
}

.info-card p {
  margin-bottom: 18px;

  color: #586860;

  font-size: 16px;
  line-height: 1.7;
}

.info-card code {
  display: block;

  padding: 14px 16px;

  overflow-x: auto;

  border-radius: 10px;

  background: #f2f6f3;

  color: #176b3a;

  font-family:
    Consolas,
    Monaco,
    monospace;

  font-size: 14px;
}


/* =========================================
   FAQ
========================================= */

.faq-list {
  max-width: 950px;

  margin-top: 35px;
}

.faq-list details {
  padding: 22px 0;

  border-bottom: 1px solid #dce4df;
}

.faq-list summary {
  color: #17221b;

  font-size: 19px;
  font-weight: 750;

  cursor: pointer;

  list-style-position: outside;
}

.faq-list p {
  max-width: 850px;

  padding-top: 15px;

  color: #5c6b62;

  font-size: 17px;
  line-height: 1.75;
}


/* =========================================
   FOOTER
========================================= */

.site-footer {
  padding: 45px 0;

  background: #f4f7f5;

  border-top: 1px solid #e0e7e2;

  text-align: center;
}

.site-footer nav {
  display: flex;

  align-items: center;
  justify-content: center;

  flex-wrap: wrap;

  gap: 24px;

  margin-bottom: 16px;
}

.site-footer nav a {
  color: #4f5e55;

  font-size: 16px;
  font-weight: 650;

  text-decoration: none;
}

.site-footer nav a:hover {
  color: #176b3a;

  text-decoration: underline;
}

.site-footer p {
  color: #758078;

  font-size: 14px;
}


/* =========================================
   RESPONSIVE TABLET
========================================= */

@media (max-width: 1000px) {

  .container {
    width: min(100% - 36px, 900px);
  }

  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .result-card {
    position: static;
  }

  .hero {
    padding-top: 55px;
  }

  .formula-grid {
    grid-template-columns: 1fr;
  }

}


/* =========================================
   RESPONSIVE MOBILE
========================================= */

@media (max-width: 650px) {

  .container {
    width: min(100% - 28px, 560px);
  }

  .header-inner {
    min-height: auto;

    padding: 20px 0;

    flex-direction: column;

    align-items: flex-start;
  }

  .logo {
    font-size: 25px;
  }

  .main-nav {
    width: 100%;

    gap: 18px;

    overflow-x: auto;

    padding-bottom: 3px;
  }

  .main-nav a {
    flex-shrink: 0;

    font-size: 15px;
  }


  .hero {
    padding: 45px 0 30px;
  }

  .hero h1 {
    font-size: 40px;

    letter-spacing: -1.5px;
  }

  .hero p {
    font-size: 17px;
  }


  .calculator-section {
    padding-bottom: 60px;
  }

  .calculator-card,
  .result-card {
    padding: 24px;

    border-radius: 17px;
  }

  .calculator-card h2,
  .result-card h2 {
    font-size: 27px;
  }


  .input-row,
  .input-with-unit {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .input-with-unit span {
    min-height: 48px;
  }

  input,
  select {
    min-height: 58px;

    font-size: 16px;
  }


  .results-grid {
    grid-template-columns: 1fr;
  }

  .result-box {
    min-height: 115px;
  }

  .result-box strong {
    font-size: 31px;
  }


  .content-section {
    padding: 65px 0;
  }

  .content-section h2 {
    font-size: 32px;
  }

  .content-section h3 {
    font-size: 22px;
  }


  .formula-grid {
    grid-template-columns: 1fr;
  }


  .site-footer nav {
    gap: 15px;
  }

}


/* =========================================
   SMALL MOBILE
========================================= */

@media (max-width: 400px) {

  .container {
    width: min(100% - 22px, 370px);
  }

  .hero h1 {
    font-size: 34px;
  }

  .calculator-card,
  .result-card {
    padding: 19px;
  }

  .result-label {
    font-size: 13px;
    letter-spacing: 1.5px;
  }

}
