:root {
  /* Background gradient (unchanged): deep indigo -> slate */
  --bg-slate: #2b5876;
  --bg-indigo: #4e4376;

  /* Surfaces */
  --panel: #1b2432;
  --panel-input: #222c3c;
  --border: #403f4c;

  /* Warm coral accent (unchanged) */
  --coral: #b76d68;
  --coral-light: #ebbfbc;

  --text: #fff;
  --text-muted: #a8b0bd;

  --font: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  /* Solid colour for iOS Safari to sample when tinting its toolbars, and for
     the overscroll/rubber-band area. Matches the nav and footer. */
  background-color: var(--panel);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  /* Longhands, not the `background` shorthand: a second `background:` would
     reset background-color back to transparent and undo the fallback. */
  background-color: var(--panel);
  background-image: linear-gradient(to left, var(--bg-slate), var(--bg-indigo));
  background-attachment: fixed;
}

/* ---------- Nav ---------- */

.navbar {
  padding: 0;
  border-bottom: solid 1px var(--border);
  background-color: var(--panel);
  justify-content: center;
}

#nickWuerz {
  letter-spacing: 4px;
  background-color: var(--panel);
  color: var(--coral);
  margin-bottom: 0;
  padding: 5px;
  font-family: var(--font);
  font-size: 1.25rem;
}

/* ---------- Layout ----------
   main flexes to fill the space between nav and footer, and centers the
   card both axes. This is what replaces the old logo grid's vertical mass. */

.site-main {
  flex: 1 1 auto;
  display: flex;
  padding: clamp(24px, 6vw, 64px) 20px;
}

.intro-card {
  /* auto margins center the card when there's room, and collapse to 0 when
     the open form makes it taller than the viewport (no clipped top edge) */
  margin: auto;
  width: 100%;
  max-width: 620px;
  background-color: var(--panel);
  border: solid 1px var(--border);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 40px);
}

/* ---------- Type ---------- */

p {
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  /* Avoids a single orphaned word on the last line. Ignored where unsupported. */
  text-wrap: pretty;
}

/* Gap equals one line-height (1.6 x 18px), so the break reads as deliberate
   rather than landing ambiguously between a line break and a blank line. */
.intro-text {
  margin-bottom: 28px;
}

.intro-cta {
  margin-bottom: 0;
}

/* Secondary link. Deliberately not coral: the accent is reserved for the one
   primary action, so the contact form stays the obvious thing to click. */
.subtle-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(168, 176, 189, 0.45);
  transition: color 0.15s ease;
}

.subtle-link:hover,
.subtle-link:focus-visible {
  color: var(--text);
  text-decoration-color: currentColor;
}

.subtle-link:focus-visible {
  outline: 2px solid var(--coral-light);
  outline-offset: 3px;
  border-radius: 3px;
}

hr {
  border: 0;
  height: 1px;
  background-color: var(--coral);
  opacity: 0.6;
  margin: 28px 0 24px;
}

/* ---------- Coral "send me a message" link ---------- */

.accent-link {
  color: var(--coral);
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
}

.accent-link:hover,
.accent-link:focus-visible {
  color: var(--coral-light);
}

.accent-link:focus-visible {
  outline: 2px solid var(--coral-light);
  outline-offset: 3px;
}

/* ---------- Form ---------- */

.is-hidden {
  display: none;
}

.form-group {
  font-family: var(--font);
}

.form-txt {
  color: var(--text);
  letter-spacing: 1px;
  font-size: 14px;
  margin-bottom: 6px;
}

.form-control.form-input {
  background-color: var(--panel-input);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px; /* >=16px stops iOS Safari from zooming on focus */
  line-height: 1.5;
  letter-spacing: 0.5px;
  border-radius: 6px;
  height: auto;
  padding: 10px 12px;
}

.form-control.form-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-control.form-input:focus {
  background-color: var(--panel-input);
  color: var(--text);
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(183, 109, 104, 0.3);
}

/* Only flag invalid fields after a submit attempt, not while typing.
   Deliberately NOT named .was-validated — Bootstrap owns that class and pairs
   it with green :valid borders and checkmark icons that clash with the palette. */
.contact-form.show-validation .form-control.form-input:invalid {
  border-color: var(--coral);
}

textarea.form-input {
  resize: vertical;
  min-height: 96px;
}

/* ---------- Send button (coral accent) ---------- */

.btn.btn-accent {
  background: var(--coral);
  color: #fff;
  border: none;
  border-radius: 6px;
  letter-spacing: 1px;
  font-weight: 700;
  padding: 10px 28px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn.btn-accent:hover,
.btn.btn-accent:focus,
.btn.btn-accent:active {
  background: var(--coral-light);
  color: var(--panel);
}

.btn.btn-accent:focus-visible {
  outline: 2px solid var(--coral-light);
  outline-offset: 3px;
}

.btn.btn-accent:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-alert {
  margin: 16px 0 0;
  font-size: 16px;
  color: var(--coral-light);
}

/* ---------- Footer ---------- */

.footer {
  background-color: var(--panel);
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

#footer-txt {
  font-family: var(--font);
  letter-spacing: 1px;
  font-size: 12px;
}

/* ---------- Mobile ---------- */

@media (max-width: 575.98px) {
  .site-main {
    padding: 24px 16px;
  }

  p {
    font-size: 17px;
  }

  .btn.btn-accent {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
