/* Tarjeta digital · Federico Martín Herbst Salinas · Power Solar */

:root {
  --accent: #EC6624;
  --accent-soft: #FDF0E8;
  --accent-line: #F6D3BF;
  --dark: #231E21;
  --text: #231E21;
  --muted: #5C5559;
  --subtle: #8A8287;
  --line: #EEE7E1;
  --cream: #FBF7F2;
  --page: #F6F1EB;
  --white: #FFFFFF;
  --radius-card: 28px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
p, h1, h2, ul { margin: 0; }
ul { padding: 0; list-style: none; }
.nowrap { white-space: nowrap; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}

/* ---------- Icons ---------- */
.ico {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico--fill { fill: var(--accent); stroke: none; }
.ico--dark { stroke: var(--dark); }
.ico--sm { width: 14px; height: 14px; stroke-width: 2; }

/* ---------- Page + card ---------- */
.page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: max(10px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom));
}

.card {
  position: relative;
  width: 100%;
  max-width: 410px;
  background: var(--white);
  border: 1px solid #EDE5DD;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(35, 30, 33, .04),
    0 18px 50px -18px rgba(35, 30, 33, .18);
}

@media (min-width: 520px) {
  .page { padding: 40px 24px; min-height: 100vh; align-items: center; }
}

/* ---------- Hero: logo + foto ---------- */
.hero {
  position: relative;
  padding: 30px 24px 0;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, #FFF8F2 0%, var(--cream) 55%, var(--cream) 100%);
  isolation: isolate;
}
.hero::after {
  /* bottom edge of the cream band, behind the avatar */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 74px;
  background: var(--white);
  z-index: -1;
}

/* Signature: the Power Solar sun mark rising behind the portrait;
   the white band (.hero::after) hides its lower half like a horizon. */
.hero__sun {
  position: absolute;
  left: 50%;
  bottom: 74px;
  width: 276px;
  height: 276px;
  margin: 0 0 -138px -138px;
  pointer-events: none;
  z-index: -2;
}
.hero__sun img {
  width: 100%;
  height: 100%;
  max-width: none;
  opacity: .14;
  animation: spin 90s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hero__logo {
  display: inline-block;
  padding: 4px 6px;
}
.hero__logo img {
  height: 38px;
  width: auto;
  object-fit: contain;
  margin: 0 auto;
}

.avatar {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 30px auto 0;
  border-radius: 50%;
  padding: 4px;
  isolation: isolate;
}
.avatar::before {
  /* white mat + thin accent ring */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--white);
  box-shadow:
    0 0 0 2px var(--accent),
    0 14px 34px -10px rgba(236, 102, 36, .35);
  z-index: -1;
}
.avatar picture img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
}
.avatar picture { display: block; width: 100%; height: 100%; }

/* ---------- Identity ---------- */
.identity {
  padding: 18px 16px 0;
  text-align: center;
}
.identity__name {
  font-weight: 600;
  font-size: 1.5rem;          /* 24px */
  line-height: 1.22;
  letter-spacing: -.01em;
  color: var(--dark);
  text-wrap: balance;
}
.identity__role {
  margin-top: 6px;
  font-weight: 600;
  font-size: 1.1875rem;       /* 19px: large text, AA with brand orange */
  line-height: 1.3;
  letter-spacing: -.005em;
  color: var(--accent);
}
.identity__tagline {
  margin-top: 8px;
  font-size: .875rem;         /* 14px */
  color: var(--muted);
}

/* ---------- Contact 2×2 ---------- */
.contact {
  margin: 22px 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 0;
  position: relative;
}
.contact__grid::before {
  /* vertical divider */
  content: "";
  position: absolute;
  top: 16px; bottom: 16px; left: 50%;
  width: 1px;
  background: var(--line);
}
.contact__grid li:nth-child(odd)  { padding-right: 6px; }
.contact__grid li:nth-child(even) { padding-left: 12px; }

