/* ==========================================================
   TrAuSt — Restoring Trust in Civic Discourse
   style.css
   ========================================================== */

/* --- Design tokens ---------------------------------------- */
/* --- Design tokens ---------------------------------------- */
:root {
  --canvas:      #050510;   /* deep space void */
  --surface:     #0c0f22;   /* main card / ship interior */
  --bar:         #080916;   /* dark nav bar */
  --ink:         #e8f0fe;   /* starlight text */
  --ink-muted:   #8a99b3;   /* distant stars / sub text */
  --rule:        #1f2445;   /* subtle dark-mode line */
  --accent:      #00f0ff;   /* neon cyan brand color */
  --accent-deep: #bc13fe;   /* neon purple for hover */

  --font-display: "Orbitron", "Space Mono", "Newsreader", Georgia, serif;
  --font-body:    "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --measure: 68ch;   /* main text max width */
  --gutter:  clamp(1.5rem, 6vw, 5rem);
}

/* --- Base ------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #000; /* Dark text on bright neon cyan for contrast */
  z-index: 10;
}
.skip-link:focus { left: 0; }

/* --- Page shell ------------------------------------------- */
.page {
  max-width: 100%;
  margin: 0;
  background: transparent;
  box-shadow: none; 
}

/* --- Navigation bar --------------------------------------- */
.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  transition: transform 0.3s ease;
}

.masthead.nav-hidden {
  transform: translateY(-100%);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between; 
  gap: 1rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem); 
  min-height: clamp(50px, 6vw, 75px);
  max-width: 100%; 
  margin: 0; 
  font-weight: 800;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.18s ease;
}

.brand:hover,
.brand:focus-visible {
  color: var(--accent); 
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 2.75rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.nav-list a:hover,
.nav-list a:focus-visible,
.nav-list a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  padding: 0;
  background: none;
  border: 1px solid var(--rule);
  cursor: pointer;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 18px; height: 2px;
  margin: 0 auto;
  background: var(--ink);
  content: "";
}
.nav-toggle-bar::before { transform: translateY(-6px); }
.nav-toggle-bar::after  { transform: translateY(4px); }

/* --- Content sheet ---------------------------------------- */
.sheet {
  padding: clamp(3rem, 8vw, 5.5rem) var(--gutter) clamp(3rem, 7vw, 4.5rem);
  max-width: 980px;
  margin: 0 auto;
}

/* --- Hero ------------------------------------------------- */
.hero { text-align: center; }

.hero-title {
  margin: 0;
  max-width: 18ch;
  margin-inline: auto;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.6vw, 3.4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
}

.crest {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 28rem;
  margin: clamp(2.25rem, 6vw, 3.25rem) auto 0;
}

.crest-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.crest-mark {
  flex: none;
  width: 92px;
  height: 92px;
  color: var(--ink);
}

.crest-mark svg,
img.crest-mark {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lede {
  max-width: 46ch;
  margin: clamp(2rem, 5vw, 2.75rem) auto 0;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink-muted);
}

/* --- News ------------------------------------------------- */
.news {
  max-width: var(--measure);
  margin: clamp(3.5rem, 9vw, 5.5rem) auto 0;
}

