/* Alpine shell — DA_SUMMIT.md and the October 7–8 Alpine/Pico references.
   Page decoration uses the source landscape; controls remain real HTML. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./media/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("./media/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --page: #f4f7fa;
  --cream: var(--page);
  --ink: #14263a;
  --muted: #596b7d;
  --blue: #2463d6;
  --gold: #856b38;
  --shell-width: 1240px;
  --shell-gutter: 32px;
  --bottom-nav-space: 0px;
  font-family: "Plus Jakarta Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page);
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(ellipse 820px 520px at 88% 0, #75a7ff22, transparent 72%),
    radial-gradient(ellipse 540px 380px at 4% 440px, #75a7ff0e, transparent 72%),
    var(--page);
}
body[data-view="session"], body[data-view="exercises"] {
  background: radial-gradient(ellipse 600px 340px at 90% 0, #75a7ff12, transparent 72%), var(--page);
}

.alpine-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 440px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  pointer-events: none;
  user-select: none;
}
.alpine-landscape { display: block; height: 100%; }
.alpine-landscape img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right top;
}
.alpine-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f4f7fafc 0%, #f4f7faf5 24%, #f4f7fa9c 45%, #f4f7fa00 74%);
}
body:not([data-view="today"]) .alpine-backdrop { display: none; }

.app-header {
  position: relative;
  z-index: 4;
  max-width: none;
  padding: 0;
  background: #ffffff73;
  border-bottom: 1px solid #ffffff91;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.app-header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: calc(var(--shell-width) + 2 * var(--shell-gutter));
  min-height: 72px;
  padding: 8px var(--shell-gutter);
  margin-inline: auto;
}
.app-header .brand {
  gap: 10px;
  min-height: 44px;
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.8px;
}
.app-header .brand-symbol { display: block; width: 40px; height: auto; }

#nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  gap: 6px;
  max-width: none;
  margin: 0;
  border: 0;
  overflow: visible;
}
#nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}
#nav .nav-label { display: block; font-size: inherit; line-height: inherit; }
#nav a:hover { background: #ffffff94; }
#nav a[aria-current="page"] { color: var(--blue); background: transparent; font-weight: 700; }
#nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 25%;
  right: 25%;
  height: 3px;
  border-radius: 4px;
  background: var(--blue);
}
#nav .nav-icon { display: none; }

.header-account { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 14px; }
.profile-account { position: relative; width: 74px; height: 46px; flex: 0 0 auto; }
.connection-indicator { position: absolute; right: 25px; bottom: 6px; display: block; width: 12px; height: 12px; border: 2px solid #f8fbff; border-radius: 50%; background: #c18427; box-shadow: 0 1px 3px #14263a24; }
.connection-indicator[hidden] { display: none; }
.connection-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.connection-indicator[data-state="syncing"] { background: var(--blue); }
.connection-indicator[data-state="syncing"]::after { content: ""; position: absolute; inset: -4px; border: 1px solid var(--blue); border-radius: 50%; animation: connection-pulse 1.8s ease-out infinite; }
@keyframes connection-pulse { from { opacity: .55; transform: scale(.65); } to { opacity: 0; transform: scale(1.5); } }
.profile-link {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 74px;
  min-height: 46px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 28px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-decoration: none;
  transition: width 320ms cubic-bezier(.22,1,.36,1), background 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.profile-link:hover, .profile-link[aria-current="page"] { color: var(--blue); background: #eaf1ff; }
.profile-name { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; opacity: 0; transform: translateX(8px); transition: opacity 200ms ease, transform 320ms cubic-bezier(.22,1,.36,1); }
.profile-account.is-open .profile-link { color: var(--ink); border-color: #dce7f4; background: #f8fbff; box-shadow: 0 5px 20px #14263a0d; }
.profile-chevron { transition: transform 220ms ease; }
.profile-account.is-open .profile-chevron { transform: rotate(180deg); }
.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 248px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  border: 1px solid #dce7f4;
  border-radius: 20px;
  background: #fdfefe;
  box-shadow: 0 16px 48px #14263a1c, 0 3px 8px #14263a08;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  transform-origin: top right;
  transition: opacity 180ms ease, transform 240ms cubic-bezier(.22,1,.36,1), visibility 180ms;
}
.profile-dropdown::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; }
.profile-account.is-open .profile-dropdown { visibility: visible; opacity: 1; transform: translateY(0) scale(1); }
.profile-menu-heading { padding: 8px 12px 10px; margin: 0 0 4px; border-bottom: 1px solid #e7eef6; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.profile-dropdown a, .profile-dropdown button { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; background: transparent; color: var(--ink); text-decoration: none; font: inherit; font-size: 13px; font-weight: 500; }
.profile-dropdown a:hover, .profile-dropdown button:hover { background: #eaf1ff; color: var(--blue); }
.profile-dropdown .profile-logout { margin-top: 4px; color: #a83c3c; }
.profile-dropdown .profile-logout:hover { background: #fff1ef; color: #a83c3c; }
.profile-dropdown [hidden] { display: none; }
.profile-link:focus-visible, .profile-dropdown :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (min-width: 761px) {
  .header-account { min-width: 230px; }
  .profile-name { display: block; flex: 1 1 auto; }
  .profile-account.is-open .profile-link { width: 230px; padding-left: 18px; }
  .profile-account.is-open .profile-name { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .profile-link, .profile-name, .profile-chevron, .profile-dropdown { transition: none; }
  .connection-indicator[data-state="syncing"]::after { animation: none; opacity: .4; }
}
.profile-avatar, .profile-chevron, #nav .nav-icon {
  flex-shrink: 0;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}
.profile-avatar { display: block; width: 34px; height: 34px; mask-image: url("./media/icons/user-circle.svg"); }
.profile-avatar.has-photo {
  mask-image: none;
  background: transparent;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid #ffffff;
  box-shadow: 0 1px 5px #14263a16;
}
.profile-avatar img, .profile-photo-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-photo-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px 24px; align-items: start; }
.profile-photo-card > h2 { grid-column: 1 / -1; margin: 0; }
.profile-photo-preview { width: 96px; height: 96px; overflow: hidden; border-radius: 50%; background: #eaf1ff; }
.profile-photo-preview::before { content: ""; display: block; width: 100%; height: 100%; background: var(--muted); mask: url("./media/icons/user-circle.svg") center / 80px no-repeat; }
.profile-photo-preview.has-photo::before { display: none; }
.profile-photo-controls { min-width: 0; }
.profile-photo-controls input { max-width: 100%; font-size: 14px; }
.profile-photo-controls input::file-selector-button { margin-right: 12px; padding: 8px 12px; border: 0; border-radius: 8px; background: #eaf1ff; color: var(--blue); font: inherit; cursor: pointer; }
.profile-photo-controls [role="status"]:empty { display: none; }
@media (max-width: 500px) {
  .profile-photo-card { grid-template-columns: 1fr; gap: 16px; }
}
.profile-chevron { display: block; width: 14px; height: 14px; mask-image: url("./media/icons/caret-down.svg"); }
[data-icon="house"] .nav-icon { mask-image: url("./media/icons/house.svg"); }
[data-icon="barbell"] .nav-icon { mask-image: url("./media/icons/barbell.svg"); }
[data-icon="fork-knife"] .nav-icon { mask-image: url("./media/icons/fork-knife.svg"); }
[data-icon="chart-bar"] .nav-icon { mask-image: url("./media/icons/chart-bar.svg"); }
[data-icon="chat-circle"] .nav-icon { mask-image: url("./media/icons/chat-circle.svg"); }

main {
  position: relative;
  max-width: calc(var(--shell-width) + 2 * var(--shell-gutter));
  margin: 0 auto;
  padding: 32px var(--shell-gutter) calc(64px + var(--bottom-nav-space));
}
main:focus { outline: none; }
main > .hero {
  overflow: visible;
  min-height: 280px;
  padding: 28px 0 32px;
  margin-bottom: 24px;
  border-radius: 0;
  background: transparent;
}
.hero .copy { max-width: 470px; }
.hero .copy h1 { max-width: 470px; }
.hero p { max-width: 350px; }
.hero .copy > .eyebrow { color: var(--muted); }
.exercise-library-link { flex-shrink: 0; }
.skip { z-index: 10; }
#notice { bottom: calc(22px + var(--bottom-nav-space)); }

@media (min-width: 761px) and (max-width: 1040px) {
  :root { --shell-gutter: 24px; }
  .app-header-inner { gap: 16px; }
  #nav { gap: 0; }
  #nav a { padding-inline: 10px; font-size: 13px; }
  .header-account { gap: 8px; }
  .header-account { min-width: 200px; }
  .profile-account.is-open .profile-link { width: 200px; }
}

@media (max-width: 760px) {
  :root { --shell-gutter: 16px; --bottom-nav-space: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .app-header { background: #ffffff38; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .app-header-inner { min-height: 76px; gap: 12px; padding-block: 12px; justify-content: space-between; }
  .app-header .brand { font-size: 24px; }
  .app-header .brand-symbol { width: 42px; height: auto; }
  .header-account { gap: 8px; }
  .connection-indicator { right: 19px; }
  .profile-link { min-width: 44px; gap: 2px; }
  .profile-avatar { width: 32px; height: 32px; }
  .profile-chevron { width: 12px; height: 12px; }
  .alpine-backdrop { top: 40px; height: 330px; mask-image: linear-gradient(to bottom, #000 35%, transparent 95%); }
  .alpine-landscape img { object-position: right top; }
  .alpine-backdrop::after { background: linear-gradient(90deg, #f4f7fafc 0%, #f4f7fae6 30%, #f4f7fa9c 56%, #f4f7fa00 90%); }
  main { padding-top: 16px; }
  main > .hero { min-height: 245px; padding: 18px 0 24px; margin-bottom: 16px; }
  .hero .copy, .hero .copy h1 { max-width: 310px; }
  .hero .copy h1 { font-size: 30px; line-height: 1.2; }
  .hero p { max-width: 260px; }
  .hero .copy > .eyebrow { font-size: 11px; letter-spacing: .9px; }
  .section-head:has(.exercise-library-link) { flex-wrap: wrap; gap: 12px; }

  #nav {
    position: fixed;
    z-index: 6;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    min-height: 76px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    border: 1px solid #ffffff;
    border-bottom: 0;
    border-radius: 30px 30px 0 0;
    background: #f8fbfff0;
    box-shadow: 0 -4px 24px #183c6210;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  #nav a {
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    min-height: 58px;
    padding: 4px 0;
    border-radius: 14px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  #nav .nav-icon { display: block; width: 24px; height: 24px; }
  #nav a[aria-current="page"] { background: #eaf1ff; }
  #nav a[aria-current="page"]::after { display: none; }
  #nav a:hover { background: #eaf1ff; }
}

@media (prefers-reduced-transparency: reduce) {
  .app-header, #nav { background: var(--page); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (forced-colors: active) {
  .alpine-backdrop { display: none; }
  #nav a[aria-current="page"], .profile-link[aria-current="page"] { outline: 2px solid Highlight; }
  #nav .nav-icon, .profile-avatar, .profile-chevron { background-color: ButtonText; }
  .connection-indicator { background: ButtonText; border-color: Canvas; }
  .connection-indicator[data-state="syncing"] { background: Highlight; }
  .connection-indicator[data-state="syncing"]::after { border-color: Highlight; }
}
