/* ============================================================
   DESIGN TOKENS — Light (Catppuccin Latte + Path Blue)
   ============================================================ */
:root {
  --accent:           #3465a4;
  --accent-hover:     #2855a3;
  --surface-page:     #eff1f5;
  --surface-panel:    #e6e9ef;
  --surface-chrome:   #dce0e8;
  --border:           #ccd0da;
  --border-strong:    #9ca0b0;
  --text-primary:     #4c4f69;
  --text-secondary:   #5c5f77;
  --text-tertiary:    #6c6f85;
  --text-on-accent:   #ffffff;
  --mauve:            #8839ef;
  --teal:             #179299;
  --green:            #40a02b;
  --peach:            #fe640b;
  --selection-bg:     #a9c1e2;
  --contact-bg:       color-mix(in srgb, #3465a4 6%, #eff1f5);

  --shadow-sm:  0 1px 3px rgba(76,79,105,0.10), 0 1px 2px rgba(76,79,105,0.06);
  --shadow-md:  0 4px 12px rgba(76,79,105,0.12), 0 2px 4px rgba(76,79,105,0.07);
  --shadow-paper: 0 2px 8px rgba(76,79,105,0.10), 0 1px 3px rgba(76,79,105,0.07);

  --radius-pill:  999px;
  --radius-paper: 16px;
  --radius-badge: 6px;

  --font-sans:    'Manrope', system-ui, sans-serif;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'Fira Mono', monospace;

  --tracking-caps: 0.08em;
}

/* ============================================================
   DARK THEME (Catppuccin Mocha)
   ============================================================ */
[data-theme="dark"] {
  --accent:           #7aa2d6;
  --accent-hover:     #8fb3e0;
  --surface-page:     #1e1e2e;
  --surface-panel:    #181825;
  --surface-chrome:   #11111b;
  --border:           #313244;
  --border-strong:    #45475a;
  --text-primary:     #cdd6f4;
  --text-secondary:   #bac2de;
  --text-tertiary:    #a6adc8;
  --text-on-accent:   #11111b;
  --mauve:            #cba6f7;
  --teal:             #94e2d5;
  --green:            #a6e3a1;
  --peach:            #fab387;
  --selection-bg:     #45475a;
  --contact-bg:       color-mix(in srgb, #7aa2d6 6%, #1e1e2e);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.30), 0 1px 2px rgba(0,0,0,0.20);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.20);
  --shadow-paper: 0 2px 8px rgba(0,0,0,0.30), 0 1px 3px rgba(0,0,0,0.20);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--selection-bg);
  color: var(--text-primary);
}

/* ============================================================
   WORDMARK
   ============================================================ */
.ns-wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-primary);
  text-decoration: none;
}
.ns-wordmark .e-light { display: block; }
.ns-wordmark .e-dark  { display: none; }

[data-theme="dark"] .ns-wordmark .e-light { display: none; }
[data-theme="dark"] .ns-wordmark .e-dark  { display: block; }

/* ============================================================
   NAV
   ============================================================ */
.ns-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--surface-page) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.ns-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.ns-nav-links {
  display: flex;
  gap: 30px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.ns-nav-links a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease-out;
}
.ns-nav-links a:hover { color: var(--accent); }

/* ============================================================
   BUTTONS / PILLS
   ============================================================ */
.ns-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 160ms ease-out, border-color 160ms ease-out, transform 120ms ease-out, color 160ms ease-out;
}
.ns-btn:active { transform: translateY(1px); }
.ns-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ns-btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-sm);
}
.ns-btn-primary:hover { background: var(--accent-hover); }

.ns-btn-secondary {
  background: var(--surface-page);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.ns-btn-secondary:hover { border-color: var(--accent); }

.ns-btn-sm  { height: 40px; padding: 0 22px; font-size: 14px; }
.ns-btn-md  { height: 48px; padding: 0 26px; font-size: 15px; }
.ns-btn-lg  { height: 52px; padding: 0 30px; font-size: 16px; }

/* ============================================================
   LINKS
   ============================================================ */
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.ns-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ============================================================
   HERO
   ============================================================ */
.ns-hero {
  text-align: center;
  padding: 104px 32px 80px;
  max-width: 1120px;
  margin: 0 auto;
}
.ns-hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
.ns-h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 78px;
  line-height: 1.1;
  margin: 0 auto;
  max-width: 800px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.ns-hero-sub {
  font-size: 19px;
  line-height: 1.65;
  max-width: 560px;
  margin: 40px auto 0;
  color: var(--text-tertiary);
  text-wrap: pretty;
}
.ns-hero-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
}

