/* ============================================================
   DIGITOTE — base theme
   Light (default): text #002955 on white
   Dark: colors reversed
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f4f7fb;
  --text: #002955;
  --text-soft: #3a5a80;
  --accent: #002955;
  --border: rgba(0, 41, 85, 0.16);
  --shadow: rgba(0, 41, 85, 0.12);
  --header-bg: rgba(255, 255, 255, 0.92);

  --font: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  --max-width: 1100px;
}

html[data-theme="dark"] {
  --bg: #002955;
  --bg-alt: #023266;
  --text: #ffffff;
  --text-soft: #cfe0f5;
  --accent: #ffffff;
  --border: rgba(255, 255, 255, 0.22);
  --shadow: rgba(0, 0, 0, 0.35);
  --header-bg: rgba(0, 41, 85, 0.92);
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

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

a:hover {
  opacity: 0.75;
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 0.9em;
}

h2 {
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  margin: 1.4em 0 0.6em;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

ul ul {
  margin: 0.3em 0 0.3em;
}

li {
  margin: 0.25em 0;
}

/* ============================================================
   Intro animation
   ============================================================ */

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  overflow: hidden;
}

.intro-logo {
  width: 60px;
  max-width: none;
  opacity: 0;
  transform: scale(1);
  transition: width 1.4s cubic-bezier(0.22, 0.9, 0.24, 1),
              opacity 0.6s ease;
}

.intro-logo.is-visible {
  opacity: 1;
}

.intro-logo.is-expanded {
  width: 100vw;
}

.intro.is-leaving {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.intro[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .intro-logo {
    transition: opacity 0.4s ease;
  }
}

/* ============================================================
   Header / nav
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: saturate(150%) blur(6px);
  border-bottom: 1px solid var(--border);
  animation: fade-down 0.6s ease both;
}

.site-header[hidden],
.site-main[hidden],
.site-footer[hidden] {
  display: none;
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo-button {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
}

.site-logo {
  height: 42px;
  width: auto;
  transition: filter 0.3s ease;
}

html[data-theme="dark"] .site-logo {
  filter: brightness(0) invert(1);
}

.tabs {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

.tab {
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text);
  padding: 0.6rem 0.2rem;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.tab:hover {
  opacity: 1;
}

.tab[aria-selected="true"] {
  opacity: 1;
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  cursor: pointer;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ============================================================
   Main content
   ============================================================ */

.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.4rem 1.25rem 3rem;
  min-height: 50vh;
  animation: fade-up 0.7s ease both;
  animation-delay: 0.1s;
}

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

.panel[hidden] {
  display: none;
}

.panel-loading {
  color: var(--text-soft);
  font-style: italic;
}

/* ============================================================
   Theme tab
   ============================================================ */

.theme-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.theme-option {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1.3rem;
  background: none;
  color: var(--text);
  cursor: pointer;
  opacity: 0.6;
  transition: background-color 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.theme-option[aria-pressed="true"] {
  opacity: 1;
  background: var(--accent);
  color: var(--bg);
}

/* ============================================================
   Timeline (HISTORY tab)
   ============================================================ */

.timeline {
  position: relative;
  margin: 2.5rem 0 1.5rem;
  padding-left: 1.4rem;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.8rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.85rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-year {
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.25em;
}

.timeline-content p {
  margin: 0 0 0.3em;
}

@media (min-width: 760px) {
  .timeline {
    padding-left: 1.8rem;
    max-width: 640px;
  }

  .timeline-item::before {
    left: -2.25rem;
    width: 12px;
    height: 12px;
  }

  .timeline-content p {
    font-size: 0.98rem;
  }
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2.2rem 1.25rem 2.4rem;
  animation: fade-up 0.7s ease both;
  animation-delay: 0.15s;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.footer-info p {
  margin: 0 0 0.35em;
}

.footer-info .footer-company {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
}

.footer-info hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0.8em 0;
}

.social-media-links {
  display: flex;
  gap: 0.9rem;
}

.social-media-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.social-media-links a:hover {
  background: var(--accent);
  color: var(--bg);
  opacity: 1;
}

/* ============================================================
   Responsive nav collapse
   ============================================================ */

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .tabs {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 16px var(--shadow);
    padding: 0.5rem 1.25rem 1rem;
    gap: 0;
    display: none;
  }

  .tabs.is-open {
    display: flex;
  }

  .tab {
    text-align: left;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .site-main {
    padding-top: 1.8rem;
  }
}
