/* ----------------------------------------------------------------------------
   Hours
   ------------------------------------------------------------------------- */
:root { --hours: 84; }
body.page-japanese { --hours: 1536; }



/* ---------------------------------------------------------------------------
   Root styling
   ------------------------------------------------------------------------- */
:root {

  --color-bg:        #fafaf8;
  --color-surface:   #ffffff;
  --color-text:      #1a1a1a;
  --color-muted:     #6b7280;
  --color-border:    #e5e7eb;
  --color-accent:    #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-orange: #e8541a;
  --color-darkorange: #b34700;

  --font-body:   'Noto Sans', sans-serif;
  --font-ui:     'Noto Sans', sans-serif;

  --width-content: 680px;
  --width-wide:    960px;

  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  2rem;
  --space-xl:  4rem;
}


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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

footer {
  color: var(--color-muted);
  text-align: right;
  margin-right: var(--space-sm);
}

img, video {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-accent-hover);
}

main {
  flex: 1;
  max-width: 1050px;
  margin-inline: auto;
  padding: var(--space-xl);
}

ul, ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ui);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

.header-anchor {
  opacity: 0;
  text-decoration: none;
  color: var(--color-muted);
  margin-left: 0.4em;
  font-size: 0.85em;
  transition: opacity 0.03s;
}

h2:hover .header-anchor {
  opacity: 1;
}

p {
  margin-bottom: var(--space-md);
}

/* Tight spacing when headings follow each other */
h1 + h2, h2 + h3 { margin-top: var(--space-sm); }

blockquote {
  border-left: 3px solid var(--color-accent);
  margin-left: 0;
  padding: var(--space-sm) var(--space-md);
  color: var(--color-muted);
  font-style: italic;
}

code {
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
  background: var(--color-border);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: var(--space-md);
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: var(--space-md);
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-xl);
}


/* ----------------------------------------------------------------------------
    Header
   ------------------------------------------------------------------------- */
.site-header {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border);
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  height: 150px;
}
.site-header nav {
  margin-left: auto;
  display: flex;
  gap: var(--space-lg);
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  white-space: nowrap;
}
.site-header nav a {
  text-decoration: none;
  color: var(--color-text);
}
.site-header nav a:hover {
  color: var(--color-orange);
}



/* ----------------------------------------------------------------------------
    Progress Bar
   ------------------------------------------------------------------------- */
.track-wrap {
  flex: 1;
  padding: 90px 0 50px;
}

.track {
  position: relative;
  height: 12px;
  background: var(--color-border);
}

.fill {
  height: 100%;
  width: calc(var(--hours) / 3000 * 100%);
  background: var(--color-orange);
}

.marker {
  position: absolute;
  top: 0;
  height: var(--tick, 0px);        /* marker is as tall as its tick */
  transform: translateX(-50%) translateY(calc(-1 * var(--tick, 0px)));
  /* shift upward so marker bottom sits flush with track top */
}

.marker__tick {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: var(--tick, 0px);
  background: var(--color-border);
}

.marker__label {
  position: absolute;
  bottom: 100%;                    /* above the marker = above the tick */
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  font-family: var(--font-ui);
  color: var(--color-muted);
  text-align: center;
  padding-bottom: 3px;
}

/* Below-bar markers */
.marker--below {
  height: 0;
  top: 12px;                       /* below the track */
  transform: translateX(-50%);     /* no upward shift */
}

.marker__label--below {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  font-family: var(--font-ui);
  color: var(--color-muted);
  text-align: center;
  line-height: 1.4;
}


/* ----------------------------------------------------------------------------
    (Chinese) Posts
   ------------------------------------------------------------------------- */
.date-header {
  color: var(--color-muted);
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.date-header .hours::after { content: ' hours'; }



/* ----------------------------------------------------------------------------
    Dark theme
   ------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:           #2f2f2f;
    --color-surface:      #383838;
    --color-text:         #e0ddd8;
    --color-muted:        #9a9690;
    --color-border:       #444440;
    --color-accent:       #7aa2d4;
    --color-accent-hover: #9ab8e0;
    --color-orange:       #d45f30;
    --color-darkorange:   #b34a22;
  }

  pre {
    background: #272725;
  }

  td {
    color: var(--color-surface);
  }
}



/* ----------------------------------------------------------------------------
    Roadmap table styling
   ------------------------------------------------------------------------- */
table {
  border-collapse: collapse;
  margin-bottom: 30px;
}
th, td {
  border: 1px solid #ccc;
  padding: 4px 8px;
  text-align: center;
}
th {
  font-weight: bold;
}
caption {
  font-weight: bold;
  margin-bottom: 6px;
  font-size: 11pt;
}
td:first-child, th:first-child {
  text-align: left;
}
.row-3  {
  background-color: #d9ead3;
}
.row-4  {
  background-color: #c9daf8;
}
.row-5  {
  background-color: #d9d2e9;
}
.row-6  {
  background-color: #fff2cc;
}
.row-7  {
  background-color: #f4cccc;
}
