/* ============================================
   The Twisted Tensor — Global Stylesheet
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --color-bg: #FAF7F2;
  --color-bg-alt: #F3EDE4;
  --color-text: #2C2520;
  --color-copper: #B5713A;
  --color-rose-gold: #C9947A;
  --color-white: #FFFFFF;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Lato', 'Segoe UI', sans-serif;
  --max-text-width: 680px;
  --section-padding: 100px 24px;
  --line-height: 1.7;
  --transition: 0.3s ease;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

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

section,
.container,
.section,
.hero,
.hero__content,
.text-block,
.two-col,
.feature-grid,
.product-grid,
.instrument-panels,
.instrument-tabs {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

a {
  color: var(--color-copper);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-rose-gold);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.25;
  font-feature-settings: "lnum" 1;
  font-style: normal;
}

.straight-hyphen {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 300;
  display: inline-block;
  transform: scaleY(0.8);
  margin: 0;
  padding: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: 0.5em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 0.6em;
}

h3 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin-bottom: 0.5em;
}

h4 {
  font-size: 1.3rem;
  margin-bottom: 0.4em;
}

p {
  margin-bottom: 1.2em;
  max-width: min(var(--max-text-width), 100%);
}

ul, ol {
  margin-bottom: 1.2em;
  padding-left: 1.5em;
  max-width: min(var(--max-text-width), 100%);
}

li {
  margin-bottom: 0.5em;
}

blockquote {
  border-left: 3px solid var(--color-copper);
  padding-left: 1.5em;
  margin: 1.5em 0;
  font-style: italic;
  max-width: min(var(--max-text-width), 100%);
}

/* --- Layout --- */
.container {
  max-width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-padding);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.text-block {
  max-width: min(var(--max-text-width), 100%);
}

.text-center {
  text-align: center;
}

.text-center p,
.text-center .text-block {
  margin-left: auto;
  margin-right: auto;
}

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--color-bg);
  border-bottom: 1px solid rgba(181, 113, 58, 0.15);
  padding: 16px 24px;
  overflow-x: hidden;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo img {
  width: 200px;
  height: auto;
  filter: brightness(0.82) contrast(1.15) saturate(1.05);
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  margin: 5px 0;
  transition: var(--transition);
}

.main-nav > ul {
  display: flex;
  list-style: none;
  gap: 24px;
  padding: 0;
  margin: 0;
  align-items: center;
}

.main-nav a {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Hide mobile-only elements on desktop */
.nav-close {
  display: none;
}

.nav-overlay {
  display: none;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-copper);
}

/* Nav Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > a::after {
  content: ' \25BE';
  font-size: 0.65em;
  opacity: 0.6;
  margin-left: 2px;
  vertical-align: middle;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-cream);
  border: 1px solid rgba(139, 90, 43, 0.15);
  border-radius: 6px;
  padding: 0.5rem 0;
  padding-top: 0.75rem;
  margin-top: 0;
  list-style: none;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -10px;
  width: calc(100% + 20px);
  height: 25px;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  padding: 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1.2rem;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

.dropdown-menu a:hover {
  color: var(--color-copper);
  background: rgba(139, 90, 43, 0.05);
}

/* Mobile Nav */
@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background-color: var(--color-bg);
    padding: 80px 32px 32px;
    transition: right var(--transition);
    box-shadow: -2px 0 12px rgba(0,0,0,0.08);
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav.open {
    right: 0;
  }

  .main-nav > ul {
    flex-direction: column;
    gap: 20px;
    padding-bottom: 40px;
  }

  .main-nav a {
    font-size: 18px;
  }

  .nav-close {
    display: block;
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--color-text);
  }

  .nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 998;
  }

  .nav-overlay.active {
    display: block;
  }

  /* Mobile dropdown: show inline */
  .dropdown-menu {
    display: block;
    position: static;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.25rem 0 0 1rem;
    margin-top: 0.25rem;
    min-width: auto;
  }

  .dropdown-menu a {
    padding: 0.3rem 0;
    font-size: 16px;
  }

  /* Hide hover bridge on mobile */
  .nav-dropdown::after {
    display: none;
  }

  /* Remove chevron on mobile since dropdown is always visible */
  .nav-dropdown > a::after {
    display: none;
  }
}

