/* Gallery: white liquid glass floating over Renaissance painting.
   Glass needs something behind it to refract, which is what the artwork is for. */

:root {
  --ivory: #f7f5f1;
  --ink: #16130f;
  --ink-soft: #5d564c;
  --ink-faint: #918878;
  --gold: #a8874f;
  --gold-soft: #c9b183;

  /* Liquid glass */
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-line: rgba(255, 255, 255, 0.75);
  --glass-blur: saturate(180%) blur(28px);
  --glass-shadow: 0 2px 8px rgba(28, 22, 14, 0.04), 0 12px 40px rgba(28, 22, 14, 0.1),
    0 32px 80px rgba(28, 22, 14, 0.07);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(255, 255, 255, 0.35);

  --display: 'Instrument Serif', 'Didot', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100svh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The painting sits far back, heavily blurred and bleached, so it reads as
   colored light rather than a picture competing with the content. */
.backdrop {
  position: fixed;
  inset: -10%;
  z-index: -2;
  background-image: var(--art, url('/img/venus.jpg'));
  background-size: cover;
  background-position: center;
  filter: blur(34px) saturate(140%) brightness(1.05);
  opacity: 0.85;
  transform: scale(1.12);
}

/* Keeps the top of the page pale enough for dark text while letting the
   painting's forms stay readable further down. */
.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% -5%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.3) 55%),
    linear-gradient(180deg, rgba(247, 245, 241, 0.62), rgba(247, 245, 241, 0.34));
}

/* Faint plaster grain so the white doesn't read as flat screen-white. */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
}

.wrap {
  position: relative;
  width: min(100% - 2rem, 34rem);
  margin-inline: auto;
  padding-block: clamp(2rem, 7vh, 4rem);
}

.wrap--wide {
  width: min(100% - 2rem, 76rem);
}

/* --------------------------------------------------------------------- type */

h1 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(3rem, 11vw, 5.25rem);
  line-height: 0.94;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
}

h1 em {
  font-style: italic;
  color: var(--gold);
}

/* Technical mono label, as on a contact sheet. */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.1rem;
}

.lede {
  font-family: var(--display);
  font-size: clamp(1.15rem, 3.4vw, 1.4rem);
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 2rem;
}

/* Hairline rule with a gold diamond, like a museum wall divider. */
.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.75rem 0;
  color: var(--gold-soft);
}

.rule::before,
.rule::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(168, 135, 79, 0.35), transparent);
}

.rule span {
  font-size: 0.5rem;
  transform: rotate(45deg);
  display: block;
  width: 5px;
  height: 5px;
  background: var(--gold-soft);
}

/* -------------------------------------------------------------------- glass */

.glass {
  position: relative;
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(255, 255, 255, 0.55) 45%,
    rgba(255, 255, 255, 0.68) 100%
  );
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow), var(--glass-inset);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  overflow: hidden;
}

/* Specular sweep across the top edge -- the thing that sells it as glass. */
.glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 45%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.85), transparent 70%);
  pointer-events: none;
}

/* -------------------------------------------------------------------- forms */

label {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}

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

input[type='text'],
textarea {
  width: 100%;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--ink);
  padding: 0.7rem 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(22, 19, 15, 0.14);
  border-radius: 0;
  transition: border-color 0.25s ease;
}

textarea {
  resize: vertical;
  min-height: 3.5rem;
  line-height: 1.45;
}

input[type='text']::placeholder,
textarea::placeholder {
  color: var(--ink-faint);
  opacity: 0.55;
}

input[type='text']:focus,
textarea:focus {
  outline: none;
  border-bottom-color: var(--gold);
}

/* ------------------------------------------------------------------ buttons */

button {
  font: inherit;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1.05rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 100px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 6px 20px rgba(22, 19, 15, 0.18);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(22, 19, 15, 0.24);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--ghost {
  color: var(--ink);
  background: var(--glass-strong);
  border-color: var(--glass-line);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.btn--quiet {
  width: auto;
  padding: 0.6rem 1.15rem;
  font-size: 0.66rem;
  color: var(--ink-soft);
  background: transparent;
  border-color: rgba(22, 19, 15, 0.16);
  box-shadow: none;
}

.btn--quiet:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: none;
}

/* ----------------------------------------------------------------- progress */

.progress {
  display: none;
  margin-top: 1.5rem;
}

.progress.is-visible {
  display: block;
}

.progress .track {
  height: 2px;
  background: rgba(22, 19, 15, 0.1);
  overflow: hidden;
}

.progress .bar {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 0.3s ease;
}

.progress .label {
  margin-top: 0.7rem;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}

.error {
  display: none;
  margin-top: 1.1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: rgba(160, 44, 32, 0.07);
  border: 1px solid rgba(160, 44, 32, 0.18);
  color: #8c2b1e;
  font-size: 0.88rem;
  line-height: 1.45;
}

.error.is-visible {
  display: block;
}

.footnote {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Safari <18 and Firefox without backdrop-filter: lean opaque so text stays legible. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass,
  .btn--ghost {
    background: rgba(255, 255, 255, 0.93);
  }
}

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