.section-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.record {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.record-item {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0 1.75rem;
  align-items: baseline;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}

.record-date {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.record-text {
  margin: 0;
  font-size: 1.02rem;
}

.record-text a {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* --- Footer ----------------------------------------------- */
.colophon {
  padding: 1.5rem var(--gutter) 2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--ink-muted);
  max-width: 980px;
  margin: 0 auto;
}
.colophon p { margin: 0; }

/* --- Responsive ------------------------------------------- */
@media (max-width: 640px) {
  body { font-size: 16px; }

  .nav { flex-wrap: wrap; }

  .nav-toggle { display: block; }

  .nav-list {
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.22s ease;
  }

  .nav-list.is-open {
    max-height: 260px;
    padding-bottom: 0.75rem;
  }

  .nav-list li { width: 100%; }

  .nav-list a {
    display: block;
    width: 100%;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(20, 24, 28, 0.08);
  }

  .crest { gap: 1rem; }
  .crest-mark { width: 74px; height: 74px; }

  .record-item {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}

/* --- Motion ----------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-title,
  .crest,
  .lede {
    animation: rise 0.6s ease both;
  }
  .crest { animation-delay: 0.08s; }
  .lede  { animation-delay: 0.16s; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
  }
}

/* --- Print ------------------------------------------------ */
@media print {
  body { 
    background: #fff; 
    color: #000; /* Ensure text is black when printing */
  }
  .page { box-shadow: none; max-width: none; }
  .masthead { position: static; }
}

/* ==========================================================
   Team page
   ========================================================== */
 
.sheet.is-team {
  padding-top: clamp(1.75rem, 4vw, 2.75rem);
}
 
/* --- Group photo ------------------------------------------ */
.group-photo {
  margin: 0;
  background: var(--bar);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
 
.group-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
 
/* --- Roster ----------------------------------------------- */
.roster {
  margin-top: clamp(2.75rem, 7vw, 4.25rem);
}
 
.roster-title {
  margin: 0 0 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.2vw, 1.9rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}
 
.roster-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3.5vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
 
.person-name {
  margin: 0.85rem 0 0;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
 
.person-role {
  margin: 0.15rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-muted);
}
 
/* --- Flip card -------------------------------------------- */
.card {
  perspective: 1100px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
}

.card.is-flipped {
  z-index: 2;
}
 
.card-inner {
  position: relative;
  aspect-ratio: 4 / 5;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}
 
@media (hover: hover) and (pointer: fine) {

    .card:hover .card-inner {
        transform: rotateY(180deg);
    }

}

/* Touch devices use only the JavaScript class */
.card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card.is-flipped {
    z-index:2;
}
 
.card-face{

    position:absolute;

    inset:0;

    overflow:hidden;

    backface-visibility:hidden;

    -webkit-backface-visibility:hidden;

}
 
.card-front {
  background: var(--bar);
}
 
.card-front img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person {
  display: flex;
  flex-direction: column;
}

.card {
  width: 100%;
}
 
/* --- Flip card -------------------------------------------- */

.card-front{

    background:var(--bar);

    transform:rotateY(0deg);

}

.card-bio{

    flex:1;

    overflow-y:auto;

    font-size:.82rem;

    line-height:1.5;

    margin-bottom:.75rem;

}
 
.card-back{

    position:absolute;

    inset:0;

    display:flex;

    flex-direction:column;

    justify-content:space-between;

    padding:1rem;

    overflow:hidden;

    background:var(--surface);

    transform:rotateY(180deg);

    backface-visibility:hidden;

    -webkit-backface-visibility:hidden;

}
 
.card-link {
  align-self: flex-start;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}
 
.card-link::after { content: " \2197"; }
.card-link:hover { color: var(--accent-deep); border-bottom-color: var(--accent-deep); }
 
@media (prefers-reduced-motion: reduce) {
  .card-inner { transition: none; }
}
 
/* --- Responsive ------------------------------------------- */
@media (max-width: 780px) {
  .roster-grid { grid-template-columns: repeat(2, 1fr); }
}
 
@media (max-width: 460px) {
  .roster-grid { grid-template-columns: 1fr; max-width: 300px; }
  .group-photo { aspect-ratio: 4 / 3; }
}

/* --- Starfield Background --------------------------------- */
.starfield, 
.starfield-layer-2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1; /* Keeps the stars strictly behind your main content card */
  pointer-events: none; /* Ensures the stars don't block you from clicking links */
}

/* Layer 1: Smaller, faster moving stars */
.starfield {
  background: 
    radial-gradient(1px 1px at 20px 30px, var(--ink), transparent),
    radial-gradient(1px 1px at 40px 70px, var(--ink-muted), transparent),
    radial-gradient(1.5px 1.5px at 90px 40px, var(--ink), transparent),
    radial-gradient(2px 2px at 160px 120px, var(--accent), transparent);
  background-size: 200px 200px; /* The pattern repeats every 200px */
  animation: starDrift 60s linear infinite;
}

/* Layer 2: Larger, slower moving stars for depth */
.starfield-layer-2 {
  background: 
    radial-gradient(1.5px 1.5px at 50px 160px, var(--ink), transparent),
    radial-gradient(1px 1px at 90px 40px, var(--accent-deep), transparent),
    radial-gradient(2px 2px at 130px 80px, var(--ink-muted), transparent);
  background-size: 300px 300px; /* A larger pattern box so it offsets layer 1 */
  animation: starDrift 100s linear infinite;
}

/* The animation that moves the background image downwards forever */
@keyframes starDrift {
  from { background-position: 0 0; }
  to   { background-position: 0 1000px; }
}