/* =============================
   CSS RESET & NORMALIZING
   ============================= */
html {
  box-sizing: border-box;
  font-size: 16px;
}
*, *:before, *:after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Roboto', Arial, sans-serif;
  color: #3D2C17;
  background: #F5F7FB;
  min-height: 100vh;
  line-height: 1.6;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
  border: none;
}

/* =============================
   VINTAGE RETRO PALETTE & FONTS
   ============================= */
:root {
  --retro-primary: #3D2C17;     /* Deep coffee brown (main heading/text) */
  --retro-secondary: #FFBD59;   /* Buttery retro yellow (accent) */
  --retro-accent: #61988E;      /* Muted teal (buttons, highlights) */
  --retro-bg: #FBF6EC;          /* Warm paper-like background */
  --retro-card: #FFF6DA;        /* Card background */
  --retro-border: #BCA075;      /* Soft brown border */
  --retro-red: #D1593C;         /* Vintage burnt red */
  --retro-blue: #3795A6;        /* Muted blue for links/buttons */
  --primary: #111927;
  --brand-accent: #00B7D3;
  --retro-light: #FFFDF8;
}

@font-face {
  font-family: 'Bebas Neue';
  src: local('Bebas Neue'), url('https://fonts.gstatic.com/s/bebasneue/v1/E5TvT_4Sw0P2SgjiKOjI.woff2') format('woff2');
  font-display: swap;
  font-weight: 400;
}

body {
  background: var(--retro-bg);
  color: var(--retro-primary);
  font-family: 'Roboto', Arial, sans-serif;
  letter-spacing: 0.02em;
}
h1, h2, h3, .logo {
  font-family: 'Bebas Neue', 'Montserrat', Arial, sans-serif;
  letter-spacing: 0.04em;
}
h1 {
  font-size: 2.8rem;
  color: var(--retro-secondary);
  margin-bottom: 18px;
  text-shadow: 1px 2px 0 #BCA07530;
}
h2 {
  font-size: 2rem;
  color: var(--retro-primary);
  margin-bottom: 18px;
  border-bottom: 2px dashed var(--retro-border);
  display: inline-block;
  padding-bottom: 4px;
}
h3 {
  font-size: 1.2rem;
  color: var(--retro-red);
  margin-bottom: 10px;
  font-weight: 700;
}
p, ul, li, a, span {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 1rem;
  color: var(--retro-primary);
}
strong {
  font-weight: 700;
  color: var(--retro-primary);
}
ul {
  margin-left: 18px;
  margin-bottom: 24px;
}
li {
  margin-bottom: 8px;
}

/* =============================
   PATTERNS & BACKGROUND TEXTURE
   ============================= */
body:before {
  content: '';
  position: fixed;
  z-index: 0;
  left: 0; top: 0; right: 0; bottom: 0;
  /* Subtle old paper noise pattern overlay */
  pointer-events: none;
  background: url('https://www.transparenttextures.com/patterns/old-mathematics.png');
  opacity: 0.07;
}

section, .section {
  margin-bottom: 60px;
  padding: 40px 20px;
  position: relative;
  background: none;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
  z-index: 1;
  width: 100%;
  position: relative;
}

.content-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.text-section {
  margin-bottom: 28px;
  background: var(--retro-card);
  padding: 22px 22px 14px 22px;
  border: 1.5px solid var(--retro-border);
  border-radius: 16px;
  box-shadow: 1px 4px 20px #BCA07511, 0 2px 0 #fff2cf;
  font-size: 1rem;
  position: relative;
}
.text-section:after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0; height: 5px;
  background: repeating-linear-gradient(135deg, var(--retro-secondary), var(--retro-secondary) 2px, transparent 2px, transparent 6px);
  border-radius: 14px 14px 0 0;
  opacity: 0.22;
  pointer-events: none;
}

.subheadline {
  font-size: 1.25rem;
  color: var(--retro-blue);
  font-family: 'Montserrat', Arial, sans-serif;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
  opacity: .92;
}

/* =============================
   HEADER & NAVIGATION
   ============================= */
header {
  background: var(--retro-light);
  border-bottom: 3px double var(--retro-border);
  box-shadow: 0 2px 10px #bca07513;
  position: relative;
  z-index: 10;
}
.logo {
  display: flex;
  align-items: center;
  height: 60px;
  margin-right: 26px;
}
.logo img {
  height: 54px;
  width: auto;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px 16px;
  gap: 20px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  z-index: 2;
  flex: 1 1 auto;
}
.main-nav a {
  text-decoration: none;
  color: var(--retro-primary);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.08rem;
  position: relative;
  padding: 5px 9px;
  border-radius: 8px;
  transition: color 0.22s, background 0.22s;
}
.main-nav a:after {
  content: '';
  display: block;
  margin: 0 auto 0 auto;
  width: 0;
  height: 2px;
  background: var(--retro-secondary);
  transition: width .2s;
}
.main-nav a:hover, .main-nav a:focus {
  background: var(--retro-card);
  color: var(--retro-red);
}
.main-nav a:hover:after, .main-nav a:focus:after {
  width: 80%;
}

