* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
:root {
  --black: #000000;
  --dark: #1a1a1a;
  --gray-dark: #2d2d2d;
  --gray: #666666;
  --gray-light: #999999;
  --light: #e0e0e0;
  --white: #ffffff;
  --section-pad: 2rem;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
  font-size: 16px;
}

/* Navbar */
.navbar {
  background: var(--black);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--white);
}
.logo span {
  color: var(--gray-light);
}
.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  transition: 0.3s ease;
}
.nav-links a:hover {
  background: var(--white);
  color: var(--black);
}

/* Hamburger toggle - hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* Sections */
section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem var(--section-pad);
  scroll-margin-top: 70px;
}
.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--black);
  display: inline-block;
}
.section-subtitle {
  color: var(--gray);
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

/* Hero */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  min-height: 80vh;
}
.hero-content {
  flex: 1;
}
.hero-badge {
  display: inline-block;
  border: 2px solid var(--black);
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.4;
  margin-bottom: 1rem;
}
.hero h1 .highlight {
  background: var(--black);
  color: var(--white);
  padding: 0.1rem 0.5rem;
  display: inline-block;
  line-height: 1.2;
}
.hero p {
  font-size: 1.15rem;
  color: var(--gray);
  margin-bottom: 2.5rem;
  max-width: 480px;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.hero-visual {
  flex-shrink: 0;
}
.hero-screen {
  width: 280px;
  height: 180px;
  border: 3px solid var(--black);
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: 12px 12px 0 var(--light);
  transition: 0.3s ease;
  cursor: pointer;
  user-select: none;
}
.hero-screen:hover {
  box-shadow: 12px 12px 0 var(--gray-light);
  transform: translate(-2px, -2px);
}
.hero-screen .time {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
}
.hero-screen.flash {
  animation: flashBg 0.6s ease;
}
@keyframes flashBg {
  0%, 100% { background: var(--black); }
  50% { background: #cc0000; }
}
.hero-screen .label {
  font-size: 0.8rem;
  color: var(--gray-light);
  letter-spacing: 2px;
  margin-top: 0.5rem;
  z-index: 1;
}

/* Hero progress bar */
.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--white);
  width: 100%;
  transition: width 1s linear;
  opacity: 0.5;
}
.hero-screen {
  position: relative;
  overflow: hidden;
}

/* Running state - pulse */
.hero-screen.running .time {
  animation: timePulse 2s ease-in-out infinite;
}
@keyframes timePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.hero-screen.running .label {
  color: #4caf50;
  animation: labelBlink 1.5s ease-in-out infinite;
}

/* Paused state - dim */
.hero-screen.paused .time {
  opacity: 0.5;
  transition: opacity 0.4s ease;
}
.hero-screen.paused .label {
  color: var(--gray-light);
}
.hero-screen.paused .hero-progress {
  opacity: 0.2;
}

/* Finished state */
.hero-screen.finished .time {
  color: #ff4444;
}
.hero-screen.finished .label {
  color: #ff4444;
}

@keyframes labelBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  border: 2px solid var(--black);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
}
.btn:hover {
  background: var(--black);
  color: var(--white);
}
.btn-primary {
  background: var(--black);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--dark);
}
.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-download {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  border-width: 3px;
}
.btn-download::before {
  content: "\2193";
  font-size: 1.3rem;
  font-weight: 700;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}
