/* ============================================================
   pages.css — About and Contact page styles
   Darkroom Portfolio — Phase 5 Pages and Performance
   ============================================================
   Inherits design tokens from tokens.css.
   Both page sections maintain the darkroom aesthetic:
   dark backgrounds, warm accent tones, Playfair Display serif.
   ============================================================ */

/* ---- Shared Page Layout ---- */

/* Override .scene's fixed height + overflow:hidden so pages can scroll */
#contact {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: url('/images/darkroom/desk.png') center center / cover no-repeat;
  background-color: #1a1410;
}

/* About uses tray layout — fixed viewport on desktop, scrollable on mobile */
#about {
  height: 100vh;
  overflow: hidden;
}

.page__inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Back button — styled to match .gallery__back in gallery.css */
.page__back {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 100;
  background: transparent;
  border: 1px solid rgba(200, 144, 42, 0.4);
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}

.page__back:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ---- About Page — Developer Tray ---- */

/* Override shared page layout — tray is its own layout */
#about .page__back {
  z-index: 200;
}

/* Tray container */
.tray {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: url('/images/darkroom/tray.png') center / cover no-repeat;
  background-color: #2a1510;
}

/* Prints container — clipped to the tray basin so prints don't overflow onto the rim */
.tray__prints {
  position: absolute;
  top: 10%;
  left: 5%;
  width: 90%;
  height: 85%;
  z-index: 2;
  overflow: hidden;
  border-radius: 4px;
}

/* Individual print card */
.tray__print {
  position: absolute;
  background: #f5f0e8;
  border-radius: 2px;
  padding: 1rem 1.2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4),
              0 0 1px rgba(0, 0, 0, 0.2);
  color: #2a2218;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  line-height: 1.55;
  will-change: transform, opacity, filter;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.tray__print.is-dragging {
  cursor: grabbing;
  z-index: 50;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5),
              0 0 2px rgba(0, 0, 0, 0.3);
}

.tray__print p {
  margin: 0 0 0.6rem;
}

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

/* Print headings */
.tray__print-heading {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: #3a2a18;
  margin: 0 0 0.5rem;
  letter-spacing: 0.03em;
}

/* Print lists */
.tray__print-list {
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 1.7;
  font-size: 0.75rem;
}

.tray__print-list a {
  color: #3a2a18;
  text-decoration: none;
  border-bottom: 1px solid rgba(60, 40, 20, 0.3);
  transition: color var(--duration-fast), border-color var(--duration-fast);
}

.tray__print-list a:hover {
  color: #8a5a1a;
  border-bottom-color: #8a5a1a;
}

.tray__print-list--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
}

.tray__print-list--two-col {
  columns: 2;
  column-gap: 1.2rem;
}

/*
 * Print layout — 3 rows, no overlaps
 * Row 1 (top 0-30%):  Portrait | Bio | CTA
 * Row 2 (top 32-58%): Clients  | Accolades
 * Row 3 (top 60-98%): Speaking | Press
 */

/* Portrait print */
.tray__print--portrait {
  top: 2%;
  left: 1%;
  width: 160px;
  padding: 0.6rem;
  text-align: center;
  transform: rotate(-2deg);
}

.tray__print-photo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1px;
}

.tray__print-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: #3a2a18;
  margin: 0.4rem 0 0;
}

/* Bio print */
.tray__print--bio {
  top: 1%;
  left: 22%;
  width: 42%;
  max-width: 440px;
  transform: rotate(1deg);
}

/* CTA print */
.tray__print--cta {
  top: 1%;
  left: 70%;
  width: 180px;
  text-align: center;
  transform: rotate(2deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

/* Clients print */
.tray__print--clients {
  top: 34%;
  left: 1%;
  width: 30%;
  max-width: 280px;
  transform: rotate(-1.5deg);
}

/* Accolades print */
.tray__print--accolades {
  top: 33%;
  left: 35%;
  width: 38%;
  max-width: 400px;
  transform: rotate(1.5deg);
}

/* Speaking print */
.tray__print--speaking {
  top: 62%;
  left: 1%;
  width: 34%;
  max-width: 360px;
  transform: rotate(1.5deg);
}

/* Press print */
.tray__print--press {
  top: 60%;
  left: 38%;
  width: 38%;
  max-width: 400px;
  transform: rotate(-1deg);
}

/* CTA button — restyled for dark-on-light print card */
.tray__print--cta .about__cta {
  background: rgba(60, 40, 20, 0.1);
  border: 1px solid #3a2a18;
  color: #3a2a18;
  padding: 0.5rem 1.2rem;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background var(--duration-fast);
}

.tray__print--cta .about__cta:hover {
  background: rgba(60, 40, 20, 0.2);
}

.tray__print--cta .about__contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tray__print--cta .about__contact-link {
  color: #3a2a18;
  opacity: 0.7;
  text-decoration: none;
  font-size: 0.8rem;
  transition: opacity var(--duration-fast);
}

.tray__print--cta a.about__contact-link:hover {
  opacity: 1;
  color: #8a5a1a;
}

.tray__print--cta .about__socials {
  display: flex;
  gap: 0.8rem;
}

.tray__print--cta .about__social-link {
  color: #3a2a18;
  opacity: 0.7;
  text-decoration: none;
  font-size: 0.8rem;
  transition: opacity var(--duration-fast);
}

.tray__print--cta .about__social-link:hover {
  opacity: 1;
  color: #8a5a1a;
}

/* ---- Mobile: Scrollable tray ---- */
@media (max-width: 768px) {
  #about {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .tray {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 4rem 0 3rem;
    background: url('/images/darkroom/tray%202.png') center top / 100% auto repeat-y;
    background-color: #8b3a2a;
  }

  .tray__prints {
    position: relative;
    top: auto;
    left: auto;
    width: 88%;
    margin: 0 auto;
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
  }

  .tray__print {
    position: relative;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 92% !important;
    max-width: 420px !important;
    transform: none;
  }

  /* Slight alternating offsets for organic feel */
  .tray__print:nth-child(odd)  { margin-left: -3%; transform: rotate(-0.5deg); }
  .tray__print:nth-child(even) { margin-right: -3%; transform: rotate(0.5deg); }

  .tray__print--portrait { width: 200px !important; }

  .tray__print-list--two-col { columns: 1; }
}

/* ---- Contact Page — Order Form ---- */

#contact .page__inner {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  min-height: 0;
  max-width: none;
}

