/* Contact page. Same markup inside the app shell and on the public (signed-out) side.
   The hero is dark in both themes: its picture (contact-background.png) is black with sage tiles, so its text uses
   fixed light colours, while everything below it follows the theme tokens. */

/* ---------- public header (signed out) ---------- */
.contact-bar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-inline: var(--sp-8);
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.contact-brand {
  padding: 0;
}

.contact-bar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.contact-main {
  margin-inline: auto;
}

/* inside the app the pattern behind the page is softened so the page content reads first */
.contact-app .main::before {
  /* grown by 24px on every side so the blur has no faded edge, then clipped back to the content area so it never reaches the sidebar */
  filter: blur(7px);
  inset-block: -24px;
  inset-inline-start: calc(var(--sidebar-w) - 24px);
  inset-inline-end: -24px;
  clip-path: inset(24px);
}

@media (max-width: 900px) {
  .contact-app .main::before { inset-inline-start: -24px; }
}

/* ---------- hero ---------- */
.contact-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  padding: var(--sp-8) var(--sp-8) calc(var(--sp-9) + 24px);
  border-radius: var(--radius-lg);
  background: #050805;
  color: #eef3ec;
}

/* the picture settles in once on load; a dark wash on the text side keeps the copy readable over the bright tiles */
.contact-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(270deg, rgba(5, 8, 5, .94) 0%, rgba(5, 8, 5, .82) 42%, rgba(5, 8, 5, .3) 100%),
    url("/img/contact-background.png") center / cover no-repeat;
  animation: contact-settle 1.6s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes contact-settle {
  from { transform: scale(1.07); filter: blur(6px); }
  to   { transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-hero::before { animation: none; }
}

.contact-hero ::selection {
  background: #73c58f;
  color: #06110a;
}

.contact-hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 560px;
}

.contact-person {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.contact-person b {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.3;
}

.contact-person span {
  font-size: var(--fs-sm);
  color: #a9d3b6;
}

.contact-hero h1 {
  font-size: clamp(2.25rem, 4.6vw, 3.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.03em;
  text-wrap: balance;
  color: #f4f8f2;
}

.contact-hero p {
  font-size: var(--fs-lg);
  line-height: 1.9;
  color: rgba(238, 243, 236, .84);
  max-width: 52ch;
}

/* ---------- sheet + guide ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: start;
  margin-top: -72px; /* the sheet overlaps the bottom of the hero */
  position: relative;
  z-index: 1;
}

.contact-sheet,
.contact-guide {
  box-shadow: 0 18px 40px -18px rgba(5, 8, 5, .45), 0 2px 6px rgba(5, 8, 5, .12);
}

.contact-sheet {
  overflow: hidden;
}

.contact-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--pad);
  transition: background-color .2s ease;
}

.contact-row + .contact-row {
  border-top: 1px solid var(--border-subtle);
}

.contact-row:hover {
  background: color-mix(in srgb, var(--accent-tint) 38%, transparent);
}

.contact-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent-tint);
  color: var(--accent-text);
}

.contact-icon .icon {
  width: 24px;
  height: 24px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* label and value share the start edge, the value itself stays left-to-right */
  gap: var(--sp-1);
  min-width: 0;
}

.contact-label {
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.contact-value {
  display: block;
  direction: ltr;
  text-align: start;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.contact-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* the copy button needs app.js; without it only the call and mail buttons show */
.contact-copy {
  display: none;
}

.js .contact-copy {
  display: inline-flex;
}

.contact-copy[data-done] {
  color: var(--accent-text);
  border-color: var(--accent-line);
  background: var(--accent-tint);
}

.contact-guide {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--pad); /* a box like the contact sheet, level with it */
}

.contact-guide h2 {
  font-size: var(--fs-xl);
}

.contact-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.contact-steps li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  line-height: 1.7;
  color: var(--text-2);
}

.contact-steps .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 5px;
  color: var(--accent-text);
}

.contact-privacy {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.8;
}

.contact-privacy .mono {
  white-space: nowrap;
}

.contact-privacy .icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--accent-text);
}

/* link under the sign-in form */
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--accent-text);
  font-weight: 500;
}

.contact-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- smaller screens ---------- */
@media (max-width: 900px) {
  .contact-bar {
    padding-inline: var(--sp-4);
  }

  .contact-hero {
    min-height: 300px;
    padding: var(--sp-6) var(--sp-5) calc(var(--sp-8) + 24px);
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-6);
    margin-top: -56px;
  }

  .contact-guide {
    padding: var(--sp-4);
  }
}

@media (max-width: 600px) {
  .contact-row {
    grid-template-columns: auto minmax(0, 1fr);
    padding: var(--sp-4);
  }

  .contact-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .contact-actions .btn {
    flex: 1;
    min-height: 44px;
  }
}