/* ============================================================
   PAPER CARD
   ============================================================ */
.ns-paper {
  background: var(--surface-page);
  border-radius: var(--radius-paper);
  box-shadow: var(--shadow-paper);
  border: 1px solid var(--border);
}
.ns-paper-teal {
  background: color-mix(in srgb, var(--teal) 5%, var(--surface-page));
  border-color: color-mix(in srgb, var(--teal) 20%, var(--border));
}

/* ============================================================
   MACPREFS SECTION
   ============================================================ */
#macprefs {
  padding: 36px 0 92px;
}
.ns-mp-card-inner {
  padding: 40px 40px 44px;
}
.ns-mp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.ns-mp-app-header {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.ns-mp-icon {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
  display: block;
}
.ns-mp-app-name {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}
.ns-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--teal) 15%, var(--surface-page));
  color: var(--teal);
  border: 1px solid color-mix(in srgb, var(--teal) 30%, var(--border));
}
.ns-mp-h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.08;
  margin: 0 0 14px;
  color: var(--text-primary);
}
.ns-mp-body {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-tertiary);
  margin: 0 0 26px;
  max-width: 440px;
}

/* Feature 2×2 grid */
.ns-feat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ns-feat-card {
  padding: 20px;
}
.ns-feat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 18px;
  flex-shrink: 0;
}
.ns-feat-icon-teal  { background: color-mix(in srgb, var(--teal)  18%, var(--surface-page)); color: var(--teal);  }
.ns-feat-icon-green { background: color-mix(in srgb, var(--green) 18%, var(--surface-page)); color: var(--green); }
.ns-feat-icon-mauve { background: color-mix(in srgb, var(--mauve) 18%, var(--surface-page)); color: var(--mauve); }
.ns-feat-icon-peach { background: color-mix(in srgb, var(--peach) 18%, var(--surface-page)); color: var(--peach); }

.ns-feat-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.ns-feat-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-tertiary);
  margin: 0;
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
#about {
  background: var(--surface-panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ns-about-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 88px 32px;
}
.ns-about-content { max-width: 720px; }
.ns-eyebrow-mauve {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--mauve);
  margin-bottom: 16px;
}
.ns-about-h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.1;
  margin: 0 0 20px;
  color: var(--text-primary);
}
.ns-about-body {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-tertiary);
  margin: 0;
  text-wrap: pretty;
}
.ns-about-body em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-secondary);
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
#contact {
  background: var(--contact-bg);
}
.ns-contact-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 92px 32px;
}
.ns-contact-heading {
  text-align: center;
  margin: 0 auto 44px;
  max-width: 520px;
}
.ns-contact-h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 46px;
  line-height: 1.06;
  margin: 0 0 14px;
  color: var(--text-primary);
}
.ns-contact-sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-tertiary);
  margin: 0;
}
.ns-contact-form-wrap {
  max-width: 600px;
  margin: 0 auto;
}
.ns-contact-email {
  text-align: center;
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
}
.ns-contact-email a {
  color: var(--accent);
  text-decoration: none;
}
.ns-contact-email a:hover { text-decoration: underline; }

