@import url('https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;600&display=swap');
@import url('https://fonts.cdnfonts.com/css/engebrechtre');

* { box-sizing: border-box; }

:root {
  --cream: #fbf7ef;
  --black: #000000;
  --white: #ffffff;
  --line: rgba(0, 0, 0, 0.72);
  --muted: rgba(0, 0, 0, 0.68);
  --error: #8f2424;
  --page-width: 1320px;
  --heading-font: "Engebrechtre", "Arial Narrow", sans-serif;
  --body-font: "Schibsted Grotesk", Arial, sans-serif;
}

html { background: transparent; }

body {
  margin: 0;
  background: transparent;
  color: var(--black);
  font-family: var(--body-font);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

button, input, textarea { font: inherit; }

.page {
  width: min(calc(100% - 48px), var(--page-width));
  margin: 0 auto;
  padding: 58px 0 80px;
}

.page--form { max-width: 950px; }

h1, h2 {
  font-family: var(--heading-font);
  font-weight: 400;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 1000px;
  margin: 0;
  font-size: clamp(4.5rem, 10vw, 9.5rem);
  line-height: 0.88;
}

.intro {
  max-width: 720px;
  margin: 42px 0 70px;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.25;
}

.form { border-top: 1px solid var(--line); }

.field {
  display: grid;
  grid-template-columns: minmax(170px, 0.4fr) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

label {
  padding-top: 13px;
  font-size: 1rem;
}

input, textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 12px 0;
  background: transparent;
  color: var(--black);
  font-size: 1.15rem;
}

input:focus, textarea:focus { outline: none; }

textarea {
  min-height: 110px;
  resize: vertical;
}

input[type="file"] { padding: 7px 0 12px; }

input[type="file"]::file-selector-button {
  margin-right: 18px;
  border: 2px solid var(--black);
  border-radius: 0;
  padding: 0.8rem 1.25rem;
  background: transparent;
  color: var(--black);
  font-family: var(--body-font);
  font-size: 1rem;
  letter-spacing: -0.03em;
  cursor: pointer;
}

.help {
  grid-column: 2;
  margin: -20px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 2px solid var(--black);

  padding: 1rem 1.5rem;

  cursor: pointer;

  transition: .2s;

  margin-bottom: 18px;
}

.upload-button:hover {
  background: var(--black);
  color: white;
}

.file-name {
  display: block;

  margin-bottom: 22px;

  color: rgba(0,0,0,.6);

  font-size: .95rem;
}

.preview-help {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-actions { padding-top: 40px; }

.button, .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--black);
  border-radius: 0;
  padding: 1.3rem 2.171rem;
  background: transparent;
  color: var(--black);
  font-family: var(--body-font);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.button:hover, .link-button:hover {
  background: var(--black);
  color: var(--white);
}

.button:disabled { cursor: wait; opacity: 0.5; }

.status {
  min-height: 24px;
  margin: 18px 0 0;
  font-size: 1rem;
}

.status--error { color: var(--error); }
.hidden { display: none !important; }

.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
  overflow-y: auto;
  background: var(--cream);
}

.success-card {
  width: min(100%, 900px);
  padding: 55px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.success-card h2 {
  margin: 0 0 30px;
  font-size: clamp(4rem, 10vw, 8.5rem);
  line-height: 0.9;
}

.success-card p {
  max-width: 620px;
  margin: 0 0 40px;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.3;
}

.gallery-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: end;
  padding-bottom: 45px;
  border-bottom: 1px solid var(--line);
}

.guest-count {
  margin: 0 0 9px;
  font-size: 1.1rem;
  white-space: nowrap;
}

.guest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 46px;
}

.guest-card {
  min-width: 0;
  padding: 48px 0 55px;
  border-bottom: 1px solid var(--line);
}

.guest-photo-wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto 25px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: rgba(0, 0, 0, 0.06);
}

.guest-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.guest-name {
  margin: 0 0 10px;
  font-size: clamp(2.3rem, 4vw, 4.6rem);
  line-height: 0.95;
}

.guest-relationship {
  margin: 0 0 22px;
  font-size: 1rem;
  font-weight: 600;
}

.guest-fact {
  max-width: 600px;
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.35;
  font-style: italic;
}

.guest-fact::before {
  content: "“ ";
}

.guest-fact::after {
  content: " ”";
}

.empty-state {
  padding: 55px 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.2rem;
}

.photo-preview-wrap {
  width: min(100%, 380px);
  margin-top: 24px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: rgba(0, 0, 0, 0.06);
}

.photo-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

@media (max-width: 760px) {
  .page {
    width: min(calc(100% - 28px), var(--page-width));
    padding: 34px 0 55px;
  }

  h1 { font-size: clamp(3.7rem, 18vw, 6rem); }

  .intro {
    margin: 28px 0 46px;
    font-size: 1.2rem;
  }

  .field {
    display: block;
    padding: 26px 0 28px;
  }

  label {
    display: block;
    margin-bottom: 20px;
    padding: 0;
  }

  input, textarea { font-size: 1.1rem; }

  .help { margin: 8px 0 0; }

  .form-actions { padding-top: 30px; }

  .button, .link-button { width: 100%; }

  .success-overlay { padding: 24px; }

  .success-card { padding: 38px 0; }

  .success-card h2 {
    font-size: clamp(3.8rem, 17vw, 6.5rem);
  }

  .gallery-header {
    display: block;
    padding-bottom: 32px;
  }

  .guest-count { margin: 22px 0 0; }

  .guest-grid { display: block; }

  .guest-card { padding: 34px 0 42px; }

  .guest-photo-wrap {
  width: 82%;
  max-width: none;
  margin: 0 auto 20px;
  aspect-ratio: 4 / 5;
}

  .guest-name {
    font-size: clamp(2.8rem, 13vw, 4.5rem);
  }

  .guest-fact { font-size: 1.05rem; }
}
