/* California portrait profile: warm editorial styling, tuned mobile-first. */

:root {
  color-scheme: light;
  --ivory: #fbf7ef;
  --paper: #fffdf8;
  --sand: #ead8bd;
  --sand-pale: #f3e9da;
  --olive: #697258;
  --olive-deep: #46503c;
  --espresso: #2d251f;
  --muted: #6d6257;
  --line: rgba(70, 80, 60, .2);
  --line-strong: rgba(70, 80, 60, .38);
  --accent: #ac6d4c;
  --accent-deep: #7d4933;
  --focus: #234e46;
  --card-width: 500px;
  --content-gutter: clamp(1rem, 5vw, 1.75rem);
  --radius-card: 1.4rem;
  --radius-control: .85rem;
  --easing: cubic-bezier(.2, .7, .2, 1);
}

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

html {
  min-width: 320px;
  background: var(--ivory);
  text-size-adjust: 100%;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--espresso);
  background: var(--ivory);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(180deg, rgba(251, 247, 239, .3), rgba(251, 247, 239, .78) 72%, var(--ivory)),
    radial-gradient(circle at 8% 12%, rgba(234, 216, 189, .52), transparent 36%),
    radial-gradient(circle at 92% 90%, rgba(105, 114, 88, .18), transparent 35%);
}

body.modal-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.page {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 100svh;
  padding: max(1rem, env(safe-area-inset-top)) var(--content-gutter) max(1.25rem, env(safe-area-inset-bottom));
}

#pageBackdrop.page-backdrop {
  position: fixed;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  max-width: none;
  object-fit: cover;
  object-position: center;
  filter: saturate(.7) blur(10px);
  opacity: .16;
  transform: scale(1.04);
}

.profile-shell {
  width: min(100%, var(--card-width));
  margin: 0 auto;
}

.profile-card {
  position: relative;
  padding: clamp(1.4rem, 5vw, 2rem) clamp(1rem, 4vw, 1.75rem) 1.2rem;
  border: 1px solid rgba(70, 80, 60, .13);
  border-radius: var(--radius-card);
  background: rgba(255, 253, 248, .91);
  box-shadow: 0 1.5rem 4rem rgba(73, 56, 39, .1), 0 .2rem .7rem rgba(73, 56, 39, .05);
}

.profile-header {
  display: grid;
  justify-items: center;
  text-align: center;
}

#profilePicture {
  position: relative;
  z-index: 0;
  display: block;
  width: min(58vw, 12rem);
  aspect-ratio: 1;
  margin: .1rem auto 1.15rem;
}

#profilePicture::before,
#profilePicture::after {
  position: absolute;
  z-index: -1;
  content: "";
  border: 1px solid var(--olive);
  border-radius: .8rem;
  pointer-events: none;
}

#profilePicture::before {
  inset: -.55rem .7rem .7rem -.55rem;
  opacity: .6;
  transform: rotate(-5deg);
}

#profilePicture::after {
  inset: .7rem -.55rem -.55rem .7rem;
  border-color: var(--accent);
  opacity: .55;
  transform: rotate(4deg);
}

#profileAvatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: .35rem solid var(--paper);
  border-radius: .65rem 2.9rem .65rem 2.9rem;
  background: var(--sand-pale);
  box-shadow: 0 .45rem 1rem rgba(72, 50, 33, .14);
  object-fit: cover;
  object-position: center 28%;
}

#profileName {
  max-width: 100%;
  margin: .15rem 0 .12rem;
  color: var(--espresso);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 8vw, 2.65rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

#profileHandle {
  margin: 0;
  color: var(--olive-deep);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
}

#profileBio {
  max-width: 34rem;
  margin: .8rem auto 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.55;
  text-wrap: balance;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem;
  margin: 1.15rem auto 1.3rem;
}

.social-links a,
.social-links button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: .48rem .72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--olive-deep);
  background: rgba(243, 233, 218, .65);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s var(--easing), border-color .2s var(--easing), color .2s var(--easing), transform .2s var(--easing);
}

.social-links a:hover,
.social-links button:hover {
  border-color: var(--olive);
  color: var(--paper);
  background: var(--olive);
}

.links-section {
  margin-top: .2rem;
}

