@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  --ivory: #f8f4ec;
  --cream: #fdfaf5;
  --paper: rgba(253, 250, 245, 0.78);
  --paper-strong: rgba(253, 250, 245, 0.92);
  --gold: #c9a84c;
  --gold-dark: #9a7a30;
  --navy: #1c2a38;
  --ink: #1a2230;
  --muted: #5f6e80;
  --quiet: #8a96a6;
  --line: rgba(180, 160, 120, 0.28);
  --ice: rgba(202, 225, 255, 0.42);
  --shadow: 0 24px 80px rgba(28, 42, 56, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 18%, rgba(201, 168, 76, 0.19), transparent 28rem),
    linear-gradient(135deg, #eef3f7 0%, var(--ivory) 42%, #dfe8f0 100%);
  font-family: "Lora", Georgia, serif;
}

body::before {
  position: fixed;
  inset: -3vh -3vw;
  z-index: -2;
  content: "";
  background-image: url("/assets/askmail-ui-reference.png");
  background-position: center;
  background-size: cover;
  filter: blur(10px) saturate(0.86);
  opacity: 0.16;
  transform: translateY(calc(var(--scroll-y, 0) * -0.08px)) scale(1.04);
  transition: opacity 220ms ease;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, rgba(253, 250, 245, 0.94), rgba(253, 250, 245, 0.66)),
    radial-gradient(circle at 20% 92%, rgba(120, 165, 210, 0.28), transparent 34rem);
  pointer-events: none;
}

body.project-open::before {
  opacity: 0.34;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  clip-path: polygon(50% 0, 100% 86%, 0 86%);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong,
h1,
h2,
h3 {
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.nav a,
.nav-chat {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.nav a:hover,
.nav-chat:hover {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(253, 250, 245, 0.46);
}

.section-band {
  padding: 76px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.62fr);
  align-items: center;
  gap: 48px;
  min-height: calc(100vh - 78px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-dark);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.94;
}

.hero-lede {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.65;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.button.primary {
  color: var(--cream);
  border-color: var(--gold-dark);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  box-shadow: 0 12px 28px rgba(154, 122, 48, 0.22);
}

.button.secondary {
  color: var(--navy);
  background: rgba(253, 250, 245, 0.72);
}

.portrait-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.38);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.portrait-panel img {
  display: block;
  width: 100%;
  aspect-ratio: 0.82;
  object-fit: cover;
}

.portrait-meta {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  background: rgba(253, 250, 245, 0.82);
  backdrop-filter: blur(16px);
}

.portrait-meta span,
.card-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-dark);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding-top: 8px;
  padding-bottom: 8px;
  border: 1px solid var(--line);
  border-right: 0;
  border-left: 0;
}

.signal-strip div {
  padding: 26px 28px;
  background: rgba(253, 250, 245, 0.48);
}

.signal-strip strong,
.signal-strip span {
  display: block;
}

.signal-strip strong {
  margin-bottom: 8px;
  color: var(--navy);
  font-family: "Cinzel", Georgia, serif;
}

.signal-strip span {
  color: var(--muted);
  line-height: 1.5;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 30px;
}

.section-heading h2,
.contact h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1;
}

