/*
 * Anbu Guardian — Shared wireframe primitives
 * Phone frame, gallery layout, reusable components.
 * Depends on _tokens.css
 */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: #e8e5df;
  color: var(--text-primary);
  min-height: 100vh;
  padding: 48px 24px;
}

/* ---------- Gallery layout ---------- */
.gallery {
  max-width: 1400px;
  margin: 0 auto;
}

.gallery__header {
  margin-bottom: 48px;
  text-align: center;
}

.gallery__title {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.gallery__subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 620px;
  margin: 0 auto;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(390px, 1fr));
  gap: 48px 32px;
  justify-items: center;
}

.gallery__caption {
  display: block;
  margin-top: 14px;
  text-align: center;
}

.gallery__caption-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.gallery__caption-desc {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- Phone frame (iPhone 14 — 390x844) ---------- */
.phone {
  width: 390px;
  height: 844px;
  border-radius: 52px;
  background: #1a1715;
  padding: 12px;
  box-shadow:
    0 30px 60px -20px rgba(61, 46, 36, 0.35),
    0 10px 30px -10px rgba(61, 46, 36, 0.2),
    0 0 0 1px rgba(61, 46, 36, 0.1);
  position: relative;
  flex-shrink: 0;
}

.phone__screen {
  width: 100%;
  height: 100%;
  border-radius: 42px;
  background: var(--bg-primary);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Notch / dynamic island */
.phone__notch {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 116px;
  height: 34px;
  background: #000;
  border-radius: 20px;
  z-index: 50;
  pointer-events: none;
}

/* Status bar with time + battery icons */
.status-bar {
  height: 54px;
  padding: 18px 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
  font-family: var(--font-display);
  position: relative;
  z-index: 10;
}

.status-bar__time {
  width: 70px;
}

.status-bar__right {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 70px;
  justify-content: flex-end;
}

.status-bar__right svg {
  display: block;
}

/* Safe area for home indicator */
.phone__home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: var(--text-primary);
  opacity: 0.4;
  border-radius: 3px;
  z-index: 50;
}

/* ---------- Fullscreen variant (video takes over) ---------- */
.phone--fullscreen .phone__screen {
  background: #000;
}
.phone--fullscreen .status-bar {
  color: #fff;
}

/* ---------- Screen chrome (top header) ---------- */
.screen-header {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  flex-shrink: 0;
}

.screen-header__back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.screen-header__title {
  flex: 1;
  text-align: center;
  font-size: var(--type-subheader-size);
  line-height: var(--type-subheader-line);
  font-weight: var(--type-subheader-weight);
  letter-spacing: var(--type-subheader-tracking);
  color: var(--text-primary);
}

.screen-header__right {
  width: 36px;
}

/* ---------- Screen body (scroll region) ---------- */
.screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--screen-padding) 120px;
}

.screen-body--tight {
  padding-bottom: var(--sp-xl);
}

/* ---------- Section header (Overline style) ---------- */
.section-header {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: var(--sp-xl) 0 var(--sp-sm) 4px;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card__inner {
  padding: var(--sp-lg);
}

/* ---------- List row (used in settings, detail cards) ---------- */
.row {
  display: flex;
  align-items: center;
  padding: 14px var(--sp-lg);
  gap: var(--sp-md);
}

.row__icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--sp-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.row__content {
  flex: 1;
  min-width: 0;
}

.row__label {
  font-size: var(--type-button-size);
  line-height: var(--type-button-line);
  font-weight: 500;
  color: var(--text-primary);
}

.row__value {
  margin-top: 2px;
  font-size: var(--type-label-size);
  line-height: var(--type-label-line);
  font-weight: 400;
  color: var(--text-secondary);
}

.row__divider {
  height: 1px;
  margin: 0 var(--sp-lg);
  background: var(--divider-light);
}

/* ---------- Icon circle (hero, empty state) ---------- */
.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.icon-circle--sm {
  width: 32px;
  height: 32px;
}
.icon-circle--md {
  width: 48px;
  height: 48px;
}
.icon-circle--lg {
  width: 56px;
  height: 56px;
}
.icon-circle--xl {
  width: 64px;
  height: 64px;
}

/* Tonal variations (bg = 0.1 opacity of fg color) */
.icon-circle--primary {
  background: var(--primary-bg);
  color: var(--primary-text);
}
.icon-circle--danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}
.icon-circle--success {
  background: var(--success-bg);
  color: var(--success-text);
}
.icon-circle--warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}
.icon-circle--info {
  background: var(--info-bg);
  color: var(--info-text);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: 14px var(--sp-lg);
  border-radius: var(--r-lg);
  border: none;
  font-family: var(--font-body);
  font-size: var(--type-button-size);
  line-height: var(--type-button-line);
  font-weight: var(--type-button-weight);
  cursor: pointer;
  transition: transform var(--dur-normal) var(--ease-standard);
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  box-shadow: var(--shadow-sm);
}

.btn--tonal {
  background: var(--button-tonal-bg);
  color: var(--button-tonal-text);
}

.btn--danger {
  background: var(--button-danger-bg);
  color: var(--button-danger-text);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn--full {
  width: 100%;
}

/* ---------- Severity badge (pill) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px var(--sp-md);
  border-radius: var(--r-full);
  font-size: var(--type-caption-size);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge--urgent {
  background: var(--c-danger-700);
  color: var(--c-surface);
}
.badge--warning {
  background: var(--c-warning-700);
  color: var(--c-surface);
}
.badge--info {
  background: var(--c-success-700);
  color: var(--c-surface);
}

/* ---------- Utility ---------- */
.sbs-row {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}

.label-above-phone {
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.label-above-phone strong {
  display: block;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}

.top-nav {
  max-width: 1400px;
  margin: 0 auto 32px;
  padding: 16px 20px;
  background: var(--surface-card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.top-nav__home {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.top-nav__links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.top-nav__link {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--r-md);
  transition: background var(--dur-normal) var(--ease-standard);
}

.top-nav__link:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.top-nav__link--active {
  background: var(--primary-bg);
  color: var(--primary-text);
}