.contact__item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 2px;
  border-radius: 12px;
  min-height: 56px;
  transition: background-color .2s ease;
}
.contact__item .ico { margin-top: 2px; width: 20px; height: 20px; }
.contact__text { display: flex; flex-direction: column; min-width: 0; }
.contact__label {
  font-weight: 600;
  font-size: .6875rem;        /* 11px */
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--subtle);
  line-height: 1.4;
}
.contact__value {
  font-weight: 500;
  font-size: .8125rem;        /* 13px */
  line-height: 1.4;
  color: var(--text);
}
@media (hover: hover) {
  .contact__item:hover { background: var(--cream); }
  .contact__item:hover .contact__value { color: var(--dark); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
}

/* ---------- Offices ---------- */
.offices {
  margin: 22px 20px 0;
  padding: 16px 18px 20px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.offices__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: .8125rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dark);
}
.offices__title .ico { width: 18px; height: 18px; }
.offices__title::before,
.offices__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--accent-line);
}

.office {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 14px;
  padding: 6px 8px 2px;
  border-radius: 14px;
}
.office__icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--accent-line);
}
.office__icon .ico { width: 24px; height: 24px; }
.office__city {
  margin-top: 10px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--dark);
}
.office__address {
  margin-top: 2px;
  font-size: .8125rem;
  line-height: 1.55;
  color: var(--muted);
}
.office__map {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .02em;
  color: var(--dark);
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 1px;
}
.office__map .ico { stroke: var(--accent); }
@media (hover: hover) {
  .office:hover .office__map { color: var(--accent); }
}

/* ---------- Save contact ---------- */
.save { padding: 20px 20px 26px; }
.btn-save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--dark);
  color: var(--white);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .01em;
  box-shadow: 0 10px 24px -12px rgba(35, 30, 33, .55);
  transition: transform .18s ease, background-color .2s ease, box-shadow .2s ease;
}
.btn-save .ico { stroke: var(--accent); width: 20px; height: 20px; stroke-width: 2; }
.btn-save:active { transform: scale(.985); }
@media (hover: hover) {
  .btn-save:hover { background: #352D31; box-shadow: 0 0 0 3px var(--accent-soft), 0 12px 26px -12px rgba(236, 102, 36, .55); }
}

/* ---------- Bottom actions ---------- */
.actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  padding: 10px 6px 8px;
}
.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 2px;
  border-radius: 12px;
  font-weight: 500;
  font-size: .75rem;          /* 12px */
  color: var(--text);
  transition: background-color .2s ease;
}
.action .ico { width: 24px; height: 24px; transition: transform .2s ease; }
.action:active .ico { transform: scale(.92); }
@media (hover: hover) {
  .action:hover { background: var(--cream); }
  .action:hover .ico { transform: translateY(-2px); }
}

/* ---------- Footer ---------- */
.foot {
  padding: 13px 16px 15px;
  background: var(--cream);
  border-top: 1px solid var(--line);
  text-align: center;
}
.foot p {
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--subtle);
}

/* ---------- Entrance animation ---------- */
.reveal { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.identity.reveal { animation-delay: .05s; }
.contact.reveal  { animation-delay: .12s; }
.offices.reveal  { animation-delay: .19s; }
.save.reveal     { animation-delay: .26s; }
.avatar { animation: pop .7s cubic-bezier(.2, .8, .2, 1) both; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop  { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Very small screens ---------- */
@media (max-width: 380px) {
  .foot p { letter-spacing: .08em; font-size: .65rem; }
  .contact { margin-left: 16px; margin-right: 16px; }
}
@media (max-width: 350px) {
  .contact__grid { grid-template-columns: 1fr; }
  .contact__grid::before { display: none; }
  .contact__grid li:nth-child(n) { padding: 0; }
  .identity__name { font-size: 1.35rem; }
  .action { font-size: .6875rem; }
}
