@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --paper: #f4f5f3;
  --paper-soft: #eaeeed;
  --ink: #26333b;
  --ink-deep: #162026;
  --muted: #647582;
  --muted-light: #8d9da8;
  --rule: #cbd4d8;
  --rule-light: #e0e5e7;
  --accent: #a78c6b;
  --accent-hover: #8f7454;
  --accent-soft: rgba(167, 140, 107, 0.15);
  --max: 1420px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition-smooth: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site {
  width: min(calc(100% - 64px), var(--max));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* -------------------------------------------------------------
   MASTHEAD
   ------------------------------------------------------------- */
.masthead {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

.brand-link:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.brand-logo-img {
  height: 46px;
  width: auto;
  max-width: 200px;
  display: block;
  object-fit: contain;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.45);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule-light);
  backdrop-filter: blur(8px);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #3b82f6;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 0 rgba(59, 130, 246, 0.4);
  animation: pulse 2.6s infinite ease-in-out;
}

.status-badge .sep {
  color: var(--rule);
  font-size: 10px;
}

/* -------------------------------------------------------------
   HERO SECTION
   ------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: min(640px, 68vh);
  overflow: hidden;
  display: flex;
  align-items: center;
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
  border-bottom: 1px solid var(--rule);
}

.hero-art {
  position: absolute;
  inset: 0;
  background-image: url("assets/hero-desktop.webp?v=2");
  background-size: cover;
  background-position: center right;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, 
      rgba(244, 245, 243, 0.98) 0%, 
      rgba(244, 245, 243, 0.92) 28%, 
      rgba(244, 245, 243, 0.42) 52%, 
      rgba(244, 245, 243, 0) 70%
    ),
    linear-gradient(0deg, 
      rgba(244, 245, 243, 0.35) 0%, 
      rgba(244, 245, 243, 0) 25%
    );
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 48px 0 48px clamp(12px, 4vw, 56px);
  max-width: 600px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: currentColor;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(44px, 5.2vw, 80px);
  line-height: 1.02;
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--ink-deep);
}

.hero-copy .subtext {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.5;
  font-weight: 400;
}

/* Dispatch Notification Form */
.hero-dispatch {
  margin-top: 36px;
}

.dispatch-label {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-weight: 500;
}

.dispatch-form {
  max-width: 440px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: var(--transition-smooth);
}

.input-wrapper:focus-within {
  border-color: var(--ink);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(38, 51, 59, 0.08);
}

.input-wrapper input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  min-width: 0;
}

.input-wrapper input::placeholder {
  color: var(--muted-light);
}

.input-wrapper button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.input-wrapper button:hover {
  background: var(--ink-deep);
  transform: translateY(-1px);
}

.input-wrapper button:active {
  transform: translateY(0);
}

.dispatch-feedback {
  margin-top: 10px;
  font-size: 12px;
  min-height: 18px;
  transition: var(--transition-smooth);
}

.dispatch-feedback.success {
  color: #1e7041;
  font-weight: 500;
}

.dispatch-feedback.error {
  color: #a32727;
}

/* -------------------------------------------------------------
   FIELD DISPATCHES / NOTES SECTION
   ------------------------------------------------------------- */
.field-notes {
  padding: 36px 0 44px;
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  gap: 20px;
  flex-wrap: wrap;
}

.field-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.2em;
  font-weight: 600;
  text-transform: uppercase;
}

.field-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  opacity: 0.85;
}

.dispatch-count {
  color: var(--muted-light);
  font-weight: 400;
  letter-spacing: 0.14em;
}

.ambient-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.ambient-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  border-color: var(--muted);
}

.ambient-btn.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.ambient-btn.active .sound-wave {
  stroke: var(--accent);
  animation: soundPulse 1.2s infinite alternate ease-in-out;
}

.notes-ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.note-entry {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--rule-light);
  border-radius: 6px;
  padding: 20px 24px;
  transition: var(--transition-smooth);
}

.note-entry:hover {
  background: rgba(255, 255, 255, 0.65);
  border-color: var(--rule);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.note-stamp {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.note-id {
  color: var(--accent);
  font-weight: 600;
}

.note-date {
  color: var(--muted-light);
  font-weight: 500;
}

.note-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.note-body .line {
  width: 22px;
  height: 1px;
  background: var(--accent);
  margin-top: 9px;
  flex-shrink: 0;
}

.note-body p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* -------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 24px 0 36px;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.footer-mark {
  width: 14px;
  height: 14px;
  object-fit: contain;
  opacity: 0.75;
}

.footer-tagline {
  font-style: italic;
  color: var(--muted-light);
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* -------------------------------------------------------------
   ANIMATIONS
   ------------------------------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

@keyframes soundPulse {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* -------------------------------------------------------------
   RESPONSIVE DESIGN
   ------------------------------------------------------------- */
@media (max-width: 860px) {
  .site {
    width: min(calc(100% - 40px), var(--max));
  }

  .masthead {
    padding: 24px 0 20px;
  }

  .hero {
    min-height: 620px;
  }

  .hero-overlay {
    background:
      linear-gradient(180deg, 
        rgba(244, 245, 243, 0.98) 0%, 
        rgba(244, 245, 243, 0.95) 45%, 
        rgba(244, 245, 243, 0.6) 70%, 
        rgba(244, 245, 243, 0.08) 100%
      );
  }

  .hero-copy {
    padding: 36px 16px;
    max-width: 100%;
  }

  .hero-art {
    background-image: url("assets/hero-mobile.webp");
    background-position: center 85%;
  }
}

@media (max-width: 600px) {
  .site {
    width: min(calc(100% - 32px), var(--max));
  }

  .masthead {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 0;
  }

  .brand-logo-img {
    height: 38px;
    max-width: 160px;
  }

  .status-badge {
    font-size: 8.5px;
    padding: 5px 10px;
    letter-spacing: 0.12em;
  }

  .hero {
    min-height: 600px;
  }

  .hero-overlay {
    background:
      linear-gradient(180deg, 
        rgba(244, 245, 243, 0.99) 0%, 
        rgba(244, 245, 243, 0.95) 48%, 
        rgba(244, 245, 243, 0.58) 72%, 
        rgba(244, 245, 243, 0.05) 100%
      );
  }

  .hero-copy {
    padding: 28px 0;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 11vw, 54px);
  }

  .hero-copy .subtext {
    font-size: 16px;
    margin-top: 14px;
  }

  .dispatch-label {
    font-size: 11.5px;
  }

  .input-wrapper {
    flex-direction: column;
    padding: 6px;
    gap: 8px;
    background: rgba(255, 255, 255, 0.92);
  }

  .input-wrapper input {
    width: 100%;
    padding: 8px 10px;
  }

  .input-wrapper button {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
  }

  .notes-ledger {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    font-size: 10px;
    padding-bottom: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