/* --- Hero Sections --- */
.hero {
  position: relative;
  padding: 120px 24px;
  text-align: center;
  overflow: hidden;
}

.hero--image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero--image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(250, 247, 242, 0.6) 0%,
    rgba(250, 247, 242, 0.75) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: min(800px, 100%);
  margin: 0 auto;
  padding: 0 16px;
}

.hero__eyebrow {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-copper);
  margin-bottom: 16px;
}

.hero__headline {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  margin-bottom: 0.4em;
}

.hero__subheadline {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.7;
  max-width: min(640px, 100%);
  margin: 0 auto 1.5em;
  color: var(--color-text);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 14px 32px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
}

.btn--primary {
  background-color: var(--color-copper);
  color: var(--color-white);
}

.btn--primary:hover {
  background-color: #9A5F30;
  color: var(--color-white);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-copper);
  border: 1.5px solid var(--color-copper);
}

.btn--secondary:hover {
  background-color: var(--color-copper);
  color: var(--color-white);
}

/* --- Cards --- */
.card {
  background-color: var(--color-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(44, 37, 32, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44, 37, 32, 0.1);
}

.card__image {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.card__body {
  padding: 20px 24px;
}

.card__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.3em;
}

.card__price {
  color: var(--color-copper);
  font-weight: 700;
  margin-bottom: 0.5em;
}

.card__desc {
  font-size: 0.95rem;
  color: #5a4e47;
  margin-bottom: 0;
}

/* --- Testimonials --- */
.testimonial {
  border-left: 3px solid var(--color-copper);
  padding-left: 24px;
  margin-bottom: 40px;
  max-width: var(--max-text-width);
}

.testimonial__quote {
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 12px;
}

.testimonial__name {
  font-weight: 700;
  font-size: 0.95rem;
}

.testimonial__role {
  font-size: 0.85rem;
  color: #7a6e66;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: min(480px, 100%);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  border: 1px solid rgba(181, 113, 58, 0.3);
  border-radius: 4px;
  background-color: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-copper);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

/* --- Feature Grid --- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.feature-item h3 {
  font-size: 1.3rem;
  margin-bottom: 0.4em;
}

.feature-item p {
  font-size: 0.98rem;
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

/* --- FAQ Accordion --- */
.faq-section {
  margin-bottom: 48px;
}

.faq-section h3 {
  margin-bottom: 20px;
  color: var(--color-copper);
}

.faq-item {
  border-bottom: 1px solid rgba(181, 113, 58, 0.15);
  padding: 20px 0;
}

.faq-question {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--color-copper);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item.open .faq-question::after {
  content: '−';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding-top: 0;
}

.faq-item.open .faq-answer {
  max-height: 600px;
  padding-top: 16px;
}

.faq-answer p {
  font-size: 1rem;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 60px 24px 40px;
  border-top: 1px solid rgba(181, 113, 58, 0.15);
}

.footer-ring {
  margin: 0 auto 24px;
  width: 48px;
  height: 48px;
  position: relative;
}

.footer-ring svg {
  width: 48px;
  height: 48px;
}

.footer-ring__glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  animation: ring-pulse 3.5s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(181, 113, 58, 0);
  }
  50% {
    box-shadow: 0 0 18px 8px rgba(181, 113, 58, 0.2);
  }
}

.footer-text {
  font-size: 0.9rem;
  color: #7a6e66;
}

.footer-text a {
  color: var(--color-copper);
}

