:root {
  --bg: #0d1119;
  --bg-panel: #121826;
  --line: rgba(245, 246, 248, 0.10);
  --ink: #f5f6f8;
  --ink-dim: rgba(245, 246, 248, 0.68);
  --ink-faint: rgba(245, 246, 248, 0.42);
  --red: #c8202c;
  --red-dim: rgba(200, 32, 44, 0.14);
  --green: #3c6b35;
  --edge: 48px;
}

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

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: calc(28px + env(safe-area-inset-top));
  padding-right: calc(var(--edge) + env(safe-area-inset-right));
  padding-bottom: 28px;
  padding-left: calc(var(--edge) + env(safe-area-inset-left));
  background: rgba(13, 17, 25, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.brand-name a { text-decoration: none; }

.back-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease;
}

.back-link:hover { color: var(--ink); }

.back-link svg { width: 14px; height: 14px; }

/* ---------- Section shell ---------- */
section {
  padding: 96px var(--edge);
  border-bottom: 1px solid var(--line);
}

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  max-width: 760px;
}

#machines-intro { padding-bottom: 48px; }

.intro-copy {
  margin-top: 22px;
  max-width: 560px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-dim);
  font-weight: 300;
}

#machines-grid { padding-top: 0; }

/* ---------- Machine cards ---------- */
.machine-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.machine-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.machine-card:hover {
  border-color: rgba(245, 246, 248, 0.28);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.machine-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.machine-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.machine-card:hover .machine-photo img {
  transform: scale(1.04);
}

.machine-body {
  padding: 26px 28px 32px;
}

.machine-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.machine-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}

.machine-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.25s ease;
}

.machine-card:hover .machine-link {
  color: var(--ink);
}

.machine-link svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding-top: 40px;
  padding-right: calc(var(--edge) + env(safe-area-inset-right));
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
  padding-left: calc(var(--edge) + env(safe-area-inset-left));
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  padding-bottom: 6px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.nav-link:hover { color: var(--ink); }

.nav-link.active {
  color: var(--ink);
  border-color: var(--red);
}

.nav-divider {
  color: var(--ink-faint);
  font-size: 11px;
}

.pr-flag {
  display: inline-block;
  font-size: 1.6em;
  line-height: 1;
  vertical-align: middle;
  margin-left: 6px;
  transform: translateY(-1px);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .machine-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root { --edge: 22px; }

  .site-header { padding: 20px var(--edge); }

  section { padding: 64px var(--edge); }

  .site-footer { flex-direction: column; text-align: center; }

  .footer-nav { gap: 8px; }

  .nav-link {
    font-size: 10px;
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  .nav-divider { font-size: 10px; }

  .pr-flag { font-size: 1.5em; }
}
