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

:root {
  --black: #030405;
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-muted: #fafafa;
  --text: #030405;
  --text-muted: #5c5c5c;
  --outline: #d4d4d4;
  --shadow: 0 16px 48px rgba(3, 4, 5, 0.08);
  --radius: 24px;
  --radius-sm: 14px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(3, 4, 5, 0.04), transparent 70%),
    var(--bg);
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* ── Card shell ── */
.card {
  width: min(100%, 440px);
  background: var(--surface);
  border: 1px solid rgba(3, 4, 5, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Header ── */
.card__header {
  padding: 28px 24px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(3, 4, 5, 0.06);
}

.card__identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.logo {
  width: min(200px, 72%);
  height: auto;
  display: block;
}

.card__name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card__tagline {
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.save-btn--header {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 18px auto 0;
}

/* ── Body sections ── */
.card__body {
  display: flex;
  flex-direction: column;
}

.card__connect,
.card__form-panel {
  padding: 24px 20px;
}

.card__form-panel {
  border-top: 1px solid rgba(3, 4, 5, 0.06);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.section-label--social {
  margin-top: 20px;
}

/* ── Links ── */
.link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-list--social {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(3, 4, 5, 0.06);
  background: var(--surface-muted);
  transition: background 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.link-item:hover,
.link-item:focus-visible {
  background: rgba(3, 4, 5, 0.04);
  border-color: rgba(3, 4, 5, 0.12);
  outline: none;
}

.link-item--social {
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  min-height: 112px;
  text-align: center;
  gap: 8px;
  padding: 14px 8px;
}

.link-item__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #f0f0f0;
  color: var(--black);
}

.link-item--social .link-item__icon {
  width: 44px;
  height: 44px;
}

.link-item__icon--instagram,
.link-item__icon--x {
  background: var(--black);
  color: #fff;
}

.link-item__icon--facebook {
  background: #1877f2;
  color: #fff;
}

.link-item__content {
  min-width: 0;
  flex: 1;
}

.link-item--social .link-item__content {
  flex: unset;
  width: 100%;
}

.link-item__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.link-item__value {
  display: block;
  margin-top: 2px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-item--social .link-item__value {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
  line-height: 1.35;
}

.link-item__arrow {
  flex-shrink: 0;
  color: var(--outline);
}

/* ── Form ── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.form-field__input {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  padding: 12px 14px;
  border: 1px solid rgba(3, 4, 5, 0.12);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-field__input:focus {
  outline: none;
  border-color: rgba(3, 4, 5, 0.35);
  background: var(--surface);
}

.form-field__textarea {
  resize: vertical;
  min-height: 96px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-success {
  font-size: 0.875rem;
  color: #1a6b38;
  background: #e8f5ee;
  border: 1px solid #b8e0c8;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}

.form-error {
  font-size: 0.875rem;
  color: #9b1c1c;
  background: #fdecec;
  border: 1px solid #f5c2c2;
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}

.form-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ── Buttons ── */
.btn-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-with-icon svg {
  flex-shrink: 0;
}

.save-btn,
.btn-primary {
  width: 100%;
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 14px 20px;
  border-radius: 999px;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.form-submit {
  margin-top: 4px;
}

.save-btn {
  border: 1.5px solid rgba(3, 4, 5, 0.18);
  color: var(--black);
  background: var(--surface);
  box-shadow: none;
}

.save-btn:hover {
  background: rgba(3, 4, 5, 0.04);
  border-color: rgba(3, 4, 5, 0.28);
}

.btn-primary {
  border: none;
  color: #fff;
  background: var(--black);
  box-shadow: 0 4px 16px rgba(3, 4, 5, 0.2);
}

.btn-primary:hover {
  background: #1a1b1c;
}

.save-btn:active,
.btn-primary:active {
  transform: scale(0.98);
}

/* ── Desktop: shared column grid for header + body ── */
@media (min-width: 768px) {
  .page {
    padding: 40px 32px;
  }

  .card {
    --col-pad: 40px;
    --col-gap: 36px;
    width: min(100%, 920px);
    max-width: 920px;
    display: grid;
    grid-template-columns: 1fr 1.15fr;
  }

  .card__header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 32px var(--col-pad);
    text-align: left;
  }

  .card__identity {
    flex: 1;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .card__titles {
    min-width: 0;
  }

  .logo {
    width: 180px;
    flex-shrink: 0;
  }

  .card__name {
    font-size: 1.5rem;
  }

  .card__tagline {
    font-size: 0.9375rem;
    margin-top: 6px;
  }

  .save-btn--header {
    flex-shrink: 0;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 14px 24px;
  }

  .card__body {
    display: contents;
  }

  .card__connect {
    grid-column: 1;
    padding: 32px var(--col-gap) 40px var(--col-pad);
    background: var(--surface-muted);
    border-right: 1px solid rgba(3, 4, 5, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .card__form-panel {
    grid-column: 2;
    padding: 32px var(--col-pad) 40px var(--col-gap);
    border-top: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .form-submit {
    align-self: flex-end;
    width: auto;
    margin-top: 4px;
  }

  .section-label--social {
    margin-top: 24px;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .link-item {
    padding: 14px 16px;
    background: var(--surface);
  }

  .link-item--social {
    min-height: 120px;
    padding: 16px 10px;
    background: var(--surface);
  }
}

@media (min-width: 1024px) {
  .card {
    --col-pad: 48px;
    --col-gap: 40px;
    width: min(100%, 980px);
    max-width: 980px;
  }

  .card__header {
    padding: 36px var(--col-pad);
  }

  .card__connect {
    padding-bottom: 48px;
  }

  .card__form-panel {
    padding-bottom: 48px;
  }

  .logo {
    width: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .link-item,
  .save-btn,
  .btn-primary {
    transition: none;
  }
}
