/* KTM 300 EXC TPI — presentation site.
   Palette: KTM orange #FF6600 + black. Light and dark themes, mobile-first. */

:root {
  --radius: 0.625rem;
  --sab: env(safe-area-inset-bottom, 0px);

  --orange: #ff6600;
  --orange-strong: #ff7a1a;

  --background: #f2f3f5;
  --surface: #ffffff;
  --card: #ffffff;
  --card-border: #e0e3e7;
  --card-border-strong: #cfd3d9;

  --text-heading: #0b0b0d;
  --text-body: #26282d;
  --text-secondary: #4e5360;
  --text-tertiary: #6b7080;

  --header-bg: rgba(255, 255, 255, 0.88);
  --footer-bg: #0b0b0d;
  --footer-text: #d7d9dd;
  --shadow: 0 1px 2px rgba(9, 10, 12, 0.06), 0 8px 24px rgba(9, 10, 12, 0.06);
}

.dark {
  --background: #0b0b0d;
  --surface: #121214;
  --card: #17181b;
  --card-border: #26282d;
  --card-border-strong: #3a3c42;

  --text-heading: #ffffff;
  --text-body: #d8dade;
  --text-secondary: #a6a9b0;
  --text-tertiary: #7c8089;

  --header-bg: rgba(11, 11, 13, 0.82);
  --footer-bg: #000000;
  --footer-text: #a6a9b0;
  --shadow: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text-body);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  touch-action: manipulation;
}

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

h1, h2, h3, .brand-text, .stat b {
  font-family: Oswald, Inter, Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-heading);
  text-transform: uppercase;
}

h1 { font-size: clamp(2.2rem, 11vw, 5.5rem); line-height: 0.98; margin: 0 0 1rem; }
h2 { font-size: clamp(1.5rem, 6vw, 2.5rem); line-height: 1.1; margin: 0.35rem 0 0.75rem; }
h3 { font-size: 1.0625rem; line-height: 1.25; margin: 0 0 0.6rem; }

p { margin: 0 0 1rem; }
a { color: inherit; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1.125rem; }

.kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.35rem;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}

.brand-bar {
  display: block;
  width: 6px;
  height: 26px;
  background: var(--orange);
  transform: skewX(-12deg);
  flex: none;
}

.brand-text { font-size: 1.05rem; white-space: nowrap; }
.brand-text b { color: var(--orange); font-weight: 700; }

.nav { display: none; gap: 1.25rem; }

.nav a {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  transition: color 140ms ease;
}

.nav a:hover { color: var(--orange); }

.theme-toggle {
  width: 44px;
  height: 44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: transparent;
  cursor: pointer;
  transition: border-color 140ms ease, transform 100ms ease;
}

.theme-toggle:hover { border-color: var(--orange); }
.theme-toggle:active { transform: scale(0.97); }

.theme-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: inset -6px -3px 0 0 var(--background);
}

.dark .theme-icon { box-shadow: none; }

@media (min-width: 880px) {
  .nav { display: flex; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  background: #000;
  min-height: min(86vh, 720px);
  display: flex;
  align-items: flex-end;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -2;
  opacity: 0.95;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.15) 100%),
    linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 65%);
}

