@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Merriweather:wght@400;700&display=swap');

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

:root {
  --cream: #f7f2ea;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  font-family: 'Merriweather', serif;
  background-color: #f7f2ea;
  background-image:
    url('img/palm-shadow-processed.webp'),
    url('img/paper-texture-processed.jpg');
  background-repeat: no-repeat, no-repeat;
  background-position: left top, center;
  background-size: auto 100%, cover;
  background-attachment: fixed, fixed;
  opacity: 0;
  transition: opacity 0.7s ease;
}

body.is-loaded {
  opacity: 1;
}

/* ---------- hero (headpiece + nav) ---------- */

.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -10vh;
}

.headpiece-wrap {
  display: flex;
  justify-content: center;
}

.headpiece {
  width: 100%;
  max-width: 600px;
  height: auto;
}

/* ---------- nav ---------- */

.main-nav {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 0.5rem 0 0;
  font-family: 'Special Elite', cursive;
}

.main-nav.is-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 0;
  background: rgba(247, 242, 234, 0.92);
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 100;
}

.main-nav a {
  color: #2b2b2b;
  text-decoration: none;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.main-nav a:hover {
  color: #000000;
}

/* ---------- scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- about ---------- */

.about-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1rem;
  scroll-margin-top: 4rem;
}

.about-img {
  width: 100%;
  max-width: 600px;
  height: auto;
}

/* ---------- lineage ---------- */

.lineage-wrap {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  scroll-margin-top: 4rem;
}

.lineage-image-wrap {
  position: relative;
  width: 100%;
}

.lineage-img {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 auto;
}

.lineage-text {
  position: absolute;
  top: 18%;
  left: 12%;
  width: 76%;
  font-family: 'Special Elite', cursive;
  color: #ffffff;
  text-align: left;
}

.lineage-heading {
  font-size: clamp(1.1rem, 5vw, 1.7rem);
  margin-bottom: clamp(0.6rem, 3vw, 1.2rem);
}

.lineage-line {
  font-size: clamp(0.72rem, 3.1vw, 1.05rem);
  line-height: 1.45;
  margin-bottom: 0.15rem;
}

.lineage-line:nth-of-type(5) {
  margin-bottom: 0.8rem; /* gap after Jonathan Shear, before education lines */
}

.lineage-line:nth-of-type(8) {
  margin-bottom: 0.8rem; /* gap after UCM, before Curriculum Vitae */
}

.lineage-line a {
  color: #ffffff;
  text-decoration: none;
}

.lineage-line a:hover {
  color: #000000;
}

/* ---------- projects ---------- */

.projects-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  scroll-margin-top: 4rem;
}

.strips {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 660px;
  height: 420px;
  gap: 0.5rem;
  margin: 0 auto;
}

.strip {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(43, 43, 43, 0.2);
  border-radius: 3px;
  transition: flex-grow 0.5s ease;
}

.strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transition: filter 0.5s ease, transform 0.5s ease;
  transform-origin: top center;
}

.strip[data-project="veda"]::before {
  background-image: url('img/california-poppy.jpg');
}

.strip[data-project="lex"]::before {
  background-image: url('img/mariposa-tulip.jpg');
}

.strip[data-project="dan"]::before {
  background-image: url('img/foothill-larkspur.jpg');
}

.strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  z-index: 1;
}

.strip.is-expanded {
  flex-grow: 6;
}

.strip.is-expanded::before {
  filter: blur(6px);
  transform: scale(1.15);
}

.strip.is-collapsed {
  flex-grow: 0.6;
}

.strip-label {
  position: absolute;
  top: 1.2rem;
  right: 0.8rem;
  z-index: 2;
  font-family: 'Special Elite', cursive;
  font-size: clamp(0.85rem, 3vw, 1.1rem);
  letter-spacing: 0.15em;
  color: #6b4a2a;
  transition: opacity 0.3s ease;
}

.strip.is-expanded .strip-label {
  opacity: 0;
  pointer-events: none;
}

.strip-panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transition: opacity 0.4s ease 0.2s;
}

.strip.is-expanded .strip-panel {
  opacity: 1;
  pointer-events: auto;
}

.strip-panel h3 {
  font-family: 'Special Elite', cursive;
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  margin-bottom: 0.75rem;
  color: #2b2b2b;
}

.strip-panel p {
  font-size: clamp(0.8rem, 2.8vw, 0.95rem);
  line-height: 1.5;
  margin-bottom: 1rem;
  color: #2b2b2b;
}

.strip-link {
  font-family: 'Special Elite', cursive;
  color: #2b2b2b;
  text-decoration: none;
}

.strip-link:hover {
  color: #000000;
}

