/* ========================================
   Kernel Core — Clean Slate
   Fluid typography + refined weights
   ======================================== */

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

:root {
  /* Colors */
  --ink:        #1A1A1A;
  --ink-dim:    #6B6560;
  --ink-muted:  #8B8680;
  --paper:      #F5F2EB;
  --paper-alt:  #EDE9E1;
  --rust:       #C45A3C;
  --rust-dim:   rgba(196, 90, 60, 0.08);
  --line:       #D4CFC7;
  --ghost:      #E8E4DC;

  /* Fluid type scale */
  --text-xs:    clamp(0.7rem, 0.65rem + 0.25vw, 0.75rem);
  --text-sm:    clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);
  --text-base:  clamp(0.95rem, 0.9rem + 0.25vw, 1rem);
  --text-lg:    clamp(1.05rem, 1rem + 0.25vw, 1.125rem);
  --text-xl:    clamp(1.15rem, 1.1rem + 0.25vw, 1.25rem);
  --text-2xl:   clamp(1.35rem, 1.2rem + 0.75vw, 1.5rem);
  --text-3xl:   clamp(1.75rem, 1.5rem + 1.25vw, 2rem);
  --text-4xl:   clamp(2.25rem, 1.8rem + 2.25vw, 2.75rem);
  --text-5xl:   clamp(2.75rem, 2.2rem + 2.75vw, 3.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Fonts */
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-mono:  'SF Mono', 'Cascadia Code', Consolas, monospace;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.25s;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: 0;
}

a {
  color: var(--rust);
  text-decoration: none;
  transition: opacity var(--duration);
}
a:hover { opacity: 0.7; }

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

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.page-content {
  flex: 1;
  padding-top: clamp(80px, 10vw, 120px);
  padding-bottom: clamp(80px, 10vw, 120px);
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(245, 242, 235, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 620;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.header__logo:hover { opacity: 1; }

.header__logo-mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  margin-right: var(--space-2);
  font-size: 11px;
  font-weight: 720;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.header__link {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 520;
  color: var(--ink-dim);
  transition: color var(--duration);
}
.header__link:hover { color: var(--ink); opacity: 1; }
.header__link--active { color: var(--ink); font-weight: 620; }

.header__cta {
  margin-left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 620;
  color: var(--paper);
  background: var(--ink);
  border-radius: 4px;
  transition: all var(--duration);
}
.header__cta:hover {
  color: var(--paper);
  background: var(--rust);
  opacity: 1;
}

.header__lang {
  margin-left: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 720;
  color: var(--ink-muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--duration);
}
.header__lang:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.header__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  font-size: var(--text-xl);
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding-bottom: var(--space-16);
}

.hero__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 720;
  color: var(--ink-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.hero__title {
  font-family: var(--font-serif);
  font-size: var(--text-5xl);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: var(--space-4);
}

.hero__subtitle {
  font-size: var(--text-lg);
  font-weight: 430;
  color: var(--ink-dim);
  margin-bottom: var(--space-10);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Terminal */
.hero__terminal {
  max-width: 480px;
  margin: 0 auto var(--space-10);
  background: var(--ghost);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
}

.terminal__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.terminal__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.terminal__title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 550;
  color: var(--ink-muted);
}

.terminal__body {
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 430;
  line-height: 1.8;
  min-height: 80px;
}

.terminal__prompt {
  color: var(--rust);
  font-weight: 620;
}

.terminal__cmd {
  color: var(--ink);
}

.terminal__cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--ink);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Actions */
.hero__actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 620;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration);
  text-decoration: none;
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn--primary:hover {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--paper);
  opacity: 1;
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--secondary:hover {
  border-color: var(--ink);
  opacity: 1;
}

/* --- Dividers --- */
.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--space-16) 0;
}

/* --- Install Tabs --- */
.install-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-1);
}

.install-tab {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 550;
  color: var(--ink-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration);
  margin-bottom: -1px;
}
.install-tab:hover { color: var(--ink); }
.install-tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 620;
}

.install-path {
  display: none;
}
.install-path.active {
  display: block;
}

/* --- Terminal Inline --- */
.terminal-inline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--ghost);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 430;
}

