:root {
    --ivory: #f7f2e8;
    --lace: #fffdf9;
    --sage: #6b7a5a;
    --sage-dark: #46543a;
    --sage-pale: #dfe4d5;
    --charcoal: #2a2721;
    --charcoal-soft: #5a5748;
    --border: #d9cfb4;
  }

  * { box-sizing: border-box; }

  html { scroll-behavior: smooth; }

  body {
    margin: 0;
    background-color: var(--ivory);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-blend-mode: multiply;
    color: var(--charcoal);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
  }

  .wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1.75rem;
  }

  /* ---------- Hero ---------- */

  .hero {
    padding: 4.5rem 0 3.5rem;
    text-align: center;
  }

  .hero-content {
    opacity: 0;
    animation: rise 1.4s ease-out 0.2s forwards;
  }

  .photo-frame {
    display: inline-block;
    background: var(--lace);
    padding: 1.4rem 1.4rem 0;
    box-shadow: 0 22px 46px rgba(42,39,33,0.20), 0 3px 10px rgba(42,39,33,0.09);
    max-width: 460px;
    width: 100%;
  }

  .photo-frame img {
    display: block;
    width: 100%;
    height: auto;
  }

  .polaroid-caption-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 4% 1.3rem;
  }

  .polaroid-caption {
    font-family: 'Parisienne', cursive;
    font-weight: 400;
    font-size: clamp(1.6rem, 8vw, 2.2rem);
    color: var(--sage-dark);
    margin: 0;
    line-height: 1;
    text-align: center;
    width: 100%;
    white-space: nowrap;
  }

  .hero-sub {
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.7rem, 6vw, 2.4rem);
    color: var(--charcoal-soft);
    letter-spacing: 0.03em;
    margin: 1.6rem 0 0;
  }

  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @media (prefers-reduced-motion: reduce) {
    .hero-content { animation: none; opacity: 1; }
  }

  @media (max-width: 480px) {
    .photo-frame { padding: 1rem 1rem 0; }
  }

  /* ---------- Sections ---------- */

  section {
    padding: 4.5rem 0;
    text-align: center;
  }

  .divider {
    display: flex;
    justify-content: center;
    margin: 0 auto 3rem;
    width: 100%;
  }

  .divider svg { width: 120px; height: 20px; color: var(--sage-dark); }

  #date { padding-top: 3rem; padding-bottom: 6rem; }

  h2 {
    font-weight: 400;
    font-style: italic;
    font-size: 1.6rem;
    color: var(--sage-dark);
    margin: 0 0 1.25rem;
  }

  .date-full {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    font-weight: 500;
    letter-spacing: 0.02em;
    margin: 0 0 2.5rem;
  }

  .countdown {
    display: flex;
    justify-content: center;
    gap: 0;
  }

  .countdown-item {
    padding: 0 1.4rem;
    border-right: 1px solid var(--border);
  }

  .countdown-item:last-child { border-right: none; }

  .countdown-num {
    font-size: clamp(1.8rem, 6vw, 2.6rem);
    font-weight: 500;
    color: var(--sage-dark);
    display: block;
  }

  .countdown-label {
    font-style: italic;
    font-size: 0.95rem;
    color: var(--charcoal-soft);
  }

  #venue { padding-top: 3rem; padding-bottom: 6rem; }

  .venue-name { font-size: 1.7rem; font-weight: 500; margin: 0 0 0.25rem; }
  .venue-place { color: var(--charcoal-soft); margin: 0 0 1.5rem; }
  .venue-note { max-width: 480px; margin: 0 auto; color: var(--charcoal-soft); font-style: italic; }

  .invite-note {
    max-width: 480px;
    margin: 0 auto;
    color: var(--charcoal-soft);
  }

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

  .form-section {
    background: url('assets/paper-texture.svg'), var(--lace);
    background-size: 320px 320px;
    background-repeat: repeat;
  }

  form { max-width: 460px; margin: 2.5rem auto 0; text-align: left; }

  .field { margin-bottom: 1.4rem; }

  .field-row { display: flex; gap: 1rem; }
  .field-row .field { flex: 1; }

  label {
    display: block;
    font-style: italic;
    font-size: 0.98rem;
    color: var(--charcoal-soft);
    margin-bottom: 0.35rem;
  }

  input, textarea {
    width: 100%;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.08rem;
    color: var(--charcoal);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0.1rem;
    outline: none;
    transition: border-color 0.2s ease;
  }

  textarea { resize: vertical; min-height: 4.5rem; }

  input:focus, textarea:focus {
    border-color: var(--sage);
  }

  .hidden-field { position: absolute; left: -9999px; }

  button[type="submit"] {
    display: block;
    margin: 2.25rem auto 0;
    padding: 0.85rem 2.6rem;
    background: var(--sage-dark);
    color: var(--lace);
    border: none;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  button[type="submit"]:hover { background: var(--sage); }
  button[type="submit"]:focus-visible { outline: 2px solid var(--sage-dark); outline-offset: 3px; }

  button[type="submit"]:disabled { opacity: 0.6; cursor: default; }

  .form-message {
    text-align: center;
    margin-top: 1.5rem;
    font-style: italic;
    color: var(--sage-dark);
    display: none;
  }

  .form-message.visible { display: block; }
  .form-message.error { color: #a15c4a; }

  form.submitted .field,
  form.submitted button[type="submit"] { display: none; }

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

  footer {
    padding: 3rem 0 3.5rem;
    text-align: center;
    color: var(--charcoal-soft);
    font-style: italic;
    font-size: 1.3rem;
  }

  @media (max-width: 480px) {
    .countdown-item { padding: 0 0.85rem; }
    .field-row { flex-direction: column; gap: 0; }
  }

  /* ---------- Language modal ---------- */

  .lang-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ivory);
    padding: 1.75rem;
  }

  .lang-modal[hidden] { display: none; }

  .lang-modal-card { text-align: center; max-width: 360px; }

  .lang-modal-prompt {
    font-style: italic;
    color: var(--charcoal-soft);
    margin: 0 0 1.75rem;
    font-size: 1.15rem;
    line-height: 1.5;
  }

  .lang-modal-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
  }

  .lang-option {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.1rem;
    padding: 0.75rem 1.75rem;
    background: transparent;
    border: 1px solid var(--sage-dark);
    color: var(--sage-dark);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .lang-option:hover,
  .lang-option:focus-visible { background: var(--sage-dark); color: var(--lace); }

  body.lang-modal-open { overflow: hidden; }

  /* ---------- Language switch ---------- */

  .lang-switch {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--charcoal-soft);
    background: var(--ivory);
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border);
  }

  .lang-switch button {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    background: none;
    border: none;
    color: var(--charcoal-soft);
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
  }

  .lang-switch button.active {
    color: var(--sage-dark);
    font-weight: 600;
  }
