/*
 * Home page business card, "Foil edge" style (HOM-5 variant 4).
 * DM Serif Display + DM Sans, 18px corners, an iridescent foil stripe along the top of
 * both faces. Light and dark follow the system setting.
 */

:root {
  --ink: #29222f;
  --body: #2f2b38;
  --muted: #696274;
  --faint: #8b8290;
  --paper: #f6f2ea;
  --panel: #fffdf9;
  --line: #ded6ca;
  --field: #fbf8f3;
  --rose: #a34f56;
  --shadow: 0 24px 60px rgba(48, 38, 52, .16), 0 2px 6px rgba(48, 38, 52, .08);
  --foil: linear-gradient(100deg, #b98fc1, #86c9c6, #f0c78a, #e7a0a6, #b98fc1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1eaf2;
    --body: #ddd5e0;
    --muted: #a79eae;
    --faint: #857c8c;
    --paper: #141117;
    --panel: #211b26;
    --line: #3a3140;
    --field: rgba(0, 0, 0, .25);
    --rose: #e0959b;
    --shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .04);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--body);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a:focus-visible, button:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- page ---------- */

.stage {
  min-height: 100vh;
  padding: 48px 16px 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hint {
  display: none;
  margin: 0 0 22px;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}

.soon {
  margin: 34px 0 0;
  font-size: 15px;
  color: var(--muted);
  text-align: center;
}

/* ---------- card ---------- */

.scene { width: min(640px, 100%); }

/* Without JavaScript the two faces simply stack. */
.card {
  display: grid;
  gap: 24px;
}

.face {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 38px 38px 30px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.foil {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--foil);
  background-size: 300% 100%;
  background-position: 0% 0;
  transition: background-position 1.2s ease;
}

.scene:hover .foil { background-position: 100% 0; }

/* ---------- front ---------- */

.kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.name {
  margin: 14px 0 12px;
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  font-size: clamp(48px, 9vw, 72px);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--ink);
}

.line {
  max-width: 36ch;
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
}

.motto {
  margin: 10px 0 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: auto;
  padding-top: 24px;
  font-size: 15px;
}

.foot a {
  color: var(--body);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.foot a:hover { border-bottom-color: var(--body); }

/* ---------- back ---------- */

.back h2 {
  margin: 0 0 12px;
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
  color: var(--ink);
}

.pitch {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
}

.topics {
  margin: 14px 0 0;
  font-size: 15px;
  font-style: italic;
  color: var(--faint);
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
}

/* ---------- contact form (HOM-2) ---------- */

turbo-frame { display: contents; }

.contact {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-top: 18px;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fields input, .fields textarea {
  width: 100%;
  padding: 10px 12px;
  font: 16px/1.4 "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fields textarea { grid-column: 1 / -1; resize: vertical; min-height: 96px; }

.fields input:focus-visible, .fields textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.fields [aria-invalid="true"] { border-color: var(--rose); }

.notice {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--rose);
}

.sent {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-top: 18px;
}

.sent p {
  margin: auto 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 28px;
  color: var(--ink);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The contact pages outside the card (no JavaScript, or a direct visit) use one face on its own. */
.standalone { width: min(640px, 100%); }

.backlink.standalone-only { display: inline; }

.js .scene .backlink.standalone-only { display: none; }

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

.flip, .send {
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  font: 700 15px "DM Sans", system-ui, sans-serif;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
}

.flip { display: none; margin-left: auto; }

.backlink {
  display: none;
  border: 0;
  padding: 0;
  font: 15px "DM Sans", system-ui, sans-serif;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- flip (whenever JavaScript is on) ----------
 * The layout's first <head> script marks <html class="js"> before anything paints, so the card
 * starts in its flip layout instead of flashing both faces stacked while CardController loads.
 * Only the front is in the flow; the back sits on top of it, so the card starts at the front's
 * height and CardController grows it to the back's height on flip. */

.js .scene { perspective: 1400px; }

.js .scene .card {
  /* Grid stretches the front to the explicit card height, preventing it from shrinking back. */
  display: block;
  position: relative;
  gap: 0;
  transform-style: preserve-3d;
  transform: rotateZ(-1.5deg);
  transition: transform .8s cubic-bezier(.2, .8, .2, 1), height .8s cubic-bezier(.2, .8, .2, 1);
}

.js .scene .face { backface-visibility: hidden; }

.js .scene .back {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: rotateY(180deg);
}

.js .scene .front { cursor: pointer; }

[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

.js .scene:hover .card:not(.flipped) { transform: rotateY(-6deg) rotateZ(-.5deg) translateY(-4px); }

.js .scene .card.flipped { transform: rotateY(180deg) rotateZ(1deg); }

/* The same lift on the back, mirrored (180deg + 6deg) so it leans the same way as the front. */
.js .scene:hover .card.flipped { transform: rotateY(186deg) rotateZ(.5deg) translateY(-4px); }

.js .scene .flip { display: inline-block; }

.js .scene .backlink { display: inline; }

.js .hint { display: block; }

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  .face { min-height: 0; padding: 30px 24px 24px; }
  .flip { margin-left: 0; }
  .back h2 { font-size: 26px; }
  .fields { grid-template-columns: 1fr; }
  .line, .pitch { font-size: 17px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .foil { transition: none; }

  .js .scene .card,
  .js .scene:hover .card:not(.flipped) {
    transition: none;
    transform: none;
  }

  .js .scene .card.flipped,
  .js .scene:hover .card.flipped { transform: rotateY(180deg); }
}