.photo-credit.hero-credit {
  position: absolute;
  right: 0.75rem;
  bottom: 0.4rem;
  z-index: 1;
  margin: 0;
  max-width: min(92%, 46ch);
  text-align: right;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.hero-content { padding-top: 4rem; padding-bottom: 4rem; color: #fff; }
.hero-content h1 { color: #fff; }
.hero-content .accent { color: var(--orange); }

.lead {
  max-width: 46ch;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.88);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
  max-width: 640px;
}

.stat {
  border-left: 3px solid var(--orange);
  padding: 0.35rem 0 0.35rem 0.7rem;
  min-width: 0;
}

.stat b {
  display: block;
  font-size: 1.35rem;
  color: #fff;
  line-height: 1.1;
}

.stat span {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.3;
  display: block;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: var(--radius);
  background: var(--orange);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 1px solid var(--orange);
  cursor: pointer;
  transition: background 140ms ease, transform 100ms ease;
}

.btn:hover { background: var(--orange-strong); }
.btn:active { transform: scale(0.97); }

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

@media (min-width: 720px) {
  .hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-content { padding-top: 6rem; padding-bottom: 4.75rem; }
  .lead { font-size: 1.125rem; }
  .stat b { font-size: 1.6rem; }
}

/* ---------- sections ---------- */

.section { padding: 3rem 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--card-border); }

.section-lead {
  max-width: 68ch;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 720px) {
  .section { padding: 4.5rem 0; }
  .section-lead { font-size: 1rem; }
}

/* ---------- specs ---------- */

.spec-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.spec-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 0.875rem;
  padding: 1.15rem;
  box-shadow: var(--shadow);
}

.spec-card h3 {
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--orange);
  margin-bottom: 0.85rem;
}

.spec-list { margin: 0; }

.spec-list > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--card-border);
}

.spec-list > div:last-child { border-bottom: 0; padding-bottom: 0; }

.spec-list dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.spec-list dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-heading);
  overflow-wrap: break-word;
}

@media (min-width: 640px) {
  .spec-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-list > div {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
  }
  .spec-list dt { flex: 1 1 42%; }
  .spec-list dd { flex: 1 1 58%; text-align: right; }
}

/* ---------- why ---------- */

.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.why-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 0.875rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: border-color 150ms ease, transform 150ms ease;
}

.why-card:hover { border-color: var(--card-border-strong); transform: translateY(-2px); }

.why-num {
  font-family: Oswald, Inter, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--orange);
}

.why-card h3 { margin-top: 0.4rem; }

.why-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

@media (min-width: 640px) { .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .why-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.shot-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

/* small attribution line under every photo (required by the CC licenses) */
.photo-credit {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-tertiary);
  margin: 0;
  overflow-wrap: break-word;
}

.shot {
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: 0.875rem;
  overflow: hidden;
  background: #000;
  cursor: zoom-in;
  display: block;
  min-height: 44px;
  transition: border-color 150ms ease, transform 150ms ease;
}

.shot img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 400ms ease, opacity 200ms ease;
}

.shot:hover { border-color: var(--orange); }
.shot:hover img { transform: scale(1.03); }
.shot:active { transform: scale(0.99); }

@media (min-width: 640px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- contacts ---------- */

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 720px;
}

.contact-list li {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--orange);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.contact-list span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.contact-list b { color: var(--text-heading); font-size: 0.9375rem; overflow-wrap: break-word; }

/* ---------- footer ---------- */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 2.5rem 0 calc(2.5rem + var(--sab));
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-title {
  font-family: Oswald, Inter, sans-serif;
  text-transform: uppercase;
  color: #fff;
  font-size: 1.1rem;
  margin: 0.55rem 0 0.4rem;
}

.footer-note {
  font-size: 0.8125rem;
  line-height: 1.55;
  max-width: 62ch;
  margin: 0;
  color: var(--footer-text);
}

.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

.footer-links a {
  color: var(--footer-text);
  text-decoration: none;
  font-size: 0.875rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover { color: var(--orange); }

@media (min-width: 880px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-start; }
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade 180ms ease;
}

.lightbox[hidden] { display: none; }

.lightbox-figure { margin: 0; max-width: 1100px; width: 100%; }

.lightbox-figure img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 0.5rem;
}

.lightbox-figure figcaption {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0.75rem;
}

.lightbox-close {
  position: absolute;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  right: 0.75rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover { border-color: var(--orange); color: var(--orange); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- settings page ---------- */

.settings-body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.settings-card {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-top: 3px solid var(--orange);
  border-radius: 0.875rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.settings-card h1 { font-size: clamp(1.4rem, 6vw, 2rem); margin-bottom: 0.75rem; }
.settings-card .muted { color: var(--text-secondary); font-size: 0.9375rem; }

/* ---------- a11y ---------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
