/* Pebble Website — Bitcoin Whitepaper / LaTeX Document Style */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Times New Roman", Times, "Nimbus Roman No9 L", "Liberation Serif", "Noto Serif KR", "Apple SD Gothic Neo", serif;
  font-size: 16px;
  line-height: 1.75;
  color: #111111;
  background: #F3F4F6;
  -webkit-font-smoothing: auto;
  overflow-wrap: break-word;
}

a {
  color: #0B1F3B;
  text-decoration: underline;
  transition: color 150ms ease;
}

a:hover {
  color: #1a3a6b;
}

/* ── Language Toggle ── */
body.lang-ko [data-lang="en"] { display: none !important; }
body.lang-en [data-lang="ko"] { display: none !important; }
body.lang-ko { word-break: keep-all; }
body.lang-en { word-break: normal; }

/* ── Mobile line break ── */
.mobile-br { display: none; }

/* ── Fixed Top Bar ── */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 254, 250, 0.96);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid #e5e7eb;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

.top-bar-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 24px;
  gap: 14px;
}

.toc-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-family: "Times New Roman", Times, "Noto Serif KR", serif;
  font-size: 14px;
  color: #6B7280;
  cursor: pointer;
  padding: 0;
}

.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  margin-right: auto;
}

.top-bar-logo-img {
  height: 28px;
  width: auto;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-bar-actions a {
  color: #6B7280;
  text-decoration: none;
}

.top-bar-actions a:hover {
  color: #111111;
}

.top-bar-actions a.active {
  color: #111111;
  font-weight: 600;
}

.top-sep {
  color: #d1d5db;
}

.theme-toggle {
  background: none;
  border: 1px solid #d1d5db;
  font-family: inherit;
  font-size: 13px;
  color: #6B7280;
  cursor: pointer;
  padding: 3px 12px;
  border-radius: 3px;
  transition: color 150ms ease, border-color 150ms ease;
}

.theme-toggle:hover {
  color: #111111;
  border-color: #9ca3af;
}

.toc-dropdown {
  display: none;
  padding: 0 24px 14px;
}

.toc-dropdown.open {
  display: block;
}

.toc-dropdown a {
  display: block;
  padding: 7px 0;
  font-size: 16px;
  font-family: "Times New Roman", Times, "Noto Serif KR", serif;
  color: #111111;
  text-decoration: none;
}

.toc-dropdown a:hover {
  color: #0B1F3B;
}

@media (max-width: 1299px) {
  .top-bar-inner {
    justify-content: space-between;
  }
  .top-bar-logo {
    order: -1;
    margin-right: 0;
  }
  .top-bar-logo-img {
    height: 22px;
    max-height: 22px;
  }
  .toc-toggle-btn {
    display: block;
    order: 0;
    flex: 1;
    text-align: center;
    font-size: 17px;
  }
  .top-bar-actions {
    order: 1;
  }
}

/* ── Page Background & Paper ── */
.page-bg {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 72px 20px 40vh;
}

.paper {
  background: #FFFEFA;
  max-width: 900px;
  width: 100%;
  padding: 64px 72px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  position: relative;
}

/* ── Cover ── */
.cover {
  text-align: center;
  margin-bottom: 64px;
}

.cover-top {
  margin-bottom: 48px;
}

.meta-info {
  text-align: left;
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.8;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.meta-info span {
  display: block;
}

.cover-title {
  margin-bottom: 32px;
}

.cover-title h1 {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.cover-subtitle {
  font-size: 16px;
  color: #6B7280;
  font-style: italic;
}

.cover-disclaimer {
  font-size: 13px;
  color: #9ca3af;
  font-style: italic;
}

.section-rule {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin-bottom: 64px;
}

/* ── Sections ── */
.section {
  margin-bottom: 80px;
  scroll-margin-top: 56px;
}

.section h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.3px;
}

.section p {
  margin-bottom: 16px;
  text-align: left;
  white-space: pre-wrap;
}

/* ── Abstract (80% width) ── */
#abstract {
  padding-left: 10%;
  padding-right: 10%;
}

/* ── Strategy Definitions ── */
.strategy-heading {
  font-size: 18px;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 0;
}

.strategy-list {
  margin: 16px 0 28px 0;
  padding-left: 0;
}

.strategy-list dt {
  font-weight: 600;
  font-size: 16px;
  margin-top: 16px;
  margin-bottom: 4px;
}

.strategy-list dd {
  margin-left: 0;
  color: #6B7280;
  font-size: 16px;
  text-align: left;
}

/* ── Emphasis Block (no borders) ── */
.emphasis-block {
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  margin: 28px 0;
  padding: 0;
  white-space: normal;
}

/* ── People ── */
.person {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid #f3f4f6;
}

.person:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.person-header {
  margin-bottom: 10px;
}

.person-name {
  font-size: 18px;
  font-weight: 700;
  margin-right: 12px;
}

.person-role {
  font-size: 16px;
  color: #6B7280;
}

.person-quote {
  font-style: italic;
  font-size: 16px;
  color: #6B7280;
  margin: 0 0 14px 0;
  padding: 0 0 0 16px;
  border-left: 2px solid #d1d5db;
}

.person-history {
  list-style-type: none !important;
  padding: 0 !important;
  margin: 0 !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.person-history li {
  font-size: 16px;
  color: #6B7280;
  padding: 2px 0;
  list-style-type: none !important;
  margin-left: 0 !important;
}

.person-history li::before,
.person-history li::marker {
  display: none !important;
  content: none !important;
}

/* ── Process Flowchart ── */
.process-box {
  border: 1px solid #e5e7eb;
  padding: 14px 32px;
  margin: 32px 0;
}

.process-flow {
  margin: 0;
  overflow-x: auto;
}

.process-flow svg {
  display: block;
  width: 100%;
  max-width: 680px;
  height: auto;
}

/* ── Career Positions ── */
.position {
  margin: 32px 0;
  padding-bottom: 28px;
  border-bottom: 1px solid #f3f4f6;
}

.position:last-child {
  border-bottom: none;
}

.position-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.position-details p {
  font-size: 16px;
  margin-bottom: 6px;
  white-space: normal;
}

.position-details strong {
  color: #111111;
  margin-right: 8px;
}

/* ── Apply Button ── */
.apply-cta {
  margin-top: 40px;
}

.apply-btn {
  display: inline-block;
  font-family: inherit;
  font-size: 15.4px;
  padding: 8px 24px;
  background: #111111;
  color: #FFFEFA;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: background 150ms ease;
}

.apply-btn:hover {
  background: #333333;
  color: #FFFEFA;
}

/* ── Contact Form ── */
.contact-form {
  max-width: 480px;
  margin: 24px 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #111111;
}

.form-group input,
.form-group textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 8px 0;
  border: none;
  border-bottom: 1px solid #d1d5db;
  background: transparent;
  color: #111111;
  outline: none;
  transition: border-color 150ms ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-bottom-color: #0B1F3B;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-submit {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 24px;
  background: #111111;
  color: #FFFEFA;
  border: none;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 150ms ease;
}

.form-submit:hover {
  background: #333333;
}

.form-success p {
  text-align: center;
  color: #6B7280;
  font-style: italic;
}

/* ── References / Footer ── */
.references {
  margin-bottom: 0;
  padding-top: 32px;
  border-top: 1px solid #e5e7eb;
}

.footer-info {
  font-size: 14px;
  color: #6B7280;
  text-align: center;
  white-space: normal;
}

.footer-info a {
  color: #6B7280;
}

.footer-end {
  text-align: center;
  font-size: 12px;
  color: #d1d5db;
  margin-top: 24px;
  font-style: italic;
}

/* ── Margin TOC (desktop, 150% size) ── */
.margin-toc {
  display: none;
  position: fixed;
  top: 120px;
  width: 160px;
  font-size: 18px;
  line-height: 1.5;
  font-family: "Times New Roman", Times, "Noto Serif KR", serif;
}

.margin-toc ul {
  list-style: none;
  padding: 0;
}

.margin-toc a {
  color: #9ca3af;
  text-decoration: none;
  display: block;
  padding: 4px 0;
  transition: color 150ms ease;
}

.margin-toc a:hover,
.margin-toc a.active {
  color: #111111;
}

@media (min-width: 1300px) {
  .margin-toc {
    display: block;
    left: max(12px, calc((100vw - 900px) / 2 - 190px));
  }
}

/* ── Search Overlay ── */
.search-overlay {
  display: none;
  position: fixed;
  top: 48px;
  right: 12px;
  z-index: 1100;
  background: #FFFEFA;
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  align-items: center;
  gap: 8px;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
}

.search-overlay.open {
  display: flex;
}

.search-overlay input {
  font-family: inherit;
  font-size: 14px;
  border: none;
  outline: none;
  background: transparent;
  width: 200px;
  color: #111111;
}

.search-hint {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .mobile-br { display: block; }

  .paper {
    padding: 40px 28px;
  }

  .cover-title h1 {
    font-size: 32px;
  }

  .section {
    margin-bottom: 56px;
  }

  .section h2 {
    font-size: 18px;
  }

  .emphasis-block {
    font-size: 16px;
  }

  .contact-form {
    max-width: 100%;
  }

  #abstract {
    padding-left: 5%;
    padding-right: 5%;
  }

  .process-box {
    margin-left: -20px;
    margin-right: -20px;
    padding: 12px 10px;
  }
}