.cta-btn {
  background: var(--retro-secondary);
  color: #3D2C17;
  font-family: 'Bebas Neue', 'Montserrat', Arial, sans-serif;
  font-weight: 600;
  padding: 8px 22px;
  border: none;
  border-radius: 22px;
  font-size: 1.08rem;
  box-shadow: 0 2px 7px #bca07535;
  transition: background .24s, color .18s, box-shadow 0.21s;
  margin-left: 15px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.07em;
  outline: none;
}
.cta-btn:hover, .cta-btn:focus {
  background: var(--retro-red);
  color: #fff;
  box-shadow: 0 4px 14px #d1593c20;
}

.cta-link {
  color: var(--retro-red);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.2s;
}
.cta-link:hover, .cta-link:focus {
  color: var(--retro-blue);
  text-decoration: none;
}

/* =============================
   MOBILE NAVIGATION MENU
   ============================= */
.mobile-menu-toggle {
  display: none;
  font-size: 2.5rem;
  background: none;
  color: var(--retro-red);
  border: none;
  cursor: pointer;
  margin-left: 10px;
  z-index: 200;
  transition: color 0.2s;
  border-radius: 8px;
  padding: 4px 14px;
}
.mobile-menu-toggle:focus {
  background: var(--retro-card);
  outline: 2px dashed var(--retro-red);
}

.mobile-menu {
  position: fixed;
  z-index: 3000;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(125deg, #FFF6DA 80%, #ffbd593d 100%);
  box-shadow: 0 5px 24px #3d2c1730;
  transform: translateX(-100vw);
  transition: transform 0.32s cubic-bezier(.89, -0.08, .44, 1.09);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 60px;
}
.mobile-menu.open {
  transform: translateX(0);
}
.mobile-menu-close {
  position: absolute;
  top: 20px; right: 22px;
  background: var(--retro-red);
  color: #fff;
  font-size: 2rem;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 2px 10px #d1593c25;
  transition: background 0.22s;
}
.mobile-menu-close:hover, .mobile-menu-close:focus {
  background: var(--retro-primary);
}
.mobile-nav {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: 10px 38px;
  margin-top: 16px;
}
.mobile-nav a {
  font-size: 1.2rem;
  color: var(--retro-primary);
  background: none;
  border-radius: 10px;
  padding: 8px 10px;
  text-decoration: none;
  margin-bottom: 4px;
  font-family: 'Montserrat', Arial, sans-serif;
  width: 100%;
  transition: background 0.18s, color 0.18s;
}
.mobile-nav a:hover, .mobile-nav a:focus {
  background: var(--retro-border);
  color: var(--retro-blue);
}

@media (max-width: 1080px) {
  .main-nav a {
    font-size: 1rem;
  }
}

@media (max-width: 900px) {
  .main-nav {
    gap: 12px;
    font-size: .96rem;
  }
}

@media (max-width: 820px) {
  header .container {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .main-nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: block;
  }
}

@media (min-width: 821px) {
  .mobile-menu {
    display: none !important;
  }
}

/* =============================
   FLEX LAYOUTS & CRITICAL SPACING
   ============================= */
.card-container,
.content-grid, .feature-grid, .feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: stretch;
}
.content-grid {
  gap: 20px;
}
.card {
  margin-bottom: 20px;
  position: relative;
  flex: 1 1 280px;
  background: var(--retro-card);
  border: 1.2px solid var(--retro-border);
  border-radius: 13px;
  box-shadow: 0 4px 14px #bca07510;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.16s, transform 0.2s;
}
.card:hover, .card:focus {
  box-shadow: 0 7px 30px #bca07525;
  transform: translateY(-4px) scale(1.018);
}

.section {
  margin-bottom: 60px;
  padding: 40px 20px;
}
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.card {
  margin-bottom: 20px;
  position: relative;
}
.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.testimonial-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 12px #bca07519;
  margin-bottom: 24px;
  border-left: 7px solid var(--retro-secondary);
  font-size: 1.08rem;
  transition: transform 0.18s, box-shadow 0.17s;
}
.testimonial-card strong {
  font-size: 1.01em;
  color: var(--retro-blue);
  font-style: italic;
}
.testimonial-card:hover {  
  box-shadow: 0 8px 22px #00b7d31a;
  transform: scale(1.022) rotate(-1deg);
}