.feature-card {
  border: 2px solid var(--black);
  padding: 2rem;
  transition: 0.3s ease;
}
.feature-card:hover {
  box-shadow: 8px 8px 0 var(--black);
  transform: translate(-4px, -4px);
}
.feature-icon {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
  display: inline-block;
  border-bottom: 3px solid var(--black);
  padding-bottom: 0.3rem;
}
.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}
.feature-card p {
  color: var(--gray);
  font-size: 0.95rem;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  counter-reset: step;
}
.step {
  border: 2px solid var(--black);
  padding: 2rem;
  position: relative;
  transition: 0.3s ease;
}
.step:hover {
  box-shadow: 8px 8px 0 var(--black);
  transform: translate(-4px, -4px);
}
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--light);
  line-height: 1;
}
.step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}
.step p {
  color: var(--gray);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
th, td {
  border: 2px solid var(--black);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.95rem;
}
th {
  background: var(--black);
  color: var(--white);
  font-weight: 600;
  letter-spacing: 0.5px;
}
td {
  background: var(--white);
}

/* Web remote */
.remote-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.info-card {
  border: 2px solid var(--black);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.info-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.info-card p, .info-card li {
  font-size: 0.9rem;
  color: var(--gray);
}
.info-card ul {
  list-style: none;
  padding: 0;
}
.info-card ul li {
  padding: 0.3rem 0;
  padding-left: 1.2rem;
  position: relative;
}
.info-card ul li::before {
  content: "\2014";
  position: absolute;
  left: 0;
  color: var(--black);
  font-weight: 700;
}

.tag {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* FAQ */
.faq-item {
  border: 2px solid var(--black);
  margin-bottom: 1rem;
}
.faq-q {
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s ease;
  user-select: none;
}
.faq-q:hover {
  background: #f5f5f5;
}
.faq-q .arrow {
  font-size: 1.2rem;
  transition: 0.3s ease;
}
.faq-q.active .arrow {
  transform: rotate(180deg);
}
.faq-a {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: 0.3s ease;
  color: var(--gray);
  font-size: 0.95rem;
}
.faq-a.open {
  padding: 0 1.5rem 1.25rem;
  max-height: 300px;
}

/* Footer */
footer {
  background: var(--black);
  color: var(--white);
  padding: 3rem 2rem;
  text-align: center;
}
footer p {
  color: var(--gray-light);
  font-size: 0.9rem;
}
footer a {
  color: var(--white);
}

/* Badge */
.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.badge {
  border: 2px solid var(--black);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Shortcuts */
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border: 2px solid var(--black);
  font-size: 0.9rem;
}
.shortcut-item .key {
  font-weight: 700;
  background: var(--black);
  color: var(--white);
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

/* Full-width sections */
.section-full {
  background: #f9f9f9;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
.section-full-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--section-pad);
}

/* ===== Fluid Typography ===== */
.hero h1 {
  font-size: clamp(1.8rem, 6vw, 3.5rem);
}
.hero p {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
}
.section-title {
  font-size: clamp(1.3rem, 4vw, 2rem);
}
.hero-screen .time {
  font-size: clamp(2rem, 8vw, 3.5rem);
}
.feature-icon {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
}
.step::before {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
}

/* ===== Tablet (max-width: 768px) ===== */
@media (max-width: 768px) {
  :root {
    --section-pad: 1.5rem;
  }
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 2.5rem var(--section-pad) 2rem;
    gap: 2.5rem;
    min-height: auto;
  }
  .hero h1 {
    letter-spacing: 0;
    line-height: 1.4;
  }
  .hero p {
    margin-left: auto;
    margin-right: auto;
    max-width: 400px;
  }
  .hero-actions {
    justify-content: center;
  }
  .badge-group {
    justify-content: center;
  }
  .hero-screen {
    width: 220px;
    height: 150px;
    box-shadow: 8px 8px 0 var(--light);
  }
  .hero-screen:hover {
    box-shadow: 8px 8px 0 var(--gray-light);
  }
  section {
    padding: 3rem var(--section-pad);
  }
  .section-subtitle {
    margin-bottom: 2rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .remote-container {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .nav-content {
    padding: 0.8rem 1rem;
  }

  /* Hamburger visible */
  .nav-toggle {
    display: block;
    width: 26px;
    height: 18px;
    position: relative;
    z-index: 200;
  }
  .nav-toggle::before,
  .nav-toggle::after {
    content: "";
    display: block;
    height: 2px;
    background: var(--white);
    position: absolute;
    left: 0;
    right: 0;
    transition: 0.3s ease;
    border-radius: 1px;
  }
  .nav-toggle::before { top: 0; }
  .nav-toggle::after { bottom: 0; }
  .nav-toggle span {
    display: block;
    height: 2px;
    background: var(--white);
    position: absolute;
    left: 0;
    right: 0;
    top: 8px;
    transition: 0.3s ease;
    border-radius: 1px;
  }
  .nav-open .nav-toggle::before {
    top: 8px;
    transform: rotate(45deg);
  }
  .nav-open .nav-toggle::after {
    bottom: 8px;
    transform: rotate(-45deg);
  }
  .nav-open .nav-toggle span {
    opacity: 0;
  }

  /* Nav links as dropdown */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--black);
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
  }
  .nav-open .nav-links {
    max-height: 480px;
  }
  .nav-links a {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    border-top: 1px solid var(--dark);
  }
  .shortcut-grid {
    grid-template-columns: 1fr;
  }
  th, td {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
  }
  .feature-card {
    padding: 1.5rem;
  }
  .step {
    padding: 1.5rem;
  }
  .info-card {
    padding: 1.25rem;
  }
  .faq-q {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }
  .faq-a.open {
    padding: 0 1.25rem 1rem;
  }
  footer {
    padding: 2rem 1.5rem;
  }

  /* Responsive code block */
  .code-block {
    padding: 1rem;
  }
  .code-block pre {
    font-size: 0.78rem;
  }
}

/* ===== Small Phone (max-width: 480px) ===== */
@media (max-width: 480px) {
  :root {
    --section-pad: 1rem;
  }
  body {
    font-size: 14px;
  }
  .hero {
    padding: 2.5rem var(--section-pad) 1.5rem;
    gap: 2rem;
  }
  .hero-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.75rem;
    margin-bottom: 1rem;
  }
  .hero h1 {
    font-size: clamp(1.5rem, 7vw, 1.8rem);
  }
  .hero p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  .hero-screen {
    width: 180px;
    height: 120px;
    box-shadow: 6px 6px 0 var(--light);
  }
  .hero-screen:hover {
    box-shadow: 6px 6px 0 var(--gray-light);
    transform: translate(-1px, -1px);
  }
  .hero-screen .time {
    font-size: clamp(1.6rem, 8vw, 2rem);
    letter-spacing: 2px;
  }
  .hero-screen .label {
    font-size: 0.65rem;
    margin-top: 0.3rem;
  }
  .section-title {
    font-size: clamp(1.1rem, 5vw, 1.3rem);
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }
  .section-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  .btn {
    padding: 0.7rem 1.25rem;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
  }
  .btn-download {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
  }
  .btn-download::before {
    font-size: 1rem;
  }
  .badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.6rem;
  }
  .feature-card {
    padding: 1.25rem;
  }
  .feature-icon {
    font-size: clamp(1.1rem, 5vw, 1.3rem);
    margin-bottom: 0.75rem;
  }
  .feature-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  .feature-card p {
    font-size: 0.85rem;
  }
  .step {
    padding: 1.25rem;
  }
  .step::before {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
    top: 0.75rem;
    right: 0.75rem;
  }
  .step h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  .step p {
    font-size: 0.85rem;
  }
  th, td {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }
  .info-card {
    padding: 1rem;
  }
  .info-card h4 {
    font-size: 0.9rem;
  }
  .info-card p, .info-card li {
    font-size: 0.85rem;
  }
  .tag {
    font-size: 0.65rem;
  }
  .shortcut-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  .shortcut-item .key {
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
  }
  .code-block {
    padding: 0.8rem;
  }
  .code-block pre {
    font-size: 0.72rem;
  }
  .faq-q {
    padding: 0.8rem 1rem;
    font-size: 0.88rem;
  }
  .faq-q .arrow {
    font-size: 1rem;
  }
  .faq-a.open {
    padding: 0 1rem 0.8rem;
    font-size: 0.85rem;
  }
  .logo {
    font-size: 1rem;
    letter-spacing: 1px;
  }
  footer {
    padding: 1.5rem 1rem;
  }
  footer p {
    font-size: 0.8rem;
  }
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--black);
  z-index: 101;
  width: 0%;
  transition: width 0.1s ease;
}

/* Code Block (project structure, registry path) */
.code-block {
  border: 2px solid var(--black);
  background: #f5f5f5;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.code-block pre {
  font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--dark);
  white-space: pre;
}

/* Table enhancements for software support tables */
section table h4 {
  margin-top: 0;
}

/* Smooth reveal for new sections */
section {
  opacity: 0;
  animation: sectionFadeIn 0.6s ease forwards;
}
section.section-full {
  opacity: 1;
  animation: none;
}
@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Very Small (max-width: 360px) ===== */
@media (max-width: 360px) {
  .hero h1 {
    font-size: 1.3rem;
  }
  .hero-screen {
    width: 150px;
    height: 100px;
    box-shadow: 4px 4px 0 var(--light);
  }
  .hero-screen .time {
    font-size: 1.4rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .btn-download {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }
  .section-title {
    font-size: 1rem;
  }
  .feature-card {
    padding: 1rem;
  }
  .step {
    padding: 1rem;
  }
  .info-card {
    padding: 0.8rem;
  }
  th, td {
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
  }
  .shortcut-item {
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
  }
}
