/* Track Day Diaries - shared V3 chrome */

:root {
  --bg: #f4f4f2;
  --surface: #ffffff;
  --text: #101010;
  --muted: #6a6a6a;
  --line: rgba(16, 16, 16, 0.1);
  --accent: #e93f3f;
  --accent-dark: #c52d2d;
  --premium: #b78a3c;
  --shadow: rgba(16, 16, 16, 0.08);
  --nav-height: 68px;
  --safe-area: env(safe-area-inset-bottom, 0px);
}

html {
  scroll-behavior: smooth;
}

body {
  padding-bottom: 0;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 3vw, 32px);
  background: rgba(244, 244, 242, 0.94);
  border-bottom: 2px solid var(--text);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-wordmark {
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3.5vw, 44px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav-links a {
  display: block;
  padding: 26px 0 24px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  opacity: 0.52;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.site-nav-links a:hover,
.site-nav-links a[aria-current="page"] {
  opacity: 1;
}

.site-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.site-nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
}

.site-footer {
  padding: 44px 20px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

details.mod-section {
  cursor: default;
}

details.mod-section > summary.mod-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  user-select: none;
}

details.mod-section > summary.mod-summary::-webkit-details-marker {
  display: none;
}

.mod-chevron {
  color: var(--muted);
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

details.mod-section[open] .mod-chevron {
  transform: rotate(180deg);
}

details.mod-section > .mod-list {
  margin-top: 20px;
}

.nav-script-note {
  display: none;
}

@media (max-width: 720px) {
  .site-nav {
    min-height: 60px;
    padding: 0 14px 0 18px;
  }

  .site-nav-toggle {
    display: flex;
  }

  .site-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: rgba(244, 244, 242, 0.98);
    border-bottom: 2px solid var(--text);
    box-shadow: 0 18px 40px rgba(16, 16, 16, 0.12);
  }

  .site-nav-links.open {
    display: flex;
  }

  .site-nav-links li {
    border-top: 1px solid var(--line);
  }

  .site-nav-links a {
    padding: 16px 20px;
    font-size: 13px;
  }
}

/* Direction A: Restraint+ visual refinement */
:root {
  --tdd-bg: #f4f4f2;
  --tdd-surface: #ffffff;
  --tdd-text: #101010;
  --tdd-muted: #68615b;
  --tdd-line: rgba(16, 16, 16, 0.12);
  --tdd-line-strong: #101010;
  --tdd-accent: #c52d2d;
  --tdd-accent-bright: #e93f3f;
  --tdd-premium: #b78a3c;
  --tdd-shadow: 0 18px 42px rgba(16, 16, 16, 0.1);
  --tdd-radius-sm: 8px;
  --tdd-radius-md: 14px;
  --tdd-radius-lg: 22px;
  --tdd-page: min(1180px, calc(100vw - 40px));
}

html {
  scroll-padding-top: 76px;
}

body {
  font-family: "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--tdd-bg);
  color: var(--tdd-text);
}

h1 {
  max-width: 16ch;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

h2 {
  letter-spacing: -0.02em;
}

.tdd-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 3vw, 32px);
  background: rgba(244, 244, 242, 0.94);
  border-bottom: 2px solid var(--tdd-line-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: min-height 180ms ease, background-color 180ms ease;
}

.tdd-header[data-scrolled="true"] {
  min-height: 52px;
  background: rgba(244, 244, 242, 0.98);
}

.tdd-brand,
.tdd-header > nav a,
.tdd-mnav nav a {
  color: var(--tdd-text);
  text-decoration: none;
  text-transform: uppercase;
}

.tdd-brand {
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.tdd-header > nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3.5vw, 44px);
}

.tdd-header > nav a,
.tdd-mnav nav a {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.16em;
  opacity: 0.52;
  transition: opacity 160ms ease;
}

.tdd-header > nav a:hover,
.tdd-header > nav a[aria-current="page"],
.tdd-mnav nav a:hover,
.tdd-mnav nav a[aria-current="page"] {
  opacity: 1;
}

.tdd-mnav {
  display: none;
  position: relative;
}

.tdd-mnav summary {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
}

.tdd-mnav summary::-webkit-details-marker {
  display: none;
}

.tdd-mnav summary span {
  display: block;
  width: 28px;
  height: 2px;
  margin-left: auto;
  background: var(--tdd-text);
}

