/* ===========================================
   PETABYT — Light Premium
   Off-white + warm dark + single orange accent
   =========================================== */

:root {
  /* Surface */
  --bg:        #f7f4ee;
  --bg-soft:   #f1ede5;
  --bg-card:   #ffffff;
  --paper:     #fdfaf3;
  --line:      #1a1a1a;
  --line-soft: rgba(26, 26, 26, 0.12);
  --line-hair: rgba(26, 26, 26, 0.08);

  /* Text */
  --ink:       #1a1a1a;
  --ink-2:     #3a3833;
  --ink-mute:  #6b6862;
  --ink-dim:   #97938b;

  /* Accent — single orange */
  --accent:    #c2410c;
  --accent-2:  #9a3412;
  --accent-soft: #fde4d3;

  /* State */
  --ok:        #15803d;
  --warn:      #a16207;
  --err:       #b91c1c;

  /* Layout */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  /* Type — single sans family, hierarchy by weight only */
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
}

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

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Subtle paper texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(26,26,26,0.05) 1px, transparent 0);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.6;
  z-index: 0;
}

main, header, footer, section { position: relative; z-index: 1; }

/* ===== Typography ===== */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; color: var(--ink); }
h1 {
  font-weight: 600;
  font-size: clamp(2.5rem, 5vw + 1rem, 4.25rem);
  letter-spacing: -0.035em;
  line-height: 1.04;
}
h2 {
  font-weight: 600;
  font-size: clamp(1.75rem, 2.5vw + 1rem, 2.75rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }

p { color: var(--ink-2); }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-soft); text-underline-offset: 4px; transition: text-decoration-color .15s var(--ease); }
a:hover { text-decoration-color: var(--accent); }

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

.mono  { font-family: var(--font-mono); }
.weight-medium { font-weight: 500; }
.weight-semi   { font-weight: 600; }

/* ===== Icons (inline SVG sprite, see js/pb-icons.js) ===== */
.ic {
  width: 1.25em;
  height: 1.25em;
  display: inline-block;
  vertical-align: -0.18em;
  flex: none;
  color: inherit;
  pointer-events: none;
}
.ic-sm { width: 1em;    height: 1em;    vertical-align: -0.14em; }
.ic-md { width: 1.5em;  height: 1.5em;  vertical-align: -0.3em; }
.ic-lg { width: 2em;    height: 2em; }
.ic-xl { width: 2.75em; height: 2.75em; }
.ic-accent { color: var(--accent); }
.ic-mute   { color: var(--ink-mute); }
.ic-ok     { color: var(--ok); }
.ic-warn   { color: var(--warn); }
.ic-err    { color: var(--err); }

/* underline mark — kept available but not used by default */
.mark {
  position: relative;
  display: inline-block;
}
.mark::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.05em;
  height: 0.18em;
  background: var(--accent);
  opacity: 0.85;
  z-index: -1;
}

/* ===== Layout ===== */
.container       { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.container-narrow{ max-width:  780px; margin: 0 auto; padding: 0 28px; }
.section         { padding: 100px 0; }
@media (max-width: 720px) { .section { padding: 64px 0; } }

.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all .18s var(--ease);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-soft);
}
.btn-ghost:hover { background: var(--bg-card); border-color: var(--line); }

.btn-link {
  background: transparent;
  color: var(--ink);
  padding: 8px 0;
  border: none;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
}
.btn-link:hover { color: var(--accent); border-color: var(--accent); }

.btn-lg { padding: 16px 28px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }

.btn .arrow { transition: transform .18s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ===== Card ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.card:hover { border-color: var(--line); }

.card-flat {
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 28px;
}

.divider { height: 1px; background: var(--line-soft); border: none; margin: 0; }
.divider-strong { height: 1px; background: var(--line); border: none; margin: 0; }

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: transparent;
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
}
.badge-accent {
  background: var(--accent-soft);
  border-color: rgba(194,65,12,.25);
  color: var(--accent-2);
}
.badge-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.badge-dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ===== Form ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}
.form-input::placeholder { color: var(--ink-dim); }
.form-help { font-size: 0.8rem; color: var(--ink-mute); margin-top: 6px; }

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0;
  background: rgba(247, 244, 238, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; color: var(--ink); }
.nav-mark {
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  color: var(--ink-2);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}
.nav-links a:hover { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

@media (max-width: 760px) {
  .nav-links { display: none; }
}

/* ===== Language switcher ===== */
.lang-switcher { position: relative; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.lang-btn:hover { color: var(--ink); border-color: var(--line); }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 6px;
  box-shadow: 0 8px 24px rgba(26,26,26,0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all .12s var(--ease);
  z-index: 80;
}
.lang-switcher.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background .12s var(--ease);
  background: transparent;
  border: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}
.lang-option:hover { background: var(--bg-soft); }
.lang-option.active { background: var(--accent-soft); color: var(--accent-2); }
.lang-option .code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
}
.lang-option.active .code { color: var(--accent-2); }

/* ===== Eyebrow / Section labels ===== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--ink-mute);
}

/* ===== Tables ===== */
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th, .table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.table th {
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.table td.num { font-family: var(--font-mono); text-align: right; }
.table tr.highlight td { background: var(--accent-soft); }

/* ===== Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fadeUp           { animation: fadeUp .6s var(--ease) both; }
.animate-fadeUp.delay-1   { animation-delay: .08s; }
.animate-fadeUp.delay-2   { animation-delay: .16s; }
.animate-fadeUp.delay-3   { animation-delay: .24s; }
.animate-fadeUp.delay-4   { animation-delay: .32s; }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-mute   { color: var(--ink-mute); }
.text-dim    { color: var(--ink-dim); }
.text-sm     { font-size: 0.88rem; }
.text-xs     { font-size: 0.78rem; }
.text-lg     { font-size: 1.1rem; }
.uppercase   { text-transform: uppercase; letter-spacing: 0.06em; }

.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}.mt-8{margin-top:32px}.mt-12{margin-top:48px}
.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}.mb-8{margin-bottom:32px}.mb-12{margin-bottom:48px}

.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(26,26,26,0.18); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(26,26,26,0.32); }