.feature, .feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  background: var(--retro-card);
  border: 1.2px solid var(--retro-border);
  border-radius: 11px;
  padding: 19px 14px 14px 14px;
  max-width: 320px;
  box-shadow: 0 3px 8px #bca0750f;
  transition: box-shadow 0.15s, background 0.13s;
}
.feature:hover, .feature:focus {
  background: #fff9e2;
  box-shadow: 0 8px 24px #bca0752c;
}
.feature img {
  width: 62px;
  height: 62px;
  background: var(--retro-secondary);
  border-radius: 10px;
  box-shadow: 0 2px 7px #d1593c10;
  margin-bottom: 9px;
  padding: 7px;
}

.cta {
  background: linear-gradient(92deg, #FFF6DA 80%, #ffbd5911 100%);
  border-radius: 17px;
  border: 1.8px dashed var(--retro-border);
  box-shadow: 0 3px 26px #bca07510;
  margin-bottom: 50px;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Newsletter & About preview sections */
.newsletter, .about-preview, .contact-cta {
  background: var(--retro-card);
  border: 1.2px solid var(--retro-border);
  border-radius: 15px;
  box-shadow: 0 2px 14px #bca07513;
  margin-bottom: 40px;
  padding: 28px 22px;
}

/* =============================
   BUTTONS & LINK MICROINTERACTIONS
   ============================= */
button, .cta-btn {
  cursor: pointer;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  outline: none;
  letter-spacing: 0.04em;
  border: none;
  transition: background 0.18s, color 0.17s, box-shadow 0.19s, transform 0.13s;
}
button:active, .cta-btn:active {
  transform: scale(0.99);
}
a {
  color: var(--retro-blue);
  text-decoration: underline;
  transition: color 0.17s;
}
a:hover, a:focus {
  color: var(--retro-red);
  text-decoration: none;
}

/* =============================
   FOOTER
   ============================= */
footer {
  background: var(--retro-primary);
  color: #FFF6DA;
  padding: 38px 0 12px 0;
  border-top: 5px double var(--retro-border);
  margin-top: 60px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1rem;
  text-align: center;
  position: relative;
  z-index: 2;
}
footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: center;
  justify-content: center;
}
.footer-logo {
  margin-right: 25px;
}
.footer-logo img {
  height: 38px;
  display: block;
}
.footer-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin: 0 25px;
}
.footer-nav a {
  color: var(--retro-secondary);
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.18s;
}
.footer-nav a:hover {
  color: var(--retro-blue);
}
.footer-info {
  font-size: 0.92rem;
  margin-top: 10px;
}

/* =============================
   COOKIE CONSENT BANNER & MODAL
   ============================= */
.cookie-banner {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  background: var(--retro-secondary);
  color: var(--retro-primary);
  padding: 20px 10px 20px 20px;
  z-index: 9980;
  box-shadow: 0 -3px 18px #bca07540;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 1.04rem;
  animation: cookie-slidein 0.8s cubic-bezier(.77,-0.05,.54,1.17);
}
@keyframes cookie-slidein {
  0% { transform: translateY(100%); opacity:0; }
  70% { opacity:0.6; }
  100% { transform: translateY(0); opacity:1; }
}
.cookie-banner .cookie-btn {
  font-size: 1rem;
  border-radius: 18px;
  margin-left: 10px;
  padding: 7px 18px;
  border: 1.5px solid var(--retro-border);
  background: #fff8e5;
  color: var(--retro-primary);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  box-shadow: 1px 2px 10px #bca07518;
  transition: box-shadow 0.18s, background 0.14s, color 0.15s;
}
.cookie-banner .cookie-btn:hover, .cookie-banner .cookie-btn:focus {
  background: var(--retro-red);
  color: #fff;
  box-shadow: 0 4px 14px #d1593c20;
}
.cookie-banner .cookie-settings-btn {
  background: var(--retro-card);
  border-color: var(--retro-blue);
  color: var(--retro-blue);
}
.cookie-banner .cookie-settings-btn:hover {
  background: var(--retro-blue);
  color: #fff;
  border-color: var(--retro-blue);
}

