:root {
  --brand-ink: #1a2b49;
  --brand-accent: #0e8c6f;
  --surface: #ffffff;
  --text-main: #1f2430;
}

body {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-main);
  line-height: 1.58;
  background:
    radial-gradient(circle at 15% -10%, rgba(14, 140, 111, 0.15), rgba(14, 140, 111, 0) 35%),
    radial-gradient(circle at 85% 0%, rgba(26, 43, 73, 0.14), rgba(26, 43, 73, 0) 35%),
    linear-gradient(180deg, #f9fbfc 0%, #ffffff 50%, #f7faf9 100%);
}

.masthead {
  border-bottom: 1px solid #d9e5e2;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(7px);
}

.masthead__menu-item a {
  font-weight: 600;
}

.page {
  background: var(--surface);
  border: 1px solid #e8eff0;
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(16, 45, 40, 0.06);
  padding: 1rem;
}

.page__title {
  color: var(--brand-ink);
  letter-spacing: 0.01em;
}

.page__content {
  font-size: 1.03rem;
  line-height: 1.62;
}

.page__content p {
  margin-bottom: 0.72rem;
}

.page__content h2 {
  margin-top: 1.7rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid #dde6ef;
}

.page__content h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.page__content ul,
.page__content ol {
  margin-top: 0.5rem;
  margin-bottom: 0.8rem;
}

.page__content li {
  margin-bottom: 0.24rem;
}

hr {
  margin: 1.4rem 0;
}

.hero {
  text-align: center;
}

.hero h1 {
  margin-bottom: 0.3rem;
}

.hero p {
  margin-bottom: 0.5rem;
}

a {
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.contact-form {
  margin-top: 0.9rem;
  max-width: 760px;
}

.contact-form label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--brand-ink);
  font-weight: 600;
}

.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 0.9rem;
  padding: 0.68rem 0.78rem;
  border: 1px solid #cfdce2;
  border-radius: 10px;
  background: #fbfcfd;
  color: var(--text-main);
  font: inherit;
  line-height: 1.45;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--brand-accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(14, 140, 111, 0.14);
}

.contact-form button[type="submit"] {
  border: 0;
  border-radius: 10px;
  padding: 0.6rem 1.05rem;
  background: var(--brand-accent);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background-color 0.16s ease;
  box-shadow: 0 8px 20px rgba(14, 140, 111, 0.2);
}

.contact-form button[type="submit"]:hover {
  background: #0b7a62;
  transform: translateY(-1px);
}

.contact-form button[type="submit"]:active {
  transform: translateY(0);
}

.contact-form button[type="submit"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 140, 111, 0.2), 0 8px 20px rgba(14, 140, 111, 0.2);
}

/* ── Visual Timeline ─────────────────────────────────────────── */

.timeline {
  position: relative;
  padding: 0.5rem 0 1rem;
  margin-top: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--brand-accent) 0%, #dde6ef 100%);
}

.timeline-entry {
  position: relative;
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.timeline-year {
  flex: 0 0 7rem;
  text-align: right;
  padding-top: 0.2rem;
  padding-right: 1.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-accent);
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.timeline-dot {
  position: absolute;
  left: calc(7rem - 5px);
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-accent);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px var(--brand-accent);
  z-index: 1;
}

.timeline-body {
  flex: 1;
  background: #f8fafb;
  border: 1px solid #e4edf0;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
}

/* Expandable card header */
.tl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  gap: 0.5rem;
  border-radius: 6px;
  margin: -0.2rem -0.2rem 0;
  padding: 0.2rem;
  transition: background-color 0.15s ease;
}

.tl-header:hover {
  background: rgba(14, 140, 111, 0.06);
}

.tl-header-text {
  flex: 1;
}

.tl-chevron {
  flex: 0 0 auto;
  color: #9aabb8;
  transition: transform 0.25s ease, color 0.15s ease;
  display: flex;
  align-items: center;
}

