/* ================================================
   MYTHOS STUDIOS — Single Viewport Landing
   BG: #DFDEDC | Text: black | Font: typewriter/mono
   ================================================ */

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

:root {
  --bg: #DFDEDC;
  --text: #111;
  --text-dim: #777;
  --font: 'Courier New', Courier, 'Lucida Console', monospace;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  cursor: crosshair;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

/* ===================== NOISE OVERLAY ===================== */
.noise {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ===================== CURSOR DOT ===================== */
#cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: left 0.15s var(--ease), top 0.15s var(--ease), opacity 0.3s;
}

/* ===================== LANDING (SINGLE VIEWPORT) ===================== */
.landing {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
}

.landing__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

/* ===================== LOGO ===================== */
.logo-reveal {
  overflow: hidden;
  position: relative;
}

.logo {
  display: block;
  max-width: min(480px, 75vw);
  height: auto;
  opacity: 0;
  transform: translateY(20px);
  animation: logoReveal 1.6s var(--ease-out) 0.4s forwards;
}

@keyframes logoReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  animation: curtainSlide 1s var(--ease-out) 0.2s forwards;
  transform-origin: right;
}

@keyframes curtainSlide {
  to {
    transform: scaleX(0);
  }
}

/* ===================== DIVIDER ===================== */
.divider {
  width: 0;
  height: 1px;
  background: var(--text);
  animation: dividerGrow 0.8s var(--ease) 1.4s forwards;
}

@keyframes dividerGrow {
  to {
    width: clamp(60px, 12vw, 120px);
  }
}

/* ===================== TAGLINE ===================== */
.tagline-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.6em;
}

.tagline {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  opacity: 0;
  animation: fadeIn 0.01s 2.2s forwards;
}

.tagline-cursor {
  font-weight: 100;
  opacity: 0;
  animation: fadeIn 0.01s 2.2s forwards, blink 0.8s step-end infinite 2.2s;
  margin-left: 2px;
}

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

@keyframes blink {
  50% { opacity: 0; }
}

/* ===================== CTAs ===================== */
.ctas {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-top: 0.5rem;
  opacity: 0;
  animation: fadeSlideUp 0.8s var(--ease-out) 3.8s forwards;
}

.cta {
  font-family: var(--font);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.cta--primary {
  padding: 0.7rem 2rem;
  color: var(--bg);
  background: var(--text);
  border: 1px solid var(--text);
}

.cta--primary:hover {
  color: var(--text);
  background: transparent;
}

.cta--secondary {
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 0.7rem 0;
  border-bottom: 1px solid transparent;
}

.cta--secondary:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================== FOOTER ===================== */
.landing__footer {
  position: absolute;
  bottom: 1.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0;
  animation: fadeIn 0.01s 4.5s forwards;
  text-align: center;
}

.landing__footer p:first-child {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  margin-bottom: 0.4rem;
}

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background 0.4s var(--ease);
}

.modal-overlay.open {
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.modal {
  background: var(--bg);
  width: min(500px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 3rem 2.5rem;
  position: relative;
  opacity: 0;
  transform: translateY(30px) scale(0.97);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.modal-overlay.open .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal__close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 3rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  line-height: 1;
  padding: 0.5rem;
  transition: opacity 0.2s;
}

.modal__close:hover {
  opacity: 0.5;
}

.modal__title {
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

/* ===================== CONTACT MODAL CONTENT ===================== */
.contact-modal__content {
  text-align: center;
  max-width: 500px;
  width: 100%;
}

/* ===================== CONTACT FORM ===================== */
.contact-form {
  text-align: left;
  margin-top: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  color: var(--text-dim);
}

.form-input {
  width: 100%;
  padding: 0.6rem 0;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text);
  outline: none;
  transition: border-color 0.3s;
  letter-spacing: 0.02em;
}

.form-input::placeholder {
  color: #aaa;
  font-style: italic;
}

.form-input:focus {
  border-bottom-width: 2px;
}

.form-input--textarea {
  resize: vertical;
  min-height: 80px;
  border: 1px solid var(--text);
  padding: 0.6rem;
  margin-top: 0.25rem;
}

.form-input--textarea:focus {
  border-width: 2px;
}

.form-input.invalid {
  border-color: #a33;
}

.form-error {
  display: none;
  font-size: 0.7rem;
  color: #a33;
  margin-top: 0.3rem;
  letter-spacing: 0.05em;
}

.form-input.invalid ~ .form-error {
  display: block;
}

.form-submit {
  display: inline-block;
  padding: 0.7rem 2.5rem;
  font-family: var(--font);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--text);
  border: 1px solid var(--text);
  cursor: pointer;
  transition: color 0.3s, background 0.3s;
  margin-top: 0.5rem;
}

.form-submit:hover {
  color: var(--text);
  background: transparent;
}

.form-submit__loading {
  display: none;
}

.form-submit.loading .form-submit__text {
  display: none;
}

.form-submit.loading .form-submit__loading {
  display: inline;
}

.form-success {
  display: none;
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--text);
  text-align: center;
  letter-spacing: 0.05em;
  line-height: 1.8;
  font-size: 0.9rem;
  animation: fadeSlideUp 0.6s var(--ease-out);
}

.form-success.visible {
  display: block;
}

/* ===================== ABOUT MODAL (FULL PAGE) ===================== */
.modal--full {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.about-modal__content {
  text-align: center;
  max-width: 800px;
}

.about-modal__mark {
  width: 40px;
  height: 40px;
  opacity: 0.5;
  margin-bottom: 2rem;
}

.ethos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin: 3rem 0;
}

.ethos-card {
  padding: 2rem 1.2rem;
  border: 1px solid transparent;
  transition: border-color 0.5s var(--ease);
  position: relative;
}

.ethos-card:hover {
  border-color: var(--text);
}

.ethos-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width 0.5s var(--ease), left 0.5s var(--ease);
}

.ethos-card:hover::before {
  width: 100%;
  left: 0;
}

.ethos-card__num {
  display: block;
  font-size: 1.8rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
  opacity: 0.25;
}

.ethos-card__text {
  font-size: 0.85rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.about-modal__footer {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 1rem;
}

.about-modal__cta,
.about-modal__close-link {
  display: block;
  margin: 0 auto;
  font-family: var(--font);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s;
}

.about-modal__cta {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--text);
}

.about-modal__cta:hover {
  opacity: 0.6;
}

.about-modal__close-link {
  margin-top: 1rem;
}

.about-modal__close-link:hover {
  color: var(--text);
}

/* Stagger ethos cards in about modal */
.modal-overlay.open .ethos-card {
  animation: fadeSlideUp 0.6s var(--ease-out) backwards;
}

.modal-overlay.open .ethos-card:nth-child(1) { animation-delay: 0.15s; }
.modal-overlay.open .ethos-card:nth-child(2) { animation-delay: 0.3s; }
.modal-overlay.open .ethos-card:nth-child(3) { animation-delay: 0.45s; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 600px) {
  .ctas {
    flex-direction: column;
    gap: 0.8rem;
  }

  .logo {
    max-width: 85vw;
  }

  .modal {
    padding: 2rem 1.5rem;
  }

  .modal--full {
    padding: 2rem 1.5rem;
  }

  .ethos-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .logo {
    opacity: 1;
    transform: none;
  }

  .ctas,
  .landing__footer {
    opacity: 1;
  }
}
