/* Customer website. The shared product palette is carried through the web layout. */
:root {
  --workspace-max: 94rem;
  --sidebar-width: 14.5rem;
  --domain-amber: #a65500;
}
.skip-link {
  position: fixed; left: 1rem; top: .8rem; z-index: 10;
  padding: .65rem 1rem; background: var(--panel);
  transform: translateY(-160%); border-radius: .5rem;
}
.skip-link:focus { transform: none; }
body.entry, body:not(.entry) { background: var(--bg); }
.topbar {
  position: sticky; top: 0; z-index: 5;
  min-height: 4.4rem; padding: .7rem clamp(1rem,3vw,2.25rem);
  background: var(--panel);
}
.brand img { width: 2.45rem; height: 2.45rem; }
.workspace {
  display: grid; grid-template-columns: var(--sidebar-width) minmax(0,1fr);
  max-width: var(--workspace-max); margin: auto;
  min-height: calc(100dvh - 4.4rem);
}
.workspace .rail {
  position: sticky; top: 4.4rem; inset-inline: auto; bottom: auto;
  display: block; min-height: calc(100dvh - 4.4rem); padding: 1.4rem .8rem;
  border: 0; border-inline-end: 1px solid var(--line); box-shadow: none;
  background: transparent;
}
.rail nav { display: grid; width: 100%; grid-template-columns: 1fr; gap: .28rem; }
.workspace .rail .rail-link {
  display: flex; justify-content: start; height: auto; min-height: 2.8rem;
  gap: .65rem; padding: .55rem .7rem; border-radius: .65rem;
}
.workspace .rail nav a:nth-child(n+5) { display: flex; }
.workspace .rail nav a:nth-child(5) { margin-top: .6rem; }
.workspace .rail .rail-link span { font-size: .92rem; }
.workspace main { max-width: none; padding: clamp(1.3rem,4vw,3.4rem); }
.page-heading { display:flex; align-items:end; justify-content:space-between; gap:1rem; margin-bottom:1.4rem; }
.page-heading p { margin-top:.5rem; }
.workspace-shortcuts {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem;
  margin-bottom: 1.35rem;
}
.workspace-shortcuts>a {
  display:flex; align-items:center; gap:.8rem; padding:.9rem;
  color: var(--text); text-decoration:none;
}
.workspace-shortcuts>a:hover, .camera-card:hover { border-color:var(--accent); }
.workspace-shortcuts>a>svg:first-child { color:var(--accent); }
.workspace-shortcuts>a>svg:last-child { margin-inline-start:auto; }
.workspace-shortcuts strong, .workspace-shortcuts small { display:block; }
.camera-board { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,17.5rem),1fr)); gap: 1rem; }
.camera-board>.empty { grid-column:1/-1; }
.camera-open { display:block; color:var(--text); }
.camera-open:hover { text-decoration:none; }
.camera-card .media-fallback { padding:1rem; }
.camera-card .media-fallback span { transform:translateY(2.6rem); }
.camera-card .media-fallback>svg { display:none; }
.camera-card .tile-copy { border-bottom:1px solid var(--line); }
.card-footer { display:flex; gap:.9rem; padding:.75rem 1rem; font-size:.9rem; }
.active-feed { overflow:hidden; margin: 0 0 1rem; }
.active-feed .media { max-height: 68vh; }
.active-feed .media img { object-fit: contain; }
.detail-actions { display:flex; flex-wrap:wrap; gap:.65rem; }
.back-link { display:inline-block; margin-bottom:.8rem; font-weight:700; }
.event-filters { padding: 1rem; border:1px solid var(--line); border-radius:.9rem; background:var(--panel); }
.grid:not(.live-grid) { grid-template-columns:repeat(auto-fill,minmax(min(100%,15.5rem),1fr)); }
.web-landing {
  position:relative; isolation:isolate; display:grid; align-items:center;
  grid-template-columns:minmax(0,1.35fr) minmax(17rem,1fr);
  min-height: min(37rem, calc(100svh - 9rem)); gap:clamp(1.5rem,7vw,7rem);
  max-width:72rem; margin: 0 auto; padding:clamp(.75rem,4vw,3rem);
}
.landing-intro { display:grid; gap: .85rem; z-index:1; }
.landing-wordmark { display:block; width:min(100%,22rem); height:auto; margin-bottom:.35rem; }
.landing-intro h1 { max-width: 12ch; font-family:Georgia,serif; font-size:clamp(2.65rem,5.8vw,5rem); color:var(--text); }
.landing-intro p { max-width:39ch; font-size:clamp(1rem,1.65vw,1.2rem); }
.web-landing .auth { width:100%; margin:0; z-index:1; max-width:none; }
.web-landing .auth h2 { font-size:clamp(1.65rem,3vw,2.2rem); }
.hero-leaves {
  position:fixed; inset:4.4rem 0 0 auto;
  width:clamp(1rem, calc((100vw - 72rem) / 2 + 1.5rem), 9rem);
  overflow:hidden;
  pointer-events:none; z-index:0;
}
.hero-leaves i {
  position:absolute; display:none; top:0; left:0;
  width:var(--leaf-length,2rem); height:calc(var(--leaf-length,2rem) * .45);
  border-radius:80% 0 75% 0;
  background:linear-gradient(145deg,#e1bc74,var(--leaf-color,#8e642c));
  box-shadow:0 .08rem .17rem #5a441e44;
  transform-origin:25% 60%;
}
.hero-leaves i::after {
  content:""; position:absolute; top:52%; left:8%; width:85%; height:1px;
  background:#fff3cf85; transform:rotate(-11deg);
}
.hero-leaves[data-active] i { display:block; }
@media(prefers-reduced-motion: reduce) {
  .hero-leaves { display:none; }
}
@media(max-width:50rem) {
  .workspace { display:block; }
  .workspace .rail { position:static; min-height:0; padding:.45rem .75rem; border:0; border-bottom:1px solid var(--line); }
  .rail nav { display:flex; overflow-x:auto; }
  .workspace .rail .rail-link { min-height:2.5rem; width:auto; flex:none; }
  .workspace .rail nav a:nth-child(5) { margin-top:0; }
  .workspace main { padding:1rem; }
  .web-landing { grid-template-columns:1fr; max-width:32rem; min-height:0; }
  .landing-wordmark { width:min(82%,18rem); }
}
@media(max-width:30rem) {
  .page-heading { align-items:start; flex-direction:column; }
  .workspace-shortcuts { grid-template-columns:1fr; }
  .event-filters { grid-template-columns:1fr; }
}

/* Phone app palette and photography on the browser workspace. */
:root:not([data-portal-theme="light"]):not([data-portal-theme="slate"]),
:root[data-portal-theme="light"] {
  --bg: #fff3df;
  --panel: #fff8e9;
  --line: #d8c9ad;
  --text: #303809;
  --sub: #5b573c;
  --accent: #4d5c14;
  --success: #207b27;
  --portal-chrome: #fff3df;
  --portal-hover: #dfdda3;
  --portal-control: #fff8e9;
  --portal-field: #fff8e9;
  --portal-on-accent: #fffdf0;
  --portal-amber: #9d5200;
}
.topbar { background: var(--bg); }
.workspace .rail { background: var(--panel); }
.workspace .rail-link[aria-current="page"] {
  background: var(--portal-hover);
  color: var(--text);
}
.workspace .primary { color: var(--portal-on-accent); }
.workspace .heading a.primary[href="#add-camera"],
.workspace form[action$="/faces/name"] .primary {
  background: var(--portal-amber);
  color: var(--portal-on-amber);
}
body.entry:has(.web-landing) {
  background:
    linear-gradient(90deg, #fff3dffc 0%, #fff3dfef 34%, #fff3df74 67%, #fff3df30 100%),
    url("peace-hero-house.webp") center 62% / cover no-repeat,
    var(--bg);
}
.web-landing .auth { box-shadow: 0 1rem 3rem #34210b24; }
@media(max-width:50rem) {
  body.entry:has(.web-landing) {
    background:
      linear-gradient(180deg, #fff3dff5 4%, #fff3dfd9 40%, #fff3df68 100%),
      url("peace-hero-house.webp") center / cover no-repeat,
      var(--bg);
  }
}

.portal-not-found {
  min-height: calc(100dvh - 4.4rem);
  display: grid;
  place-items: center;
  padding: clamp(1rem, 5vw, 3rem);
  background: radial-gradient(ellipse at 50% 30%, var(--portal-glow), transparent 72%);
}
.portal-not-found .panel { width: min(100%, 34rem); }
.portal-not-found h1, .portal-not-found p { margin: 0; }
.portal-not-found p { color: var(--sub); }
.portal-error-code {
  font-size: clamp(3rem, 10vw, 5rem);
  line-height: 1;
  font-weight: 750;
  color: var(--accent);
}
.portal-page-loading:not([hidden]),
html[data-portal-boot] .portal-page-loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: var(--bg);
  pointer-events: none;
}
.portal-loading-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--text);
  font-weight: 650;
}
.portal-loading-ring {
  width: 1.4rem;
  height: 1.4rem;
  border: .2rem solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: portal-loading-spin .8s linear infinite;
}
@keyframes portal-loading-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  .portal-loading-ring { animation: none; }
}

html[data-portal-boot] .portal-page-loading {
  visibility: hidden;
  animation: portal-boot-visibility 6s linear;
}
@keyframes portal-boot-visibility {
  0%, 2.5%, 100% { visibility: hidden; }
  2.6%, 99.9% { visibility: visible; }
}

/* Keep tap feedback from flashing over themed controls during navigation. */
:where(a, button, input, textarea, select, summary, label, [role="button"]) {
  -webkit-tap-highlight-color: transparent;
}
:where(a, button, input, textarea, select, summary, [role="button"]):focus:not(:focus-visible) {
  outline: none;
}
