* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Google Sans', Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: #FFFFFF;
  color: #202124;
  min-height: 100vh;
}

/* ── Header Bar ── */
.header-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 8px 0 16px;
  background: #FFFFFF;
  border-bottom: 1px solid #E0E0E0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.header-hamburger {
  width: 48px;
  height: 48px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-hamburger:hover {
  background: #F1F3F4;
}

.header-icon {
  flex-shrink: 0;
}

.header-app-name {
  font-size: 22px;
  font-weight: 400;
  color: #5F6368;
  white-space: nowrap;
  padding-left: 4px;
}

.mobile-break {
  display: none;
}

.mobile-caveat {
  display: none;
}

/* ── Info Button ── */
.header-info-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-info-btn:hover {
  background: #F1F3F4;
}

.header-info-btn.pulse svg {
  animation: info-pulse 1.5s ease-in-out infinite;
}

@keyframes info-pulse {
  0%, 100% { fill: #5F6368; transform: scale(1); }
  50% { fill: #1A73E8; transform: scale(1.2); }
}

/* ── Search Bar ── */
.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 32px;
  min-width: 0;
}

.search-bar {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 720px;
  height: 48px;
  background: #F1F3F4;
  border-radius: 8px;
  padding: 0 16px;
  gap: 12px;
  transition: background 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.search-icon {
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  background: none;
  font-size: 16px;
  font-family: inherit;
  color: #202124;
  outline: none;
  min-width: 0;
}

.search-bar input::placeholder {
  color: #5F6368;
}

/* ── Header Right ── */
.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-left: 16px;
}

.header-icon-btn {
  width: 48px;
  height: 48px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon-btn:hover {
  background: #F1F3F4;
}

.header-icon-btn:disabled {
  opacity: 0.5;
  cursor: pointer;
}

.header-icon-btn:disabled:hover {
  background: none;
}

/* ── Tooltip ── */
.tooltip-btn {
  position: relative;
}

.tooltip-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  padding: 6px 10px;
  background: #616161;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 50;
}

.tooltip-btn:hover::after {
  opacity: 1;
}

/* ── Avatar & Dropdown ── */
.avatar-wrapper {
  position: relative;
  margin-left: 8px;
  margin-right: 12px;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: block;
}

.avatar-dropdown {
  display: none;
  position: absolute;
  top: 44px;
  right: 0;
  width: 320px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  padding: 24px 0 16px;
  text-align: center;
  z-index: 200;
}

.avatar-dropdown.open {
  display: block;
}

.avatar-dropdown-avatar {
  margin-bottom: 12px;
}

.avatar-dropdown-name {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
  line-height: 1.4;
}

.avatar-dropdown-email {
  font-size: 14px;
  color: #5F6368;
  margin-bottom: 16px;
}

.avatar-dropdown-link {
  display: inline-block;
  padding: 8px 22px;
  border: 1px solid #DADCE0;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  color: #1A73E8;
  text-decoration: none;
  transition: background 0.15s;
}

.avatar-dropdown-link:hover {
  background: #F6FAFE;
}

/* ── Section Header ── */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px 40px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 8px 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
}

.intro-wrapper {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.45s ease;
  background: #F8F9FA;
  border-bottom: 1px solid #E0E0E0;
  margin-top: -2px;
}

.intro-wrapper.open {
  max-height: 700px;
}

.intro-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 8px 32px;
  text-align: center;
}

.intro-text {
  font-size: 14px;
  line-height: 1.6;
  color: #5F6368;
}

.intro-headline {
  font-size: 18px;
  color: #202124;
}

.intro-text + .intro-text {
  margin-top: 8px;
}

.intro-frames {
  display: flex;
  gap: 24px;
  margin-top: 20px;
}

.intro-frame {
  flex: 1;
  text-align: center;
}

.intro-frame img {
  width: 100%;
  border-radius: 8px;
}

.intro-frame-text {
  font-size: 13px;
  line-height: 1.4;
  color: #5F6368;
  margin-top: 8px;
  text-wrap: pretty;
}

/* ── Card Grid ── */
.font-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px 16px;
}