/* ---------- login page ---------- */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.login-box {
  width: 100%;
  max-width: 340px;
  padding: 2.75rem 2.25rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(43, 43, 43, 0.18);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(43, 43, 43, 0.08);
}

.login-title {
  font-family: 'Special Elite', cursive;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2b2b2b;
  padding-bottom: 1.2rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(43, 43, 43, 0.15);
}

.login-input {
  display: block;
  width: 100%;
  font-family: 'Merriweather', serif;
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(43, 43, 43, 0.3);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.5);
  color: #2b2b2b;
}

.login-input:focus {
  outline: none;
  border-color: #6b4a2a;
  background: rgba(255, 255, 255, 0.75);
}

.login-submit {
  width: 100%;
  font-family: 'Special Elite', cursive;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.7rem;
  border: 1px solid #2b2b2b;
  border-radius: 3px;
  background: transparent;
  color: #2b2b2b;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.login-submit:hover {
  background: #2b2b2b;
  color: #f7f2ea;
}

.login-submit:disabled {
  opacity: 0.5;
  cursor: default;
}

.login-status {
  font-family: 'Special Elite', cursive;
  font-size: 0.85rem;
  color: #6b4a2a;
  min-height: 1.2rem;
  margin-bottom: 1.5rem;
}

.login-back {
  font-family: 'Merriweather', serif;
  font-size: 0.85rem;
  color: #2b2b2b;
  text-decoration: none;
}

.login-back:hover {
  color: #000000;
}

/* ---------- footer ---------- */

.site-footer {
  text-align: center;
  padding: 3rem 1rem 3rem;
  margin: 0 1rem;
  border-top: 1px solid rgba(43, 43, 43, 0.15);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 1rem;
  font-family: 'Special Elite', cursive;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-links a {
  color: #6b4a2a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #2b2b2b;
}

.footer-copyright {
  font-family: 'Merriweather', serif;
  font-style: italic;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: rgba(43, 43, 43, 0.45);
}

/* ---------- mobile adjustments ---------- */

@media (max-width: 600px) {
  .main-nav {
    gap: 1.5rem;
  }

  .main-nav a {
    font-size: 1rem;
  }

  .strips {
    height: 210px;
    gap: 0.35rem;
  }

  .strip-panel {
    padding: 1rem;
  }

  .lineage-text {
    top: 12%;
  }

  .about-wrap,
  .projects-wrap,
  .lineage-wrap {
    min-height: auto;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

@media (max-height: 500px) {
  .hero-inner {
    margin-top: 0;
  }
}

/* ---------- lexicon popup modal ---------- */

.lex-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.lex-modal-backdrop.is-open {
  display: flex;
}

.lex-modal {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1100 / 1562;
}

.lex-modal-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lex-modal-close {
  position: absolute;
  top: 2%;
  right: 4%;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #2b2b2b;
  cursor: pointer;
  z-index: 2;
}

.lex-modal-close:hover {
  color: #000000;
}

.lex-modal-input {
  position: absolute;
  top: 36.5%;
  left: 45.5%;
  width: 50%;
  height: 3%;
  font-family: 'Special Elite', cursive;
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  color: #2b2b2b;
  background: transparent;
  border: none;
  outline: none;
}

.lex-modal-results {
  position: absolute;
  top: 46%;
  left: 12.2%;
  width: 75.6%;
  height: 48%;
  overflow-y: auto;
  font-family: 'Merriweather', serif;
  color: #2b2b2b;
  scrollbar-width: thin;
  scrollbar-color: rgba(43, 43, 43, 0.3) transparent;
}

.lex-modal-results::-webkit-scrollbar {
  width: 5px;
}

.lex-modal-results::-webkit-scrollbar-track {
  background: transparent;
}

.lex-modal-results::-webkit-scrollbar-thumb {
  background-color: rgba(43, 43, 43, 0.3);
  border-radius: 3px;
}

.lex-modal-results::-webkit-scrollbar-thumb:hover {
  background-color: rgba(43, 43, 43, 0.5);
}

.lex-modal-results .lex-entry {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(43, 43, 43, 0.15);
}

.lex-modal-results .lex-entry:last-child {
  border-bottom: none;
}

.lex-modal-results .lex-term {
  font-family: 'Special Elite', cursive;
  font-size: clamp(0.88rem, 2.8vw, 1.02rem);
  margin-bottom: 0.2rem;
}

.lex-modal-results .lex-definition {
  font-size: clamp(0.72rem, 2.2vw, 0.84rem);
  line-height: 1.5;
}

.lex-modal-results .lex-status {
  font-family: 'Special Elite', cursive;
  font-size: 0.85rem;
  color: #6b4a2a;
  text-align: center;
  margin-top: 1rem;
}
