/* styles.css */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f2f2f2;
  min-height: 100vh;
  color: #161616;
  line-height: 1.6;
}

:root{
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --kb-safe-area: 0px; /* updated by JS */
}

#cf-message{
  /* when focused, ensure the browser can scroll past it */
  scroll-margin-bottom: 120px;
}

/* Container */
.container {
  max-width: 430px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 0 30px rgba(0,0,0,0.1);
}

/* Hero */
.hero-section { width: 100%; position: relative; overflow: hidden; }
.hero-image {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 350px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 32px;
  z-index: 1;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: transparent;
  display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 32px;
}
.profile-info { text-align: left; color: #fff; z-index: 2; }
.profile-name {
  font-size: 32px; font-weight: 600; margin-bottom: 4px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.7);
  letter-spacing: -0.02em;
}
.profile-username {
  font-size: 18px; opacity: .95; font-weight: 400; color: #f0f0f0;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.8), 0 0 6px rgba(0,0,0,0.6);
}

/* Social row */
.social-row {
  display: flex; justify-content: center; gap: 24px;
  padding: 24px; background: #fff; border-bottom: 1px solid #e0e0e0;
  position: relative; z-index: 2;
}
.social-icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: #f4f4f4; border: 1px solid #e0e0e0;
  transition: all .2s ease; text-decoration: none;
}
.social-icon:hover {
  background: #e0e0e0; transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.social-icon img,
.card-icon img {
  display: block; width: 24px; height: 24px; object-fit: contain;
}

/* Categories */
.categories {
  width: 100%;
  display: flex; flex-direction: column; gap: 32px;
  padding: 32px 24px 24px;
}
.category { width: 100%; }
.category h3 {
  font-size: 20px; font-weight: 600; color: #161616; margin-bottom: 20px;
  text-align: left; letter-spacing: -0.02em;
  border-bottom: 1px solid #e0e0e0; padding-bottom: 8px;
}
.category-links { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.link-card {
  display: flex; align-items: center; width: 100%;
  background: #f8f8f8; border: 1px solid #e0e0e0;
  padding: 16px 20px; text-decoration: none; color: #161616;
  transition: all .15s cubic-bezier(0.2,0,0.38,0.9);
  border-radius: 8px; margin-bottom: 8px;
}
.link-card:hover {
  background: #fff; color: #0f62fe; transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: #c6c6c6;
}
.card-icon {
  width: 24px; height: 24px; margin-right: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.card-content { flex: 1; }
.card-title { font-size: 16px; font-weight: 400; margin-bottom: 2px; color: inherit; letter-spacing: -0.01em; }
.card-subtitle { font-size: 14px; color: #6f6f6f; font-weight: 300; }

/* Contact section (always visible) */
.contact-section {
  padding-top: 28px;
  padding-left:  24px;
  padding-right: 24px;
  border-top: 1px solid #e0e0e0;
  background: #fff;
  /* guard any transient 3D overflow */
  overflow: hidden;

  padding-bottom: calc(128px + var(--safe-bottom) + var(--kb-safe-area));
}
.contact-card { position: relative; }

/* Flip */
.flip { perspective: 1000px; }
.flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 600ms cubic-bezier(0.2, 0, 0.2, 1);
  /* Height is driven by the tallest face; JS sets --flip-height */
  min-height: var(--flip-height, 320px);
}
.contact-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.flip-face.front { display: block; }
.flip-face.back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column; /* ← stack h3 and p */
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 6px; /* optional: space between lines */
}
.flip-face.back h3 { margin: 0; }
.flip-face.back p  { margin: 0; }

/* Contact form */
#contact-form { display: grid; gap: 12px; grid-template-rows: auto auto auto auto auto; }
#contact-form h3 { font-size: 18px; margin-bottom: 4px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: #525252; }
.field input, .field textarea {
  border: 1px solid #c6c6c6; border-radius: 6px;
  padding: 10px 12px; font: inherit; color: #161616; background: #fff;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: #0f62fe; box-shadow: 0 0 0 3px rgba(15,98,254,0.15);
}
.helper { font-size: 12px; color: #a2191f; min-height: 16px; }

/* Actions */
.actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px;
}
.btn-primary {
  appearance: none; border: none; border-radius: 6px; padding: 10px 14px;
  background: #0f62fe; color: #fff; font-weight: 600; cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}
.btn-primary:hover { background: #0950d3; transform: translateY(-1px); }
.btn-primary:disabled { opacity: .7; cursor: default; transform: none; }

/* Responsive */
@media (max-width: 480px) {
  .container { margin: 0; border-radius: 0; min-height: 100vh; }
  .hero-image { height: 280px; }
  .profile-name { font-size: 28px; }
  .categories { padding: 20px; }
  .social-row { padding: 20px; }
  .contact-section { padding: 24px 20px 40px; }
}
