@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  --bg:        #f5f4f0;
  --surface:   #ffffff;
  --border:    #e4e2db;
  --text:      #1a1916;
  --muted:     #8a8780;
  --accent:    #2563eb;
  --accent-h:  #1d4ed8;
  --accent-s:  rgba(37, 99, 235, 0.10);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  --radius:    14px;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'DM Sans', 'Segoe UI', sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Background decoration ───────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(37,99,235,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(37,99,235,0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ──────────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 0 20px 60px;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 680px;
  padding-top: clamp(60px, 12vh, 120px);
  padding-bottom: 48px;
}

/* Clock */
.clock {
  font-family: var(--font-serif);
  font-size: clamp(56px, 10vw, 92px);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.75s var(--ease-out-expo) 0.1s forwards;
}

.clock .colon {
  display: inline-block;
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.15; }
}

/* Date */
.date-line {
  font-size: 12px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 44px;
  opacity: 0;
  transform: translateY(18px);
  animation: fadeUp 0.75s var(--ease-out-expo) 0.22s forwards;
}

/* ── Search bar ──────────────────────────────────────────── */
.search-wrap {
  width: 100%;
  opacity: 0;
  transform: translateY(18px);
  animation: fadeUp 0.75s var(--ease-out-expo) 0.35s forwards;
}

.search-form {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 18px 58px 18px 26px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.25s ease,
    box-shadow   0.3s ease;
}

.search-input::placeholder { color: var(--muted); }

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-s), var(--shadow-md);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.2s, transform 0.25s var(--ease-out-expo), box-shadow 0.2s;
}

.search-btn:hover {
  background: var(--accent-h);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 14px rgba(37,99,235,0.4);
}

.search-btn:active { transform: translateY(-50%) scale(0.94); }

.search-btn svg { width: 17px; height: 17px; }

/* ── Engine selector ─────────────────────────────────────── */
.engine-tabs {
  display: flex;
  gap: 4px;
  margin-top: 14px;
  justify-content: center;
}

.engine-tab {
  padding: 5px 15px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.02em;
}

.engine-tab:hover {
  color: var(--accent);
  border-color: rgba(37,99,235,0.2);
  background: var(--accent-s);
}

.engine-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-s);
  font-weight: 500;
}

/* ── Bookmarks section ───────────────────────────────────── */
.bookmarks-section {
  width: 100%;
  max-width: 860px;
}

.category-block {
  margin-bottom: 36px;
  opacity: 0;
  transform: translateY(28px);
}

.category-block.visible {
  animation: fadeUp 0.65s var(--ease-out-expo) forwards;
}

.category-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.bookmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.bookmark-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition:
    transform    0.28s var(--ease-out-expo),
    box-shadow   0.28s ease,
    border-color 0.22s ease;
  position: relative;
  overflow: hidden;
}

.bookmark-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-s) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  border-radius: var(--radius);
}

.bookmark-card:hover {
  transform: translateY(-5px) scale(1.025);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37,99,235,0.25);
}

.bookmark-card:hover::before { opacity: 1; }

.bookmark-card:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: var(--shadow-sm);
}


.bookmark-title {
  font-size: 13px;
  font-weight: 400;
  text-align: center;
  line-height: 1.3;
  color: var(--text);
  transition: color 0.2s;
}

.bookmark-card:hover .bookmark-title { color: var(--accent); }

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero { padding-top: 48px; padding-bottom: 36px; }

  .search-input { padding: 15px 52px 15px 18px; font-size: 15px; }

  .bookmark-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }

  .bookmark-card { padding: 14px 8px; }

  .bookmark-title { font-size: 12px; }

  .engine-tabs { flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .bookmark-grid { grid-template-columns: repeat(3, 1fr); }
}
