/* Johanna & Thomas — shared design tokens and base styles.
   A French faire-part: ivory paper, bordeaux ink, champagne hairlines, Garamond lettering, and a card with
   scooped corners inside a double hairline. Every page links this file first, then adds its own layout CSS.
   Colors are tokens only (the card's frame picture, --frame, repeats two of them: see the note beside it). */
:root {
  --paper: #FBF8F3;    /* ivoire — page ground */
  --stone: #F3EBE3;    /* pierre de Paris — bands, tiles */
  --card: #FFFFFF;     /* raised surfaces, inputs */
  --ink: #2B1D22;      /* encre — text (a brown-black with a little wine in it) */
  --ink-soft: #6B5960; /* secondary text */
  --accent: #7A2236;   /* bordeaux — links, primary actions, the French lines */
  --gilt: #A5854C;     /* champagne — hairlines, ornaments, ampersand */
  --rule: #E3D8CD;     /* hairlines */
  --wash: #F4E6E6;     /* rose poudré — selected / focus wash */
  --ok: #2E6A4D;   --ok-wash: #E2EEE6;
  --warn: #8F5E10; --warn-wash: #F5EAD5;
  --bad: #B3371F;  --bad-wash: #F8E3DC;   /* vermillon, kept well apart from the bordeaux */
  --scrim: rgba(43, 29, 34, .40);
  --shadow: 0 1px 2px rgba(43, 29, 34, .06), 0 10px 30px rgba(43, 29, 34, .10);
  --card-shadow: rgba(43, 29, 34, .30);   /* the soft shadow under the invitation card */
  /* The invitation card's frame (.cartouche below): a small drawing with scooped corners and two hairlines.
     A drawing cannot read the tokens, so it repeats --paper (its fill) and --gilt (its lines), written %23
     instead of #. If either token changes, change it here and in the two dark copies below. */
  --frame: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M24.5 .5H95.5A24 24 0 0 0 119.5 24.5V95.5A24 24 0 0 0 95.5 119.5H24.5A24 24 0 0 0 .5 95.5V24.5A24 24 0 0 0 24.5 .5Z' fill='%23FBF8F3' stroke='%23A5854C'/%3E%3Cpath d='M30.7 7.5H89.3A31 31 0 0 0 112.5 30.7V89.3A31 31 0 0 0 89.3 112.5H30.7A31 31 0 0 0 7.5 89.3V30.7A31 31 0 0 0 30.7 7.5Z' fill='none' stroke='%23A5854C' stroke-opacity='.6'/%3E%3C/svg%3E");

  /* Only weights 500 to 700 of the display face are loaded, on purpose: text that asks for 400 gets the 500,
     because the 400 is too thin on a phone. */
  --font-display: "Cormorant Garamond", "Cormorant", Garamond, "Hoefler Text", Georgia, serif;
  --font-body: "EB Garamond", Garamond, Georgia, serif;
  --font-ui: "Jost", "Futura", "Avenir Next", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --radius: 2px;
  color-scheme: light;

  /* Lining figures everywhere. The display face's old-style 1 looks like a capital I, so "11 septembre" would
     read as "II septembre". A rule that sets font-variant-numeric must repeat lining-nums. */
  font-variant-numeric: lining-nums;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171013; --stone: #21171B; --card: #1D1418; --ink: #F0E8DE; --ink-soft: #BDACAB;
    --accent: #E3B5A8; --gilt: #CDB27A; --rule: #3B2B31; --wash: #3A2028;
    --ok: #86CBA5; --ok-wash: #16332A; --warn: #E3B562; --warn-wash: #352A14; --bad: #F0957F; --bad-wash: #40201A;
    --scrim: rgba(0, 0, 0, .55); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .4); --card-shadow: rgba(0, 0, 0, .6);
    --frame: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M24.5 .5H95.5A24 24 0 0 0 119.5 24.5V95.5A24 24 0 0 0 95.5 119.5H24.5A24 24 0 0 0 .5 95.5V24.5A24 24 0 0 0 24.5 .5Z' fill='%23171013' stroke='%23CDB27A'/%3E%3Cpath d='M30.7 7.5H89.3A31 31 0 0 0 112.5 30.7V89.3A31 31 0 0 0 89.3 112.5H30.7A31 31 0 0 0 7.5 89.3V30.7A31 31 0 0 0 30.7 7.5Z' fill='none' stroke='%23CDB27A' stroke-opacity='.6'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #171013; --stone: #21171B; --card: #1D1418; --ink: #F0E8DE; --ink-soft: #BDACAB;
  --accent: #E3B5A8; --gilt: #CDB27A; --rule: #3B2B31; --wash: #3A2028;
  --ok: #86CBA5; --ok-wash: #16332A; --warn: #E3B562; --warn-wash: #352A14; --bad: #F0957F; --bad-wash: #40201A;
  --scrim: rgba(0, 0, 0, .55); --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .4); --card-shadow: rgba(0, 0, 0, .6);
  --frame: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M24.5 .5H95.5A24 24 0 0 0 119.5 24.5V95.5A24 24 0 0 0 95.5 119.5H24.5A24 24 0 0 0 .5 95.5V24.5A24 24 0 0 0 24.5 .5Z' fill='%23171013' stroke='%23CDB27A'/%3E%3Cpath d='M30.7 7.5H89.3A31 31 0 0 0 112.5 30.7V89.3A31 31 0 0 0 89.3 112.5H30.7A31 31 0 0 0 7.5 89.3V30.7A31 31 0 0 0 30.7 7.5Z' fill='none' stroke='%23CDB27A' stroke-opacity='.6'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--gilt) 35%, transparent); }