/* Form elements */
.ns-form {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* JS hides this by setting style.display = 'none'; reset brings it back as flex */
}
.ns-field { display: flex; flex-direction: column; gap: 6px; }
.ns-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.ns-input,
.ns-textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface-page);
  border: 1px solid var(--border);
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}
.ns-input {
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
}
.ns-textarea {
  padding: 14px 20px;
  border-radius: 16px;
  resize: vertical;
  min-height: 130px;
  line-height: 1.55;
}
.ns-input::placeholder,
.ns-textarea::placeholder {
  color: var(--text-tertiary);
}
.ns-input:focus,
.ns-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
/* Field-level error state */
.ns-input.is-invalid,
.ns-textarea.is-invalid {
  border-color: #d20f39;
  box-shadow: 0 0 0 3px color-mix(in srgb, #d20f39 14%, transparent);
}
[data-theme="dark"] .ns-input.is-invalid,
[data-theme="dark"] .ns-textarea.is-invalid {
  border-color: #f38ba8;
  box-shadow: 0 0 0 3px color-mix(in srgb, #f38ba8 14%, transparent);
}
.ns-field-error {
  font-size: 12.5px;
  color: #d20f39;
  padding-left: 4px;
  display: none;
}
[data-theme="dark"] .ns-field-error { color: #f38ba8; }
.ns-field-error.is-visible { display: block; }

.ns-form-submit { margin-top: 4px; }
.ns-form-btn {
  width: 100%;
  height: 52px;
  font-size: 16px;
  border-radius: var(--radius-pill);
  border: none;
  position: relative;
}
.ns-form-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* Spinner */
@keyframes ns-spin {
  to { transform: rotate(360deg); }
}
.ns-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ns-spin 0.7s linear infinite;
  flex-shrink: 0;
}
[data-theme="dark"] .ns-spinner {
  border-color: rgba(17,17,27,0.25);
  border-top-color: #11111b;
}

/* Success state */
.ns-form-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 32px 52px;
  gap: 0;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 260ms ease-out, transform 260ms ease-out;
}
.ns-form-success.is-visible {
  display: flex;
  opacity: 1;
  transform: scale(1);
}
.ns-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 12%, var(--surface-page));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.ns-success-icon svg { display: block; }
.ns-success-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0 0 10px;
  line-height: 1.2;
}
.ns-success-sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-tertiary);
  margin: 0 0 24px;
  max-width: 340px;
}
.ns-success-again {
  font-size: 13.5px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ns-success-again:hover { color: var(--accent-hover); }

/* ============================================================
   FOOTER
   ============================================================ */
.ns-footer {
  background: var(--surface-chrome);
  border-top: 1px solid var(--border);
}
.ns-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 32px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.ns-footer-links {
  display: flex;
  gap: 22px;
  margin-left: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.ns-footer-links a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease-out;
}
.ns-footer-links a:hover { color: var(--accent); }
.ns-footer-meta {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  text-align: right;
  line-height: 1.6;
}

/* ============================================================
   LEGAL PAGES
   ============================================================ */
.ns-legal-nav {
  border-bottom: 1px solid var(--border);
}
.ns-legal-nav-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
}
.ns-legal-back {
  margin-left: auto;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 160ms ease-out;
}
.ns-legal-back:hover { color: var(--accent); }

.ns-doc {
  max-width: 820px;
  margin: 0 auto;
  padding: 64px 32px 96px;
}
.ns-doc-eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.ns-doc-h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 56px;
  line-height: 1.05;
  margin: 0 0 14px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.ns-doc-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0 0 8px;
}
.ns-doc-placeholder {
  margin-top: 8px;
  padding: 22px 26px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-paper);
  background: var(--surface-panel);
  color: var(--text-tertiary);
  font-size: 14.5px;
  line-height: 1.6;
}
.ns-doc-placeholder strong { color: var(--text-secondary); }
.ns-doc-placeholder a { color: var(--accent); }
.ns-doc h2 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 22px;
  color: var(--text-primary);
  margin: 44px 0 12px;
  letter-spacing: -0.01em;
}
.ns-doc h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 17px;
  color: var(--text-primary);
  margin: 28px 0 8px;
  letter-spacing: -0.01em;
}
.ns-doc p {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 16px;
}
.ns-doc ul, .ns-doc ol {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 16px;
  padding-left: 24px;
}
.ns-doc li { margin-bottom: 6px; }
.ns-doc a { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .ns-nav-links { display: none !important; }
  .ns-mp-grid   { grid-template-columns: 1fr !important; }
  .ns-feat      { grid-template-columns: 1fr 1fr !important; }
  .ns-h1        { font-size: 52px !important; }
}
@media (max-width: 540px) {
  .ns-feat { grid-template-columns: 1fr !important; }
  .ns-h1   { font-size: 40px !important; }
  .ns-mp-card-inner { padding: 24px 20px 28px; }
  .ns-form  { padding: 20px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
