/* The Stroughs: shared styles for index.html and contact.php */

:root {
  --night: #141a2e;
  --night-2: #1b2240;
  --ink: #eef0fa;
  --ink-soft: #b9bedb;
  --gold: #f6d185;
  --peach: #f2a07b;
  --plum: #6b3d6e;
  --line: rgba(238, 240, 250, .14);
  --radius: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--gold); color: var(--night); padding: .6rem 1rem; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Nav ---------- */
.site-nav {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: clamp(.9rem, 2.5vw, 1.5rem) clamp(1rem, 4vw, 2.5rem);
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--ink); text-decoration: none;
  font: 600 1.1rem/1 var(--serif); letter-spacing: .02em;
}
.brand-mark { width: 28px; height: 28px; color: var(--gold); }
.site-nav nav { display: flex; gap: clamp(.4rem, 2vw, 1.4rem); }
.site-nav nav a {
  color: var(--ink); text-decoration: none; font-size: .95rem;
  padding: .45rem .8rem; border-radius: 999px; transition: background .2s;
}
.site-nav nav a:hover, .site-nav nav a[aria-current="page"] { background: rgba(255,255,255,.1); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: 6rem 1.25rem 12rem;
  background: linear-gradient(180deg,
    #0c1029 0%, #1b1d47 28%, #3e2d62 44%, #8a4a6e 56%, #e0896b 66%, #f4b37c 76%);
  isolation: isolate;
}
.scene {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
}
.scene .layer {
  transform: translate3d(calc(var(--mx, 0px) * var(--depth, 0) * -1),
                         calc(var(--sy, 0px) * var(--depth, 0)), 0);
  will-change: transform;
}

.star { fill: #fff; animation: twinkle var(--t, 4s) ease-in-out var(--d, 0s) infinite; }
@keyframes twinkle { 0%, 100% { opacity: var(--o, .9); } 50% { opacity: .15; } }

.moon { animation: moon-rise 2.4s cubic-bezier(.2,.7,.2,1) both; }
@keyframes moon-rise { from { opacity: 0; translate: 0 60px; } }

.cloud { fill: rgba(222, 205, 236, .14); animation: drift var(--dur) linear var(--delay) infinite; }
.cloud-a { --cy: 120px; --dur: 140s; --delay: -40s; }
.cloud-b { --cy: 250px; --dur: 110s; --delay: -85s; }
.cloud-c { --cy: 330px; --dur: 170s; --delay: -10s; }
@keyframes drift {
  from { transform: translate(-260px, var(--cy)); }
  to   { transform: translate(1720px, var(--cy)); }
}

.shooting-star { opacity: 0; animation: shoot 11s ease-in 3s infinite; }
@keyframes shoot {
  0%   { opacity: 0; transform: translate(180px, 60px) rotate(18deg); }
  2%   { opacity: 1; }
  9%   { opacity: 0; transform: translate(760px, 250px) rotate(18deg); }
  100% { opacity: 0; transform: translate(760px, 250px) rotate(18deg); }
}

.window { fill: var(--gold); filter: drop-shadow(0 0 6px rgba(246, 209, 133, .85)); }
.w1 { animation: flicker 7s ease-in-out infinite; }
.w2 { animation: flicker 9s ease-in-out 2s infinite; }
.w3 { fill: #f5b36b; }
@keyframes flicker { 0%, 100% { opacity: 1; } 46% { opacity: 1; } 50% { opacity: .55; } 54% { opacity: 1; } }

.puff { opacity: 0; transform-box: fill-box; transform-origin: center; animation: smoke 6s ease-out infinite; }
.p2 { animation-delay: 2s; }
.p3 { animation-delay: 4s; }
@keyframes smoke {
  0%   { opacity: 0; transform: translate(0, 0) scale(.6); }
  15%  { opacity: .45; }
  100% { opacity: 0; transform: translate(26px, -70px) scale(2.4); }
}

.firefly {
  fill: #ffe9a3; filter: url(#soft);
  animation: float var(--t, 9s) ease-in-out var(--d, 0s) infinite alternate;
}
@keyframes float {
  0%   { transform: translate(0, 0); opacity: .15; }
  50%  { opacity: 1; }
  100% { transform: translate(var(--fx, 20px), var(--fy, -30px)); opacity: .3; }
}

.hero-copy { text-align: center; max-width: 46rem; position: relative; }
.eyebrow {
  margin: 0 0 .6rem; text-transform: uppercase; letter-spacing: .32em; font-size: .8rem;
  color: var(--gold); animation: rise .9s .1s both;
}
.title {
  margin: 0; font: 600 clamp(3.2rem, 11vw, 7.5rem)/.95 var(--serif); letter-spacing: -.01em;
  text-shadow: 0 6px 40px rgba(10, 10, 40, .45);
}
.title span { display: inline-block; animation: rise 1s cubic-bezier(.2,.7,.2,1) both; }
.title span:first-child { font-style: italic; font-weight: 400; font-size: .55em; margin-right: .2em; vertical-align: .55em; color: var(--ink-soft); animation-delay: .25s; }
.title span:last-child {
  animation-delay: .45s;
  /* room for the "g" descender: background-clip:text only paints inside the box */
  padding: 0 .04em .18em; margin-bottom: -.12em; line-height: 1.05;
  background: linear-gradient(100deg, #fff 0%, #fff 40%, var(--gold) 50%, #fff 60%, #fff 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise 1s cubic-bezier(.2,.7,.2,1) .45s both, shimmer 7s ease-in-out 2s infinite;
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes shimmer { 0%, 70% { background-position: 100% 0; } 100% { background-position: -50% 0; } }

.tagline { margin: 1.1rem auto 2rem; font-size: clamp(1.05rem, 2.6vw, 1.3rem); color: var(--ink-soft); animation: rise 1s .7s both; }

.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; animation: rise 1s .9s both; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .75rem 1.5rem; border-radius: 999px;
  font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer; border: 0;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-primary { background: var(--gold); color: #2a1f10; box-shadow: 0 8px 24px rgba(246, 209, 133, .3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(246, 209, 133, .45); }
.btn-ghost { color: var(--ink); background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.16); transform: translateY(-2px); }

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.6rem; translate: -50% 0;
  width: 26px; height: 42px; border-radius: 14px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.5);
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: #fff; animation: cue 2s ease-in-out infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Content ---------- */
main { padding: clamp(3rem, 8vw, 6rem) clamp(1.1rem, 4vw, 2.5rem); }

.intro { max-width: 40rem; margin: 0 auto clamp(2.5rem, 6vw, 4rem); text-align: center; }
.intro h2 { font: 600 clamp(2rem, 5vw, 2.8rem)/1.1 var(--serif); margin: 0 0 1rem; }
.intro p { color: var(--ink-soft); margin: 0; }

.cards {
  max-width: 68rem; margin: 0 auto;
  display: grid; gap: clamp(1rem, 2.5vw, 1.6rem);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.card {
  position: relative; display: flex; flex-direction: column; gap: .6rem;
  padding: 1.75rem; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink); text-decoration: none; overflow: hidden;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s;
}
.card::before {
  content: ""; position: absolute; inset: -40% -40% auto auto; width: 60%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(246, 209, 133, .22), transparent 70%);
  opacity: 0; transition: opacity .4s;
}
a.card:hover { transform: translateY(-6px); box-shadow: inset 0 0 0 1px rgba(246, 209, 133, .5), 0 18px 40px rgba(0,0,0,.35); }
a.card:hover::before { opacity: 1; }
.card h3 { margin: 0; font: 600 1.45rem/1.2 var(--serif); }
.card p { margin: 0; color: var(--ink-soft); flex: 1; }
.card-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(246, 209, 133, .12); color: var(--gold); margin-bottom: .4rem;
}
.card-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.card-link { font-weight: 600; color: var(--gold); margin-top: .4rem; }
.card-link span { display: inline-block; transition: transform .25s; }
a.card:hover .card-link span { transform: translateX(5px); }
.card-link.muted { color: var(--ink-soft); font-weight: 500; font-style: italic; }

/* Only hide reveal items once JS is running, so nothing is lost without it */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.cards .reveal:nth-child(2) { transition-delay: .1s; }
.cards .reveal:nth-child(3) { transition-delay: .2s; }

/* ---------- Contact page ---------- */
.hero-short { min-height: 0; padding: 8rem 1.25rem 7rem; }
.hero-short .scene { height: 100%; }
.hero-short::after {
  content: ""; position: absolute; inset: auto 0 -2px 0; height: 35%; z-index: -1;
  background: linear-gradient(180deg, rgba(20, 26, 46, 0), var(--night) 85%);
  pointer-events: none;
}
.page-title {
  margin: 0; font: 600 clamp(2.6rem, 8vw, 4.5rem)/1.1 var(--serif);
  text-shadow: 0 6px 40px rgba(10, 10, 40, .45); animation: rise 1s .2s both;
}
.hero-short .tagline { margin-bottom: 0; }

.contact main { padding-top: 0; }
.form-card {
  max-width: 38rem; margin: -3rem auto 0; position: relative; z-index: 2;
  padding: clamp(1.4rem, 4vw, 2.4rem); border-radius: var(--radius);
  background: linear-gradient(160deg, #222a4d, #1a2040);
  box-shadow: inset 0 0 0 1px var(--line), 0 24px 60px rgba(0,0,0,.35);
  animation: rise .9s .35s both; scroll-margin-top: 1.5rem;
}
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .95rem; }
.field input, .field textarea {
  width: 100%; padding: .8rem 1rem; border-radius: 12px; border: 0;
  background: rgba(10, 14, 32, .55); color: var(--ink);
  font: inherit; font-size: 1rem; /* 16px+ stops iOS zoom */
  box-shadow: inset 0 0 0 1px rgba(238,240,250,.18);
  transition: box-shadow .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:focus, .field textarea:focus {
  outline: none; background: rgba(10, 14, 32, .75);
  box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 4px rgba(246,209,133,.15);
}
.field.has-error input, .field.has-error textarea { box-shadow: inset 0 0 0 2px #ff9a8a; }
.field-error { margin: .4rem 0 0; color: #ffb3a7; font-size: .9rem; }

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

.btn-send { width: 100%; gap: .6rem; margin-top: .4rem; }
.btn-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: transform .3s; }
.btn-send:hover svg { transform: translate(3px, -3px); }
.form-note { margin: .9rem 0 0; text-align: center; color: var(--ink-soft); font-size: .88rem; }

.notice { border-radius: 12px; padding: .9rem 1.1rem; margin-bottom: 1.4rem; }
.notice p { margin: 0; }
.notice-error { background: rgba(255, 120, 100, .12); box-shadow: inset 0 0 0 1px rgba(255, 154, 138, .45); color: #ffd2ca; }
.notice-ok { display: flex; gap: 1.1rem; align-items: flex-start; margin: 0; padding: .4rem 0; }
.notice-ok h2 { margin: 0 0 .3rem; font: 600 1.8rem/1.2 var(--serif); }
.notice-ok p + p { margin-top: .9rem; }
.notice-ok svg { flex: none; width: 56px; height: 56px; fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.notice-ok svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .7s .5s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.site-footer {
  text-align: center; padding: 2.5rem 1rem 3rem; color: var(--ink-soft); font-size: .92rem;
  border-top: 1px solid var(--line);
}

/* Portrait screens crop the scene's sides: pull the moon and house into view */
@media (max-aspect-ratio: 4/5) {
  .moon-pos { transform: translate(-360px, -70px) scale(1); }
  .house { transform: translate(640px, 586px); }
}

@media (max-width: 520px) {
  .brand span { display: none; }
  .hero { padding-bottom: 9rem; }
  .btn { width: 100%; }
  .hero-actions { flex-direction: column; max-width: 18rem; margin: 0 auto; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    animation-delay: 0s !important; transition-duration: .001ms !important;
  }
  .shooting-star, .puff, .scroll-cue span { display: none; }
  .scene .layer { transform: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .notice-ok svg path { stroke-dashoffset: 0; }
}