h1, h2, h3, h4 { text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums lining-nums; }

.wrap { max-width: 1120px; margin-inline: auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }

/* labels, eyebrows */
.eyebrow { margin: 0 0 2px; font-family: var(--font-body); font-style: italic; font-size: 18px; color: var(--gilt); }
.label { font-family: var(--font-ui); font-size: 11.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  font-family: var(--font-ui); font-weight: 500; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .15s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--ink-soft); background: var(--card); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad-wash); }
.btn.danger.armed { background: var(--bad); color: var(--paper); border-color: var(--bad); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-family: var(--font-ui); font-size: 13px; letter-spacing: .04em; text-decoration: underline; text-underline-offset: 3px; }

/* form fields — 16px text so iOS never zooms on focus */
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .field > label { font-family: var(--font-ui); font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.field em { text-transform: none; letter-spacing: 0; font-weight: 400; font-style: italic; font-family: var(--font-body); font-size: 14px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; min-width: 0; min-height: 44px;
  font-family: var(--font-ui); font-size: 16px; line-height: 1.3;
  padding: 10px 12px; background: var(--card); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius);
  transition: border-color .2s ease, box-shadow .2s ease;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 20px; height: 20px; margin: 0; flex: none; }
.check { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-ui); font-size: 15px; color: var(--ink); min-height: 44px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-ui); font-size: 12px; font-weight: 500; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; background: var(--stone); color: var(--ink-soft); white-space: nowrap; }
.pill.ok { background: var(--ok-wash); color: var(--ok); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.bad { background: var(--bad-wash); color: var(--bad); }
.pill.blue { background: var(--wash); color: var(--accent); }   /* "blue" is the old name: it is the accent pill */

/* double filet: two champagne hairlines, the classic French stationery frame */
.engraved { background: var(--card); border: 1px solid var(--gilt); outline: 1px solid var(--gilt); outline-offset: -7px; }

/* the cartouche: the invitation card. A rectangle whose four corners are scooped out, inside two champagne
   hairlines that follow the scoops. The frame picture (--frame, at the top of this file) supplies the paper
   fill as well as the lines, so a page must not give the card a background of its own: that would fill the
   scooped corners back in. The corners keep their size at every width; the edges and the middle stretch. */
.cartouche {
  position: relative;
  border: 1px solid transparent;   /* a border has to exist for the frame picture to be drawn */
  border-image-source: var(--frame);
  border-image-slice: 40 fill;
  border-image-width: 40px;
  box-shadow: 0 28px 56px -36px var(--card-shadow);   /* soft and far below, so it never outlines the corners */
}

/* monogram (inline SVG): a ring, a ring of pearls, and the two initials */
.mono { color: var(--ink); }
.mono text { font-family: var(--font-display); font-style: italic; }
.m-ring { fill: none; stroke: var(--gilt); stroke-width: 1; }
/* the pearls: a dotted circle. Each SVG gives this circle a pathLength equal to the number of pearls. */
.m-pearls { fill: none; stroke: var(--gilt); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 0 1; }
.m-letter { font-family: var(--font-display); font-style: italic; font-weight: 500; fill: var(--ink); }
.m-amp { font-family: var(--font-display); font-style: italic; font-weight: 500; fill: var(--gilt); }

/* ornament (inline SVG): two leaves on a hairline */
.orn { display: block; width: 168px; height: 16px; }
.orn line { stroke: var(--gilt); stroke-width: 1; }
.orn path { fill: none; stroke: var(--gilt); stroke-width: 1; }
.orn circle { fill: var(--gilt); }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw-ring { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes settle { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Reveal on scroll. A page's script adds .rv to what it wants revealed and .in when it comes into view, so
   without the script nothing is ever hidden. */
.rv { opacity: 0; transform: translateY(16px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--rv-delay, 0ms); }
.rv.in { opacity: 1; transform: none; }
@media print { .rv { opacity: 1 !important; transform: none !important; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .rv { opacity: 1; transform: none; }
}