/* MODAL POPUP */
.cookie-modal {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%,-50%) scale(1);
  background: #fff6da;
  border: 2px dashed var(--retro-border);
  border-radius: 18px;
  box-shadow: 0 10px 40px #BCA07550;
  padding: 38px 32px 28px 32px;
  min-width: 340px;
  z-index: 10000;
  animation: cookie-modal-in 0.24s;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@keyframes cookie-modal-in {
  0% { opacity:0; transform: translate(-50%,-50%) scale(0.93); }
  100% { opacity:1; transform: translate(-50%,-50%) scale(1); }
}
.cookie-modal h3 {
  font-family: 'Montserrat', Arial, sans-serif;
  color: var(--retro-red);
  font-size: 1.25rem;
  border-bottom: 1.2px dashed var(--retro-border);
  padding-bottom: 4px;
  margin-bottom: 10px;
}
.cookie-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cookie-category label {
  font-size: 1rem;
  font-family: 'Roboto', Arial, sans-serif;
  color: var(--retro-primary);
}
.cookie-toggle {
  appearance: none;
  width: 38px; height: 20px;
  border-radius: 10px;
  background: var(--retro-border);
  position: relative;
  outline: none;
  border: none;
  transition: background 0.19s;
  cursor: pointer;
  vertical-align: middle;
}
.cookie-toggle:checked {
  background: var(--retro-blue);
}
.cookie-toggle::before {
  content: '';
  display: block;
  position: absolute;
  left: 3px; top: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #aaa;
  transition: left 0.17s;
}
.cookie-toggle:checked::before {
  left: 21px;
}
.cookie-modal .close-modal {
  position: absolute;
  top: 14px; right: 20px;
  background: var(--retro-red);
  color: #fff;
  width: 32px; height: 32px;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 6px #bca07523;
  transition: background 0.15s;
}
.cookie-modal .close-modal:hover {
  background: var(--retro-primary);
}

.cookie-modal-actions {
  display: flex;
  gap: 13px;
  margin-top: 8px;
  justify-content: flex-end;
}

/* Overlay for modal */
.cookie-modal-overlay {
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; right: 0; bottom: 0;
  background: #11192777;
  animation: cookie-overlay-in 0.35s;
}
@keyframes cookie-overlay-in {
  0% { opacity: 0; }
  100% { opacity: 0.88; }
}

/* =============================
   RESPONSIVE RULES
   ============================= */
@media (max-width: 1050px) {
  .container {
    max-width: 92vw;
  }
  .card, .feature {
    max-width: 100%;
    flex-basis: 360px;
  }
}
@media (max-width: 900px) {
  .content-wrapper, .feature-grid, .content-grid, .feature-list {
    gap: 14px;
  }
  .feature {
    padding: 14px 10px;
  }
}
@media (max-width: 768px) {
  .container {
    padding: 0 8px;
  }
  .content-wrapper {
    gap: 10px;
  }
  .main-nav {
    display: none;
  }
  .mobile-menu {
    padding-top: 0;
  }
  .section, section {
    padding: 25px 7px;
    margin-bottom: 32px;
  }
  .newsletter, .about-preview, .contact-cta {
    padding: 13px 6px;
    margin-bottom: 28px;
  }
  .footer-nav {
    gap: 13px;
    margin: 0 5px;
  }
  .footer-logo {
    margin-right: 3px;
  }
  .content-grid, .feature-grid, .feature-list {
    flex-direction: column;
    gap: 13px;
    align-items: stretch;
  }
  .card {
    min-width: 0;
    max-width: 100%;
  }
  .text-image-section {
    flex-direction: column;
    gap: 18px;
    align-items: stretch;
  }
}
@media (max-width: 520px) {
  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.35rem;
  }
  footer {
    font-size: .95rem;
    padding: 25px 0 6px 0;
  }
  .cookie-modal {
    min-width: 94vw !important;
    padding: 19px 7vw 16px 7vw;
    left: 5vw; right: 5vw;
    font-size: 1rem;
  }
}

/* =============================
   MISCELLANEOUS
   ============================= */
::-webkit-scrollbar {
  width: 8px;
  background: var(--retro-light);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb {
  background: var(--retro-secondary);
  border-radius: 6px;
}

::selection {
  background: var(--retro-secondary);
  color: var(--retro-primary);
}

input, textarea, select {
  font-family: 'Roboto', Arial, sans-serif;
  border: 1.2px solid var(--retro-border);
  border-radius: 7px;
  background: #fff9e5;
  font-size: 1rem;
  padding: 8px 12px;
  margin-bottom: 16px;
  color: var(--retro-primary);
  transition: border 0.14s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--retro-blue);
  outline: none;
}

hr {
  border: none;
  border-bottom: 1.3px dashed var(--retro-border);
  margin: 22px 0;
}

/* =============================
   ANIMATIONS
   ============================= */
@keyframes fade-in {
  0% {opacity:0;transform: translateY(12px);}
  100% {opacity:1;transform: none;}
}
.hero, .cta, .testimonial-card, .feature, .section, .newsletter, .about-preview {
  animation: fade-in 0.66s cubic-bezier(0.63,0,.29,1.11) both;
}

/* =============================
   ACCESSIBILITY IMPROVEMENT
   ============================= */
:focus {
  outline: 1.5px dotted var(--retro-blue);
  outline-offset: 2px;
}

/* =============================
   END OF MAIN STYLESHEET
   ============================= */