/* Order form slip — cream paper card, positioned in desk empty space */
.order-form {
  position: relative;
  max-width: 480px;
  width: 42%;
  background: #f5f0e6;
  border: 1px solid #8a7a60;
  padding: 2rem 2.2rem;
  margin-top: 2%;
  transform: rotate(-0.7deg);
  box-shadow:
    0 2px 16px rgba(0, 0, 0, 0.45),
    4px 4px 0 0 #e0d8c8,
    5px 5px 0 0 #8a7a60;
}

/* Header area */
.order-form__header {
  text-align: center;
  margin-bottom: 0;
  position: relative;
}

.order-form__title {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-weight: 700;
  color: #2a1e10;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0 0 0.2rem;
}

.order-form__subtitle {
  font-family: var(--font-serif);
  font-size: clamp(0.7rem, 1.1vw, 0.9rem);
  color: #6b5a40;
  font-weight: 400;
  margin: 0;
}

.order-form__form-number {
  position: absolute;
  top: 0;
  right: 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.65rem;
  line-height: 1.3;
  text-align: left;
  color: #8a7a60;
}

/* Dashed rule */
.order-form__rule {
  border: none;
  border-bottom: 1px dashed #8a7a60;
  margin: 0.8rem 0 1rem;
}

/* Row layout */
.order-form__row {
  margin-bottom: 0.9rem;
}

.order-form__row--two-col {
  display: flex;
  gap: 1.5rem;
}

.order-form__row--two-col .order-form__field {
  flex: 1;
}

/* Field */
.order-form__field {
  display: flex;
  flex-direction: column;
}

.order-form__label {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  font-weight: 600;
  color: #5a4a30;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.15rem;
}

/* Underline-style inputs */
.order-form__input,
.order-form__select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #8a7a60;
  border-radius: 0;
  color: #2a1e10;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  padding: 0.35rem 0.25rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.order-form__input:focus,
.order-form__select:focus {
  border-bottom-color: #2a1e10;
}

/* Custom dropdown chevron */
.order-form__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a4a30' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 0.25rem center;
  background-repeat: no-repeat;
  padding-right: 1.5rem;
  cursor: pointer;
}

.order-form__select option {
  background: #f5f0e6;
  color: #2a1e10;
}

/* Textarea — boxed notes area */
.order-form__textarea {
  width: 100%;
  background: transparent;
  border: 1px solid #8a7a60;
  border-radius: 0;
  color: #2a1e10;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  padding: 0.4rem 0.5rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  resize: none;
  min-height: 70px;
  transition: border-color 0.2s;
}

.order-form__textarea:focus {
  border-color: #2a1e10;
}

/* Footer */
.order-form__footer {
  margin-top: 0.3rem;
}

.order-form__fine-print {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  font-style: italic;
  color: #8a7a60;
  margin: 0 0 0.6rem;
}

.contact__error {
  color: #993333;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-bottom: 0.5rem;
}

/* Submit button */
.order-form__submit {
  width: 100%;
  background: #2a1e10;
  border: none;
  color: #f5f0e6;
  padding: 0.6rem;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s;
}

.order-form__submit:hover {
  background: #3d2e1c;
}

.order-form__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* RECEIVED stamp */
.order-form__stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg) scale(2);
  font-family: 'Courier New', Courier, monospace;
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8b2020;
  border: 3px solid #8b2020;
  border-radius: 4px;
  padding: 0.3rem 1.2rem;
  opacity: 0;
  pointer-events: none;
  display: none;
}

/* Success message — shown over desk after form fades */
.contact__success {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 400px;
  width: 80%;
  text-align: center;
}

.contact__success-text {
  color: #f5f0e6;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* ---- Contact mobile ---- */
@media (max-width: 768px) {
  #contact {
    background-position: center top;
  }

  .order-form {
    width: 85%;
    max-width: none;
    padding: 1.4rem;
    transform: none;
    margin-top: 5%;
  }

  .order-form__row--two-col {
    flex-direction: column;
    gap: 0;
  }

  .order-form__row--two-col .order-form__field {
    margin-bottom: 0.9rem;
  }

  .order-form__form-number {
    position: static;
    display: block;
    text-align: center;
    margin-top: 0.3rem;
  }

  .order-form__stamp {
    font-size: 1.8rem;
  }
}

/* Tall/narrow viewports — tighten further so form doesn't overflow */
@media (max-height: 700px) {
  .order-form {
    padding: 1.2rem 1.5rem;
  }

  .order-form__row {
    margin-bottom: 0.6rem;
  }

  .order-form__rule {
    margin: 0.5rem 0 0.7rem;
  }

  .order-form__textarea {
    min-height: 50px;
  }
}