.tdd-mnav nav {
  position: fixed;
  top: 62px;
  left: 0;
  right: 0;
  display: grid;
  background: rgba(244, 244, 242, 0.98);
  border-bottom: 2px solid var(--tdd-line-strong);
  box-shadow: 0 20px 42px rgba(16, 16, 16, 0.14);
}

.tdd-mnav nav a {
  padding: 17px 22px;
  border-top: 1px solid var(--tdd-line);
}

.tdd-page-wrap {
  width: var(--tdd-page);
  max-width: var(--tdd-page) !important;
  padding: 0 !important;
}

.tdd-hero,
.tdd-page-hero {
  padding-top: clamp(44px, 7vw, 86px);
  padding-bottom: clamp(28px, 4vw, 54px);
}

.tdd-hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(34px, 6vw, 76px);
}

.tdd-page-hero {
  max-width: 760px;
}

.tdd-hero h1 {
  max-width: 14.5ch;
  font-size: clamp(48px, 5.8vw, 72px);
  line-height: 0.98;
}

.tdd-eyebrow,
.tdd-meta,
.category-header .count,
.hero-label,
.stat-label,
.footnote {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tdd-muted);
}

.tdd-ctas,
.cta-row {
  gap: 14px;
}

.tdd-btn,
.button {
  border-radius: var(--tdd-radius-sm);
  font-weight: 800;
}

.tdd-btn--primary,
.button.primary {
  background: var(--tdd-accent);
  color: #fff;
}

.tdd-btn--dark,
.button.secondary {
  background: var(--tdd-text);
  color: #fff;
}

.tdd-hero-media,
.hero-media {
  border-radius: var(--tdd-radius-md);
  box-shadow: var(--tdd-shadow);
}

.tdd-rule {
  height: 2px;
  border: 0;
  background: var(--tdd-line-strong);
}

.tdd-section,
.section,
.category-section {
  scroll-margin-top: 88px;
}

.tdd-section-head,
.section-header,
.category-header {
  align-items: end;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--tdd-line);
}

.tdd-section-head h2,
.section-header h2,
.category-header h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  line-height: 1;
}

.tdd-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 34px clamp(20px, 3vw, 34px);
  border-top: 1px solid var(--tdd-line);
  color: var(--tdd-muted);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tdd-footer > span:only-child {
  margin: 0 auto;
}

details.tdd-build-item {
  padding: 0;
  border-radius: var(--tdd-radius-md);
  box-shadow: 0 10px 26px rgba(16, 16, 16, 0.08);
  overflow: hidden;
}

main.tdd-page-wrap:has(> details.tdd-build-item) {
  gap: 24px;
}

details.tdd-build-item > summary.mod-summary {
  min-height: 72px;
  align-items: center;
  padding: 14px 24px;
  background: var(--tdd-surface);
}

details.tdd-build-item > summary.mod-summary .section-header {
  flex: 1;
  align-items: flex-start;
  padding: 0;
  border: 0;
}

details.tdd-build-item .section-header h2 {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1;
  letter-spacing: 0.06em;
}

details.tdd-build-item .section-header span {
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.14em;
}

details.tdd-build-item .mod-chevron {
  display: none;
}

details.tdd-build-item > summary.mod-summary::after {
  content: "+";
  color: var(--tdd-muted);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  font-weight: 500;
  margin-left: auto;
}

details.tdd-build-item[open] > summary.mod-summary::after {
  content: "-";
}

