/* ============================================================
   slashAI.page — stylesheet
   Palette: off-white ground, near-black text, electric indigo accent
   Type: Space Mono (structural) + Inter (human text)
   ============================================================ */

:root {
  --bg:        #F5F5F0;
  --surface:   #EEEEE8;
  --border:    #DDDDD6;
  --text:      #0D0D0D;
  --muted:     #767670;
  --accent:    #4A4AF4;
  --accent-dk: #3535D4;
  --badge-p:   #E8F4E8;
  --badge-p-t: #1A6B1A;
  --badge-c:   #E8EEF8;
  --badge-c-t: #1A3A8B;
  --mono:      'Space Mono', monospace;
  --sans:      'Inter', sans-serif;
  --radius:    6px;
  --panel-w:   460px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TYPOGRAPHY ── */
h1 { font-family: var(--mono); font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-family: var(--mono); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-family: var(--sans); font-size: 1.1rem; font-weight: 600; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface); padding: 0.1em 0.35em; border-radius: 3px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LAYOUT ── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.logo:hover { color: var(--accent); text-decoration: none; }

nav { display: flex; gap: clamp(0.75rem, 2vw, 1.75rem); }

.nav-link {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0;
  transition: color 0.15s;
}
.nav-link:hover, .nav-link.active { color: var(--text); text-decoration: none; }
.nav-random { color: var(--accent); }
.nav-random:hover { color: var(--accent-dk); }

#app { flex: 1; }

.view { display: block; }
.view.hidden { display: none; }

/* ── HOME HERO ── */
.home-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--border);
}

.hero-slash {
  position: absolute;
  right: -0.05em;
  top: -0.15em;
  font-family: var(--mono);
  font-size: clamp(14rem, 30vw, 26rem);
  font-weight: 700;
  color: var(--surface);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-sub {
  margin-top: 1rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  max-width: 520px;
}

.hero-meta {
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
  border: none;
}
.btn-primary:hover { background: var(--accent-dk); text-decoration: none; color: #fff; }

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--text); text-decoration: none; color: var(--text); }

/* ── HOME SECTIONS ── */
.home-section {
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ── FEATURED GRID ── */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.featured-placeholder {
  height: 140px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.featured-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  text-decoration: none;
  display: block;
}
.featured-card:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }

.featured-card-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.featured-card-url {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.featured-card-meta {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ── HOME SPLIT ── */
.home-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 640px) { .home-split { grid-template-columns: 1fr; } }

/* ── TAG CLOUD ── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.tag:hover, .tag.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-count { color: var(--muted); font-size: 0.68rem; margin-left: 0.25rem; }
.tag:hover .tag-count, .tag.active .tag-count { color: rgba(255,255,255,0.7); }

/* ── ABOUT BLOCK ── */
.about-block p {
  max-width: 600px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
.about-block a { color: var(--accent); }

/* ── LIST PAGES ── */
.list-header {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 3rem) 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: clamp(1.25rem, 3vw, 2rem);
}

.list-count {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 0.5rem;
}

.list-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.list-controls input[type="search"],
.list-controls select {
  font-family: var(--sans);
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  min-width: 160px;
}
.list-controls input[type="search"]:focus,
.list-controls select:focus { border-color: var(--accent); }

/* ── ENTRY LIST ── */
.entry-list {
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 2px;
}
.entry-row:hover { background: var(--surface); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; }
.entry-row:last-child { border-bottom: none; }

.entry-row-left { min-width: 0; }

.entry-name {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-url {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  margin-top: 0.15rem;
}

.entry-row-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.entry-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.entry-lang {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.type-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.type-badge.personal { background: var(--badge-p); color: var(--badge-p-t); }
.type-badge.corporate { background: var(--badge-c); color: var(--badge-c-t); }

.list-empty {
  padding: 3rem clamp(1.25rem, 4vw, 3rem);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}
.list-empty.hidden { display: none; }

/* ── FORM PAGE ── */
.form-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 2rem);
}

.form-wrap h2 { margin-bottom: 0.75rem; }

.form-intro {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.google-form-embed {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.google-form-embed iframe { display: block; }

/* ── SLIDE PANEL ── */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.35);
  z-index: 200;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity 0.25s;
}
.panel-overlay.hidden { display: none; }

.entry-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(var(--panel-w), 100vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 201;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 32px rgba(13,13,13,0.12);
}
.entry-panel.hidden { display: none; }
.entry-panel.open { transform: translateX(0); }

.panel-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
}
.panel-close:hover { background: var(--border); }

.panel-screenshot-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.screenshot-loading {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.panel-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.panel-screenshot.hidden { display: none; }

.panel-body {
  padding: 1.5rem;
}

.panel-type-badge {
  margin-bottom: 0.75rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.panel-type-badge.personal { background: var(--badge-p); color: var(--badge-p-t); }
.panel-type-badge.corporate { background: var(--badge-c); color: var(--badge-c-t); }

.panel-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.panel-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.panel-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── FOOTER ── */
#site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ── LOADING STATE ── */
.loading-state {
  padding: 3rem clamp(1.25rem, 4vw, 3rem);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .list-header { flex-direction: column; }
  .list-controls { width: 100%; }
  .list-controls input[type="search"],
  .list-controls select { width: 100%; min-width: 0; }
  .entry-row { grid-template-columns: 1fr; }
  .entry-row-right { justify-content: flex-start; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── FOCUS ── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