.terminal-inline__prompt {
  color: var(--rust);
  font-weight: 620;
  flex-shrink: 0;
}

.terminal-inline__cmd {
  flex: 1;
  color: var(--ink);
  overflow-x: auto;
}

.terminal-inline__copy {
  flex-shrink: 0;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 550;
  color: var(--ink-muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--duration);
}
.terminal-inline__copy:hover {
  color: var(--rust);
  border-color: var(--rust);
}

/* --- Features List --- */
.features {
  list-style: none;
}

.feature {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--line);
}
.feature:last-child {
  border-bottom: none;
}

.feature__number {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 720;
  color: var(--ink-muted);
  flex-shrink: 0;
  width: 24px;
  padding-top: 2px;
}

.feature__content {
  flex: 1;
}

.feature__title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: var(--space-2);
}

.feature__desc {
  font-size: var(--text-sm);
  font-weight: 430;
  color: var(--ink-dim);
  line-height: 1.7;
}

.feature__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.feature__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 550;
  color: var(--ink-muted);
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

/* --- Section Header --- */
.section-header {
  margin-bottom: var(--space-10);
}

.section-header__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 720;
  color: var(--ink-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.section-header__title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.15;
}

/* --- FAQ --- */
.faq-item {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--line);
}
.faq-item:last-child {
  border-bottom: none;
}

.faq-item__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 580;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.faq-item__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--ink-muted);
  transition: transform var(--duration);
}
.faq-item--open .faq-item__icon {
  transform: rotate(45deg);
}

.faq-item__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease);
}
.faq-item--open .faq-item__a {
  max-height: 500px;
}

.faq-item__a-inner {
  padding-top: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 430;
  color: var(--ink-dim);
  line-height: 1.7;
}

/* --- Contact --- */
.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: color var(--duration);
}
.contact-item:last-child {
  border-bottom: none;
}
.contact-item:hover {
  color: var(--rust);
  opacity: 1;
}

.contact-item__icon {
  width: 20px;
  height: 20px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.contact-item__text {
  flex: 1;
}

.contact-item__label {
  font-size: var(--text-xs);
  font-weight: 550;
  color: var(--ink-muted);
  display: block;
}

.contact-item__value {
  font-size: var(--text-sm);
  font-weight: 580;
}

/* --- Resource Links --- */
.resource-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-weight: 520;
  transition: all var(--duration);
}
.resource-item:last-child {
  border-bottom: none;
}
.resource-item:hover {
  color: var(--rust);
  opacity: 1;
  padding-left: var(--space-2);
}

.resource-item__arrow {
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: transform var(--duration);
}
.resource-item:hover .resource-item__arrow {
  transform: translateX(4px);
  color: var(--rust);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--line);
  padding: var(--space-8) 0;
}

.footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer__copy {
  font-size: var(--text-xs);
  font-weight: 430;
  color: var(--ink-muted);
}

.footer__links {
  display: flex;
  gap: var(--space-4);
}

.footer__link {
  font-size: var(--text-xs);
  font-weight: 520;
  color: var(--ink-muted);
}
.footer__link:hover { color: var(--ink); opacity: 1; }

/* --- Animations --- */
@media (prefers-reduced-motion: no-preference) {
  .animate-in {
    animation: fadeIn 0.6s var(--ease) both;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-4);
  }
  
  .page-content {
    padding-top: 80px;
    padding-bottom: 80px;
  }
  
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .hero__actions .btn {
    justify-content: center;
  }
  
  .feature {
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-6) 0;
  }
  
  .feature__number {
    width: auto;
  }
  
  .header__nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 242, 235, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-8) var(--space-6);
    gap: var(--space-1);
  }
  .header__nav--open {
    display: flex;
  }
  .header__link {
    padding: var(--space-3) 0;
    font-size: var(--text-lg);
    border-bottom: 1px solid var(--line);
  }
  .header__cta {
    margin-left: 0;
    margin-top: var(--space-4);
    text-align: center;
    justify-content: center;
  }
  .header__lang {
    margin-left: 0;
    margin-top: var(--space-2);
    width: 100%;
    text-align: center;
  }
  .header__toggle {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
