/* ABOUTME: Main stylesheet for "Open in Safari" page */
/* Mobile-first, responsive, desktop-centered layout */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors */
  --background: #ffffff;
  --foreground: #171717;
  --muted-foreground: #71717a;
  --card-background: #f4f4f5;
  --card-border: #e4e4e7;
  --accent: #1677ff;

  /* Spacing */
  --gutter: 20px;
  --card-pad: 18px;
  --gap: 14px;

  /* Typography */
  --font-size-xs: 0.8125rem; /* 13px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-base: 1rem; /* 16px */
  --font-size-lg: 1.5rem; /* 24px */
  --font-size-xl: 1.75rem; /* 28px */
  --font-size-2xl: 2rem; /* 32px */
  --line-height-title: 1.3;
  --line-height-body: 1.6;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Guarantee no horizontal scroll on any screen (incl. iPhone) */
  overflow-x: hidden;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: var(--line-height-body);
  min-height: 100vh;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Centered stage (mobile-first shell, desktop centered) */
#app {
  display: flex;
  min-height: 100vh;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.page {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 40px var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Header */
.page-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.compass-icon {
  width: 96px;
  height: 96px;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(10, 108, 255, 0.25));
}

.title {
  margin-top: 6px;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--line-height-title);
  color: var(--foreground);
}

.subtitle {
  font-size: var(--font-size-base);
  color: var(--muted-foreground);
  max-width: 360px;
  text-align: center;
  line-height: var(--line-height-body);
}

/* Browser detection notice */
.browser-notice {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid transparent;
}

.browser-notice-warn {
  background: #eef4ff;
  border-color: #d6e4ff;
}

.browser-notice-ok {
  background: #ecfdf3;
  border-color: #cdeed9;
}

.browser-notice-text {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
}

.browser-notice-warn .browser-notice-text {
  color: #1d4ed8;
}

.browser-notice-ok .browser-notice-text {
  color: #166534;
}

/* Card list */
.card-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.card {
  display: flex;
  align-items: flex-start;
  gap: var(--card-pad);
  background: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: var(--card-pad);
  /* Prevent card from shrinking below content on small screens */
  min-width: 0;
}

.card-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-top: 1px;
  border-radius: 50%;
  background: #171717;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Allow text to wrap and truncate within available width */
  min-width: 0;
  flex: 1;
  word-break: break-word;
  overflow-wrap: break-word;
}

.card-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: var(--line-height-title);
  color: var(--foreground);
}

.card-text {
  font-size: var(--font-size-sm);
  color: var(--muted-foreground);
  line-height: var(--line-height-body);
}

/* Tip area */
.tip {
  background: #fff8e1;
  border: 1px solid #ffe9a8;
  border-radius: 16px;
  padding: var(--card-pad);
}

.tip-text {
  font-size: var(--font-size-sm);
  color: #6b4f1d;
  line-height: var(--line-height-body);
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Copy link action */
.copy-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.copy-btn {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  background: #171717;
  color: #ffffff;
  font-family: inherit;
  font-size: var(--font-size-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.copy-btn:active {
  opacity: 0.85;
  transform: scale(0.99);
}

.copy-btn-icon {
  flex-shrink: 0;
}

.copy-status {
  margin: 0;
  font-size: var(--font-size-sm);
  text-align: center;
  line-height: var(--line-height-body);
  word-break: break-word;
  overflow-wrap: break-word;
}

.copy-status-success {
  color: #166534;
}

.copy-status-warn {
  color: #b45309;
}

.copy-fallback {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 16px;
}

.copy-fallback-label {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--muted-foreground);
  line-height: var(--line-height-body);
  word-break: break-word;
  overflow-wrap: break-word;
}

.copy-fallback-input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--foreground);
  font-family: inherit;
  font-size: var(--font-size-sm);
}

/* Footer */
.footer {
  text-align: center;
}

.footer-text {
  font-size: var(--font-size-xs);
  color: var(--muted-foreground);
  line-height: var(--line-height-body);
  max-width: 360px;
  margin: 0 auto;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Desktop enhancement: larger spacing for centered view */
@media (min-width: 640px) {
  .page {
    padding: 56px var(--gutter);
  }
}