@media (max-width: 480px) {
  .paper {
    padding: 32px 20px;
  }

  .meta-info {
    font-size: 10px;
  }

  .cover-title h1 {
    font-size: 28px;
  }

  #abstract {
    padding-left: 0;
    padding-right: 0;
  }

  .process-box {
    margin-left: -16px;
    margin-right: -16px;
    padding: 10px 6px;
  }
}

/* ── Dark Mode ── */
body.dark {
  background: #1a1b1e;
  color: #c9cdd1;
}

body.dark .paper {
  background: #25262b;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

body.dark a {
  color: #7db4f0;
}

body.dark a:hover {
  color: #a5ccf5;
}

body.dark .top-bar {
  background: rgba(37, 38, 43, 0.96);
  border-bottom-color: #3f4046;
}

body.dark .top-bar-actions a,
body.dark .top-sep,
body.dark .toc-toggle-btn {
  color: #71717a;
}

body.dark .top-bar-actions a:hover {
  color: #c9cdd1;
}

body.dark .top-bar-actions a.active {
  color: #c9cdd1;
}

body.dark .theme-toggle {
  color: #71717a;
  border-color: #3f4046;
}

body.dark .theme-toggle:hover {
  color: #c9cdd1;
  border-color: #71717a;
}

body.dark .toc-dropdown {
  background: rgba(37, 38, 43, 0.96);
}

body.dark .toc-dropdown a {
  color: #c9cdd1;
}

body.dark .toc-dropdown a:hover {
  color: #7db4f0;
}

body.dark .top-bar-logo-img {
  filter: brightness(100);
}

body.dark .meta-info span {
  color: #8b8f96;
}

body.dark .cover-subtitle {
  color: #9ca0a8;
}

body.dark .cover-disclaimer {
  color: #8b8f96;
}

body.dark .section-rule {
  border-top-color: #3f4046;
}

body.dark .strategy-list dd {
  color: #a0a4ab;
}

body.dark .person {
  border-bottom-color: #2e2f34;
}

body.dark .person-role {
  color: #a0a4ab;
}

body.dark .person-quote {
  color: #a0a4ab;
  border-left-color: #4a4b52;
}

body.dark .person-history li {
  color: #a0a4ab;
}

body.dark .person-history li::before {
  display: none !important;
}

body.dark .process-box {
  border-color: #3f4046;
}

body.dark .position {
  border-bottom-color: #2e2f34;
}

body.dark .position-details strong {
  color: #c9cdd1;
}

body.dark .position-details p {
  color: #a0a4ab;
}

body.dark .apply-btn {
  background: #c9cdd1;
  color: #25262b;
}

body.dark .apply-btn:hover {
  background: #e5e7eb;
  color: #25262b;
}

body.dark .form-group label {
  color: #c9cdd1;
}

body.dark .form-group input,
body.dark .form-group textarea {
  color: #c9cdd1;
  border-bottom-color: #3f4046;
}

body.dark .form-group input:focus,
body.dark .form-group textarea:focus {
  border-bottom-color: #7db4f0;
}

body.dark .form-submit {
  background: #c9cdd1;
  color: #25262b;
}

body.dark .form-submit:hover {
  background: #e5e7eb;
}

body.dark .form-success p {
  color: #a0a4ab;
}

body.dark .references {
  border-top-color: #3f4046;
}

body.dark .footer-info,
body.dark .footer-info a {
  color: #8b8f96;
}

body.dark .footer-end {
  color: #5c5f66;
}

body.dark .margin-toc a {
  color: #71717a;
}

body.dark .margin-toc a:hover,
body.dark .margin-toc a.active {
  color: #c9cdd1;
}

body.dark .search-overlay {
  background: #25262b;
  border-color: #3f4046;
}

body.dark .search-overlay input {
  color: #c9cdd1;
}

body.dark .search-hint {
  color: #5c5f66;
}

/* ── Print ── */
@media print {
  body {
    background: white;
    color: #111111;
    font-size: 12pt;
    line-height: 1.6;
  }

  .page-bg {
    padding: 0;
  }

  .paper {
    box-shadow: none;
    border: none;
    padding: 0;
    max-width: none;
    background: white;
  }

  .top-bar,
  .margin-toc,
  .search-overlay {
    display: none !important;
  }

  .section-rule {
    display: none;
  }

  .section {
    page-break-inside: avoid;
  }

  #introduction,
  #team,
  #career,
  #contact-section {
    page-break-before: always;
  }

  a {
    color: #111111;
  }

  .cover {
    margin-bottom: 48px;
  }

  @page {
    margin: 2.5cm;
  }
}