.tl-chevron.is-open {
  transform: rotate(180deg);
  color: var(--brand-accent);
}

/* Collapsible details */
.tl-details {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.25s ease;
  margin-top: 0;
}

.tl-details.is-open {
  max-height: 600px;
  opacity: 1;
  margin-top: 0.75rem;
}

.timeline-body h3 {
  margin: 0 0 0.15rem;
  font-size: 1rem;
  color: var(--brand-ink);
  border: none;
}

.timeline-body .tl-company {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-accent);
  margin-bottom: 0;
}

.timeline-body p {
  font-size: 0.93rem;
  color: #4a5568;
  margin-bottom: 0.55rem;
}

.timeline-body ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: #3d4a58;
}

.timeline-body ul li {
  margin-bottom: 0.22rem;
}

.timeline-education {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid #dde6ef;
}

.timeline-education h2 {
  color: var(--brand-ink);
  margin-bottom: 1rem;
}

.tl-edu-entry {
  margin-bottom: 0.9rem;
}

.tl-edu-entry strong {
  display: block;
  color: var(--brand-ink);
}

.tl-edu-entry span {
  font-size: 0.9rem;
  color: #5a6a7a;
}

@media (max-width: 640px) {
  .timeline::before {
    left: 0;
  }

  .timeline-entry {
    flex-direction: column;
    gap: 0.4rem;
    padding-left: 1.2rem;
  }

  .timeline-year {
    flex: none;
    text-align: left;
    padding-right: 0;
    padding-left: 0.8rem;
  }

  .timeline-dot {
    left: -5px;
  }

  .timeline-body {
    width: 100%;
  }
}

/* ── End Visual Timeline ─────────────────────────────────────── */

/* ── Patents Page ────────────────────────────────────────────── */

.patent-stats {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1 1 8rem;
  background: linear-gradient(135deg, var(--brand-ink) 0%, #243d66 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(26, 43, 73, 0.18);
}

.stat-card .stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
}

.stat-card .stat-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.3rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.patent-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.patent-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #f8fafb;
  border: 1px solid #e4edf0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.patent-card:hover {
  background: #ffffff;
  border-color: var(--brand-accent);
  box-shadow: 0 4px 14px rgba(14, 140, 111, 0.1);
  text-decoration: none;
  color: inherit;
}

.patent-card .patent-num {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-accent);
  letter-spacing: 0.03em;
  padding-top: 0.18rem;
  white-space: nowrap;
}

.patent-card .patent-title {
  flex: 1;
  font-size: 0.93rem;
  color: var(--brand-ink);
  line-height: 1.45;
}

.patent-card .patent-year {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: #8a9aaa;
  padding-top: 0.18rem;
}

.patent-footer {
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid #e4edf0;
  font-size: 0.93rem;
}

/* ── End Patents Page ────────────────────────────────────────── */

@media (max-width: 640px) {
  /* Stat cards: ensure dark background and white text survive theme overrides */
  .stat-card {
    flex: 1 1 100%;
    background: linear-gradient(135deg, var(--brand-ink) 0%, #243d66 100%) !important;
    color: #ffffff !important;
  }

  .stat-card .stat-number {
    color: #ffffff !important;
  }

  .stat-card .stat-label {
    color: rgba(255, 255, 255, 0.75) !important;
  }

  /* Patent cards: switch from row to column layout on mobile */
  .patent-card {
    display: block;
    padding: 0.75rem 0.9rem;
  }

  .patent-card .patent-num {
    display: block;
    margin-bottom: 0.25rem;
    white-space: normal;
  }

  .patent-card .patent-title {
    display: block;
    margin-bottom: 0.3rem;
  }

  .patent-card .patent-year {
    display: block;
    padding-top: 0;
  }
}

@media (max-width: 900px) {
  .page {
    border-radius: 10px;
    padding: 0.5rem;
  }
}