.link-list {
  display: grid;
  gap: .72rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .82rem;
  min-height: 4.25rem;
  padding: .62rem .7rem .62rem .82rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--espresso);
  background: rgba(255, 253, 248, .78);
  text-align: left;
  text-decoration: none;
  box-shadow: 0 .18rem .55rem rgba(73, 56, 39, .035);
  transition: border-color .22s var(--easing), background-color .22s var(--easing), transform .22s var(--easing), box-shadow .22s var(--easing);
}

.link-card:hover {
  border-color: var(--olive);
  background: var(--paper);
  box-shadow: 0 .5rem 1.1rem rgba(73, 56, 39, .1);
  transform: translateY(-2px);
}

.link-card.is-featured {
  border-color: rgba(172, 109, 76, .55);
  background: linear-gradient(110deg, rgba(243, 233, 218, .9), rgba(255, 253, 248, .9));
}

.link-icon {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: .7rem;
  background: var(--sand-pale);
  object-fit: cover;
}

.link-card:not(.has-icon) {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-left: 1.05rem;
}

.link-content {
  min-width: 0;
}

.link-title,
.link-subtitle {
  display: block;
  overflow-wrap: anywhere;
}

.link-title {
  color: var(--espresso);
  font-size: .98rem;
  font-weight: 750;
  line-height: 1.25;
}

.link-subtitle {
  margin-top: .18rem;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}

.link-badge {
  align-self: start;
  padding: .2rem .4rem;
  border-radius: 999px;
  color: var(--accent-deep);
  background: rgba(234, 216, 189, .65);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.link-arrow {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  color: var(--olive-deep);
  font-size: 1.15rem;
  line-height: 1;
}

#configStatus {
  min-height: 1.3em;
  margin: .8rem 0 0;
  color: var(--muted);
  font-size: .75rem;
  text-align: center;
}

.profile-footer {
  padding-top: 1.25rem;
  color: var(--muted);
  font-size: .72rem;
  text-align: center;
}

#footerText {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.promo-dialog {
  width: min(calc(100% - 1.25rem), 31rem);
  max-height: min(90svh, 42rem);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 1.35rem;
  color: var(--espresso);
  background: transparent;
  box-shadow: none;
}

.promo-dialog::backdrop {
  background: rgba(45, 37, 31, .48);
  backdrop-filter: blur(2px);
}

.promo-panel {
  position: relative;
  max-height: min(90svh, 42rem);
  padding: clamp(1.6rem, 6vw, 2.45rem) clamp(1.25rem, 6vw, 2.5rem) max(1.4rem, env(safe-area-inset-bottom));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: inherit;
  background: var(--paper);
  box-shadow: 0 1.3rem 3rem rgba(45, 37, 31, .2);
}

.promo-close {
  position: absolute;
  top: .7rem;
  right: .7rem;
  display: grid;
  width: 3rem;
  height: 3rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--olive-deep);
  background: transparent;
  cursor: pointer;
}

.promo-eyebrow {
  margin: 0 2.4rem .6rem 0;
  color: var(--accent-deep);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.promo-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 7vw, 2.35rem);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.promo-panel p {
  margin: .85rem 0 1.25rem;
  color: var(--muted);
}

.promo-cta {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.1rem;
  border-radius: 999px;
  color: var(--paper);
  background: var(--olive-deep);
  font-weight: 750;
  text-decoration: none;
  transition: background-color .2s var(--easing), transform .2s var(--easing);
}

.promo-cta:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

:is(a, button, [role="button"]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

:is(a, button):disabled,
:is(a, button)[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .5;
  pointer-events: none;
}

@media (min-width: 520px) {
  .page {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .profile-card {
    padding-inline: 2rem;
  }
}

@media (min-width: 768px) {
  .page {
    align-items: center;
  }

  .profile-card {
    padding-top: 2.25rem;
    border-radius: 1.75rem;
  }

  .profile-footer {
    padding-bottom: .3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .profile-card,
  .link-card,
  .promo-panel,
  .social-links a,
  .social-links button {
    border: 1px solid CanvasText;
  }

  .link-card:hover,
  .social-links a:hover,
  .social-links button:hover,
  .promo-cta {
    color: HighlightText;
    background: Highlight;
  }
}