details.tdd-build-item > .mod-list {
  margin: 0;
  padding: 22px 24px 26px;
  background: #fbfbfa;
  border-top: 1px solid var(--tdd-line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

details.tdd-build-item .mod-item {
  padding: 18px 18px 18px 0;
  border-bottom: 1px solid var(--tdd-line);
}

details.tdd-build-item .mod-name {
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.tdd-cat-bar {
  position: sticky;
  top: 64px;
  z-index: 60;
  display: flex;
  justify-content: flex-start;
  gap: 0 !important;
  padding: 8px 0;
  overflow-x: auto;
  background: rgba(244, 244, 242, 0.96);
  border-top: 1px solid var(--tdd-line);
  border-bottom: 1px solid var(--tdd-line);
}

.tdd-cat-bar a {
  flex: 0 0 auto;
  border-radius: 0 !important;
  border-right: 1px solid var(--tdd-line);
  background: transparent !important;
  padding: 10px 16px !important;
  color: var(--tdd-text) !important;
}

.tdd-cat-bar a[aria-current="true"] {
  background: var(--tdd-text) !important;
  color: #fff !important;
}

.tdd-cat-bar a[aria-current="true"] .tdd-cat-num {
  color: rgba(255, 255, 255, 0.64);
}

.tdd-cat-num {
  display: block;
  margin-bottom: 4px;
  color: var(--tdd-muted);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.tdd-product-grid.products {
  gap: 22px;
}

.product-card {
  border-radius: var(--tdd-radius-md);
  box-shadow: 0 12px 30px rgba(16, 16, 16, 0.08);
}

.product-card h3 {
  font-size: 19px;
  font-weight: 900;
}

.product-card-media,
.tdd-photo {
  border-radius: var(--tdd-radius-sm);
}

.product-tiers {
  border-radius: var(--tdd-radius-sm);
}

.badge,
.tdd-chip {
  border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tdd-keystone {
  position: relative;
  border: 2px solid rgba(183, 138, 60, 0.55) !important;
  background: linear-gradient(180deg, #fff8eb, #fffdf8 44%, #fff) !important;
}

.tdd-keystone .product-card-media {
  background: #161514;
}

.tdd-keystone h3 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.tdd-keystone .button.keystone {
  min-height: 54px;
  border-radius: var(--tdd-radius-sm);
  background: var(--tdd-text);
  color: #fff;
}

.tdd-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--tdd-premium);
  pointer-events: none;
}

.tdd-corner--tl {
  top: 12px;
  left: 12px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.tdd-corner--tr {
  top: 12px;
  right: 12px;
  border-top: 2px solid;
  border-right: 2px solid;
}

.tdd-corner--bl {
  bottom: 12px;
  left: 12px;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.tdd-corner--br {
  right: 12px;
  bottom: 12px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.tdd-stats.stats-grid {
  border-radius: var(--tdd-radius-md);
  background: var(--tdd-line-strong);
}

.tdd-stats .stat {
  min-height: 240px;
  padding: 42px 34px;
}

.tdd-stats .stat-num {
  font-size: clamp(58px, 7vw, 92px);
  font-weight: 900;
}

.tdd-track-table-wrap.laps-table {
  border-radius: var(--tdd-radius-md);
}

.tdd-track-table-wrap .time,
.laps-table .time {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tdd-gallery.gallery {
  gap: 20px;
}

.tdd-gallery .photo {
  border-radius: var(--tdd-radius-md);
  box-shadow: 0 14px 34px rgba(16, 16, 16, 0.09);
}

.tdd-gallery .caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

@media (min-width: 980px) {
  .tdd-product-grid.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tdd-keystone {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    column-gap: 24px;
    align-items: start;
  }

  .tdd-keystone .product-card-badges,
  .tdd-keystone .product-card-media {
    grid-column: 1;
  }

  .tdd-keystone h3,
  .tdd-keystone .product-blurb,
  .tdd-keystone .product-tiers,
  .tdd-keystone .product-actions {
    grid-column: 2;
  }

  .tdd-keystone h3 {
    margin-top: 2px;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 66px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(36px, 10vw, 40px);
    line-height: 1.04;
  }

  .tdd-hero h1 {
    max-width: 100%;
    font-size: clamp(38px, 10.5vw, 40px);
  }

  .tdd-header {
    min-height: 60px;
    padding: 0 18px;
  }

  .tdd-header > nav {
    display: none;
  }

  .tdd-mnav {
    display: block;
  }

  .tdd-page-wrap {
    width: min(100% - 40px, 1180px);
  }

  .tdd-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .tdd-hero-media {
    min-height: auto;
  }

  .tdd-footer {
    display: grid;
    text-align: center;
  }

  details.tdd-build-item > summary.mod-summary {
    min-height: 78px;
    padding: 16px 20px;
  }

  details.tdd-build-item > .mod-list {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .tdd-cat-bar {
    top: 60px;
    margin-left: calc((100vw - 100%) / -2);
    margin-right: calc((100vw - 100%) / -2);
    padding-left: 18px;
  }

  .tdd-section-head,
  .section-header,
  .category-header {
    align-items: start;
    flex-direction: column;
  }

  .tdd-section-head h2,
  .section-header h2,
  .category-header h2 {
    font-size: clamp(26px, 8vw, 34px);
  }
}