.section-heading p,
.contact-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.project-grid,
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.project-card,
.service-card {
  position: relative;
  min-height: 286px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 12px 40px rgba(28, 42, 56, 0.08);
  transition: grid-column 220ms ease, background 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.project-card:hover,
.project-card:focus-within,
.service-card:hover {
  transform: translateY(-3px);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.project-card.expanded {
  grid-column: span 2;
  background: rgba(253, 250, 245, 0.96);
}

.project-card h3,
.service-card h3 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 24px;
}

.project-card p,
.service-card p {
  color: var(--muted);
  line-height: 1.58;
}

.card-detail {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 220ms ease, opacity 220ms ease;
}

.card-detail > * {
  overflow: hidden;
}

.project-card.expanded .card-detail {
  grid-template-rows: 1fr;
  opacity: 1;
}

.card-detail ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.card-detail li {
  margin: 8px 0;
}

.card-toggle {
  position: absolute;
  right: 18px;
  bottom: 18px;
  border: 0;
  color: var(--gold-dark);
  background: transparent;
  cursor: pointer;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.services {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.proposal {
  border-bottom: 1px solid var(--line);
}

.service-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
}

.service-card .button {
  margin-top: auto;
}

.price {
  margin: 0 0 16px;
  color: var(--gold-dark) !important;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 14px;
  font-weight: 600;
}

.proposal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 880px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(253, 250, 245, 0.72);
  box-shadow: 0 12px 40px rgba(28, 42, 56, 0.08);
}

.proposal-form label,
.proposal-form span {
  display: grid;
  gap: 8px;
}

.proposal-form .full {
  grid-column: 1 / -1;
}

.proposal-form span {
  color: var(--gold-dark);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.proposal-form input,
.proposal-form select,
.proposal-form textarea {
  width: 100%;
  border: 1px solid rgba(201, 168, 76, 0.34);
  border-radius: var(--radius);
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  font: inherit;
}

.proposal-form select {
  appearance: none;
}

.proposal-form textarea {
  resize: vertical;
}

.proposal-form button {
  justify-self: start;
}

.proposal-form button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.checkbox-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px !important;
  color: var(--muted);
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--gold-dark);
}

.checkbox-row span {
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-transform: none;
}

.form-status {
  min-height: 24px;
  color: var(--muted);
  font-size: 14px;
}

.form-status[data-state="ok"] {
  color: #2f7042;
}

.form-status[data-state="error"] {
  color: #9b2f2f;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
}

.contact-copy {
  max-width: 720px;
}

.chat-dock {
  position: fixed;
  top: 96px;
  right: 24px;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(390px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 120px));
  border: 1px solid rgba(201, 168, 76, 0.36);
  border-radius: var(--radius);
  background: rgba(253, 250, 245, 0.94);
  box-shadow: var(--shadow);
  transform: translateX(calc(100% + 40px));
  transition: transform 220ms ease;
  overflow: hidden;
}

.chat-dock.open {
  transform: translateX(0);
}

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

.chat-header span,
.chat-header button {
  color: var(--gold-dark);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.chat-header strong {
  display: block;
  margin-top: 4px;
  font-family: "Cinzel", Georgia, serif;
}

.chat-header button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
}

.message {
  width: fit-content;
  max-width: 88%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.58);
}

.message.user {
  align-self: flex-end;
  color: var(--cream);
  border-color: var(--gold-dark);
  background: var(--gold-dark);
}

.chat-prompts,
.chat-links,
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-prompts button,
.chat-links a,
.quick-replies button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(201, 168, 76, 0.34);
  border-radius: 8px;
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.54);
  cursor: pointer;
}

.chat-prompts button:hover,
.chat-links a:hover,
.quick-replies button:hover {
  border-color: var(--gold-dark);
  background: rgba(255, 255, 255, 0.82);
}

.quick-replies {
  max-width: 100%;
}

.quick-replies button:disabled {
  opacity: 0.48;
  cursor: default;
}

.chat-links a {
  color: var(--gold-dark);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.chat-form input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.chat-form button {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius);
  color: var(--cream);
  background: var(--gold-dark);
  cursor: pointer;
}

.cascade {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 480ms ease, transform 480ms ease;
}

.cascade.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .hero,
  .contact {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .portrait-panel {
    max-width: 460px;
  }

  .signal-strip,
  .project-grid,
  .service-grid,
  .proposal-form {
    grid-template-columns: 1fr;
  }

  .project-card.expanded {
    grid-column: span 1;
  }

  .proposal-form .full {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .site-shell {
    width: min(100% - 22px, 1180px);
  }

  .section-band {
    padding: 54px 0;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero-lede {
    font-size: 17px;
  }

  .chat-dock {
    top: 10px;
    right: 10px;
    height: calc(100vh - 20px);
  }
}