/* --- Image Placeholders --- */
.image-placeholder {
  background-color: var(--color-bg-alt);
  border: 1px dashed rgba(181, 113, 58, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  color: var(--color-copper);
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: 8px;
}

/* --- Utility --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mt-1 { margin-top: 16px; }
.mt-2 { margin-top: 32px; }
.mt-3 { margin-top: 48px; }
.mb-1 { margin-bottom: 16px; }
.mb-2 { margin-bottom: 32px; }
.mb-3 { margin-bottom: 48px; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .section {
    padding: 60px 20px;
  }

  .hero {
    padding: 80px 20px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 17px;
  }

  .hero {
    padding: 60px 16px;
  }

  .hero__headline {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  h2 {
    font-size: clamp(1.5rem, 6vw, 1.8rem);
  }

  .btn {
    padding: 12px 24px;
    font-size: 16px;
    max-width: 100%;
  }

  .container {
    padding: 0 16px;
  }

  .section {
    padding: 48px 16px;
  }

  .instrument-tabs {
    flex-direction: column;
    width: 100%;
  }

  .instrument-tab {
    padding: 10px 20px;
    font-size: 0.95rem;
  }

  .instrument-tab:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid rgba(181, 113, 58, 0.3);
  }

  .rss-card {
    padding: 20px 16px;
  }

  .two-col {
    gap: 24px;
  }

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

  .turnaround-notice {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .site-logo img {
    width: 160px;
  }
}

/* --- RSS Feed Cards --- */
.rss-card {
  background-color: var(--color-white);
  border-radius: 8px;
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(44, 37, 32, 0.06);
  max-width: min(var(--max-text-width), 100%);
}

.rss-card__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.rss-card__title a {
  color: var(--color-text);
}

.rss-card__title a:hover {
  color: var(--color-copper);
}

.rss-card__date {
  font-size: 0.85rem;
  color: #7a6e66;
  margin-bottom: 12px;
}

.rss-card__excerpt {
  font-size: 0.98rem;
  line-height: 1.6;
}

/* --- Two-column layout --- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.two-col--reverse {
  direction: rtl;
}

.two-col--reverse > * {
  direction: ltr;
}

@media (max-width: 768px) {
  .two-col,
  .two-col--reverse {
    grid-template-columns: 1fr;
    gap: 32px;
    direction: ltr;
  }
}

/* --- Consultation section scroll offset --- */
#consultations {
  scroll-margin-top: 160px;
}

/* --- Consultation aside --- */
.consultation-aside {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: #6B5B4F;
  font-style: italic;
}

.consultation-link {
  color: var(--color-copper);
  font-style: normal;
  font-weight: 400;
  text-decoration: none;
  border-bottom: 1px solid rgba(181, 113, 58, 0.3);
  transition: border-color var(--transition), color var(--transition);
}

.consultation-link:hover {
  color: #8B5A2B;
  border-bottom-color: var(--color-copper);
}

/* --- Turnaround notice --- */
.turnaround-notice {
  background-color: var(--color-bg-alt);
  border: 1px solid rgba(181, 113, 58, 0.25);
  border-radius: 6px;
  padding: 16px 24px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-copper);
  text-align: center;
  margin-bottom: 28px;
  max-width: min(480px, 100%);
}

/* --- Credentials list --- */
.credentials-list {
  list-style: none;
  padding-left: 0;
}

.credentials-list li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 10px;
}

.credentials-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-copper);
}

/* --- Instrument Tab Toggle --- */
.instrument-tabs {
  display: inline-flex;
  gap: 0;
  margin-bottom: 32px;
  border: 1px solid rgba(181, 113, 58, 0.3);
  border-radius: 6px;
  overflow: hidden;
}

.instrument-tab {
  background: transparent;
  border: none;
  padding: 12px 28px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-copper);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}

.instrument-tab:not(:last-child) {
  border-right: 1px solid rgba(181, 113, 58, 0.3);
}

.instrument-tab.active {
  background-color: var(--color-copper);
  color: var(--color-white);
}

.instrument-tab:hover:not(.active) {
  background-color: rgba(181, 113, 58, 0.08);
}

.instrument-panels {
  max-width: min(960px, 100%);
  margin: 0 auto;
}

.instrument-panel {
  display: none;
}

.instrument-panel.active {
  display: block;
}
