:root {
  color-scheme: light;
  --page-bg: #EAF2FF;
}
html, body {
  height: 100%;
  margin: 0;
  background-color: var(--page-bg);
  color: #111;
  font-family: Arial, sans-serif;
}

/* Page layout */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Home vs. inner pages alignment */
body.home {
  text-align: center;
  align-items: center;
}

body.page {
  text-align: left;
  align-items: stretch;
}

/* Top navigation (same on all pages; no horizontal rule) */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  /* Opaque full-width bar that matches the page background */
  background-color: var(--page-bg);

  /* Increase bar height without creating a gap above it */
  padding-top: calc(env(safe-area-inset-top) + 14px);
  padding-right: 16px;
  padding-bottom: 14px;
  padding-left: 16px;
  box-sizing: border-box;

  display: flex;
  justify-content: center;
  gap: 28px;

  /* Prevent overlap when the nav wraps on narrow screens */
  flex-wrap: wrap;
  row-gap: 8px;

  font-size: 16px;

  /* Keep the bar solid; don't fade the container opacity */
  opacity: 1;
  animation: none;

  z-index: 1000;

  /* Optional subtle separator */
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}


.nav a {
  color: #111;
  text-decoration: none;
  letter-spacing: 0.2px;
  opacity: 0;
  animation: fadeIn 1.25s ease 0.75s forwards;
}

.nav a:hover, .nav a:focus {
  text-decoration: underline;
  outline: none;
}

/* HOME: hero */
.content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* HOME: logo + TM + subtitle */
.phi {
  font-size: calc(25vmax + 25vmin);
  font-style: italic;
  font-weight: bold;
  opacity: 0;
  animation: fadeIn 2s ease forwards;
  position: relative;
  display: inline-block;
}

.phi .tm {
  font-size: 2vmin;
  position: absolute;
  left: 105%;
  top: 33%;
}

.subtitle {
  font-size: 2vw;
  opacity: 0;
  animation: fadeIn 2s ease 3s forwards;
}

/* Shared footer container (home uses links + social; pages can use only copyright) */
.footer {
  width: 100%;
  padding: 0 16px 18px;
  box-sizing: border-box;
  opacity: 0;
  animation: fadeIn 1.5s ease 4.25s forwards;
  text-align: center;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 10px;
}

.footer-links a {
  color: #111;
  text-decoration: none;
}

.footer-links a:hover, .footer-links a:focus {
  text-decoration: underline;
  outline: none;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.copyright {
  font-size: 12px;
  color: #111;
}

/* INNER PAGES: content area */
.page-main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 96px 18px 54px; /* top padding avoids fixed nav overlap */
  box-sizing: border-box;
  text-align: left;
}

.page-main h1 {
  margin: 0 0 18px;
  font-size: 32px;
  letter-spacing: -0.2px;
}

.page-main p {
  margin: 0 0 16px;
  line-height: 1.75;
  font-size: 16px;
}

.page-main p:last-child { margin-bottom: 0; }

.page-main a { color: #111; }
.page-main a:hover, .page-main a:focus { text-decoration: underline; outline: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile tweaks */
@media (max-width: 800px) {
  .nav { font-size: 14px; gap: 18px; }
  .subtitle { font-size: 18px; }

  /* Matches your existing mobile rule */
  .content { padding-top: 120px; }
  .phi { margin-top: clamp(-120px, -8vh, -60px); }

  .footer-links { font-size: 13px; }
  .copyright { font-size: 12px; }

  .page-main { padding-top: 120px; }
}

@media (max-width: 700px) {
  .page-main h1 { font-size: 26px; }
}