.font-card {
  background: #FFFFFF;
  border: none;
  border-radius: 8px;
  overflow: visible;
  cursor: none;
  text-align: left;
  padding: 0;
  font-family: inherit;
  transition: none;
}

.font-card:hover .card-thumbnail {
  border-color: #FBBC04;
}

.card-thumbnail {
  aspect-ratio: 16 / 10;
  background: #F8F9FA;
  border: 1px solid #DADCE0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  transition: border-color 0.3s, border-width 0.3s, padding 0.3s;
}

.font-card.copied .card-thumbnail {
  border-color: #FBBC04;
  border-width: 6px;
  padding: 19px;
  transition: none;
}

.card-thumbnail .font-svg {
  height: 32px;
  width: auto;
  max-width: 100%;
}

.card-label {
  padding: 10px 4px 4px;
}

.card-font-name {
  font-size: 14px;
  font-weight: 500;
  color: #202124;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.card-meta-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  object-fit: contain;
}

.card-org {
  font-size: 12px;
  font-weight: 400;
  color: #5F6368;
  line-height: 1.3;
}

/* ── Side Nav ── */
.sidenav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.sidenav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: #FFFFFF;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.15);
}

.sidenav.open {
  transform: translateX(0);
}

.sidenav-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid #E0E0E0;
}

.sidenav-title {
  font-size: 18px;
  font-weight: 400;
  color: #5F6368;
}

.sidenav-section-label {
  font-size: 12px;
  font-weight: 500;
  color: #5F6368;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 24px 8px;
}

.sidenav-list {
  padding: 0 8px 16px;
}

.sidenav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: none;
  border-radius: 24px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: #202124;
  text-align: left;
  transition: background 0.15s;
}

.sidenav-brand:hover {
  background: #F1F3F4;
}

.sidenav-brand.active {
  background: #E8F0FE;
  color: #1A73E8;
  font-weight: 500;
}

.sidenav-brand img {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidenav-brand-all {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: none;
  border-radius: 24px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #202124;
  text-align: left;
  margin-bottom: 4px;
  transition: background 0.15s;
}

.sidenav-brand-all:hover {
  background: #F1F3F4;
}

.sidenav-brand-all.active {
  background: #E8F0FE;
  color: #1A73E8;
}

.sidenav-brand-all svg {
  flex-shrink: 0;
}

/* ── Fly SVG (steal animation) ── */
.fly-svg {
  position: fixed;
  pointer-events: none;
  z-index: 999;
  transform-origin: center center;
}

.swallow-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 32px;
  height: 32px;
  transform: scale(1.01);
  transform-origin: 18px 14px;
  will-change: transform;
}

.swallow-cursor img {
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

html.cursor-hidden,
html.cursor-hidden * {
  cursor: none;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: fit-content;
  transform: translateY(20px);
  background: #323232;
  color: #FFFFFF;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 1000;
  text-align: center;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive Grid ── */
@media (max-width: 1100px) {
  .font-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .font-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .main-content {
    padding: 12px 16px 32px;
  }
  .header-app-name {
    font-size: 14px;
    letter-spacing: -0.2px;
    line-height: 1.15;
    white-space: normal;
    padding-left: 2px;
  }
  .mobile-break {
    display: inline;
  }
  .avatar-wrapper {
    margin-left: 0;
    margin-right: 4px;
  }
  .header-right {
    padding-left: 4px;
  }
  .header-center {
    padding: 0 12px;
  }
}

@media (max-width: 480px) {
  .font-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .header-hamburger {
    display: none;
  }
  .header-icon,
  .header-app-name {
    cursor: pointer;
  }
  .header-center {
    padding: 0 8px;
  }
  #copy-all-trigger {
    display: none;
  }
  .intro-content {
    padding-left: 25px;
    padding-right: 25px;
  }
  .intro-text {
    text-wrap: pretty;
  }
  .intro-frames {
    flex-direction: column;
    gap: 16px;
  }
  .intro-frame img {
    max-width: 240px;
  }
  .mobile-caveat {
    display: inline;
    color: #80868B;
  }
  .intro-wrapper.open {
    max-height: 1200px;
  }
  .font-card {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .toast {
    max-width: calc(100vw - 32px);
  }
}
