/* ============================================================
   AI Creative Research Lab — Shared Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&display=swap');

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

:root {
  --bg:       #0d0d0d;
  --bg2:      #141414;
  --bg3:      #1c1c1c;
  --border:   #2a2a2a;
  --text:     #e8e8e8;
  --muted:    #888;
  --accent:   #e8e8e8;
  --font:     'JetBrains Mono', 'Courier New', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── NAV ─────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: rgba(13,13,13,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}

.logo-expand {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  vertical-align: bottom;
  white-space: pre;
  animation: logo-breathe 10s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.logo-expand:nth-of-type(2) { animation-delay: 0.06s; }
.logo-expand:nth-of-type(3) { animation-delay: 0.12s; }

@keyframes logo-breathe {
  0%, 25%   { max-width: 0;    opacity: 0; }
  35%, 75%  { max-width: 150px; opacity: 1; }
  85%, 100% { max-width: 0;    opacity: 0; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  opacity: .8;
  transition: opacity .2s;
}
.nav-links a:hover { opacity: 1; }

.btn-contact {
  border: none;
  padding: 10px 24px;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 13px;
  color: #fff !important;
  background: #4a8fe8;
  cursor: pointer;
  transition: background .2s, opacity .2s;
  text-decoration: none;
  opacity: 1 !important;
}
.btn-contact:hover { background: #3a7fd8; opacity: 1; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.page { padding-top: 80px; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 60px;
}

/* ── HERO ────────────────────────────────────────────────── */
.hero { padding: 80px 0 60px; }

.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.01em;
  max-width: 520px;
}

/* ── MEDIA CARD ──────────────────────────────────────────── */
.media-card {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg3);
  border-radius: 16px;
  margin: 40px 0 60px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.media-card video, .media-card img {
  width: 100%; height: 100%; object-fit: cover;
}
.media-card .placeholder {
  color: var(--muted);
  font-size: 13px;
}

/* ── SECTION LABEL ───────────────────────────────────────── */
.section-label {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 32px;
  color: var(--text);
}

/* ── PROJECT / POST LIST ─────────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 0; }

.post-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}
.post-item:first-child { border-top: 1px solid var(--border); }

.post-meta { display: flex; flex-direction: column; gap: 6px; }

.post-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.post-title:hover { opacity: .7; }

.post-excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 460px;
}

.post-date {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.post-link {
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  opacity: .6;
  transition: opacity .2s;
}
.post-link:hover { opacity: 1; }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  padding: 60px 0 40px;
  border-top: 1px solid var(--border);
  margin-top: 80px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--text); }

/* ── PAGE HERO (inner pages) ─────────────────────────────── */
.page-hero { padding: 80px 0 48px; }
.page-hero .tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 20px;
}
.page-hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 400;
  line-height: 1.3;
  max-width: 560px;
}
.page-hero p {
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.7;
}

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 48px 0; }

/* ── ABOUT / US ──────────────────────────────────────────── */
.about-block { display: flex; flex-direction: column; gap: 48px; margin-bottom: 48px; }

.about-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
}
@media (max-width: 560px) {
  .about-row { grid-template-columns: 1fr; gap: 8px; }
}
.about-row-label {
  font-size: 12px;
  color: var(--muted);
  padding-top: 2px;
}
.about-row-content { font-size: 14px; line-height: 1.75; color: var(--text); }
.about-row-content p + p { margin-top: 12px; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 16px;
}
.team-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.team-card .name { font-weight: 700; font-size: 13px; }
.team-card .role { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── BE PART CARD — animated border ──────────────────────── */
.team-card--cta {
  position: relative;
  border: none;
  overflow: hidden;
  z-index: 0;
}
.team-card--cta::before,
.team-card--cta::after {
  content: '';
  position: absolute;
}
/* spinning highlight beam — oversized so rotation stays covered */
.team-card--cta::before {
  top: 50%; left: 50%;
  width: 200%; height: 200%;
  transform-origin: center;
  translate: -50% -50%;
  z-index: -2;
  border-radius: 0;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    transparent 60%,
    rgba(255,255,255,.15) 75%,
    rgba(255,255,255,.3) 82%,
    rgba(255,255,255,.15) 90%,
    transparent 100%
  );
  animation: border-spin 6s linear infinite;
}
/* inner fill to mask center */
.team-card--cta::after {
  inset: 1.5px;
  z-index: -1;
  border-radius: inherit;
  background: var(--bg2);
}
@keyframes border-spin {
  to { transform: rotate(360deg); }
}

/* ── CONTACT ─────────────────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: 20px; max-width: 560px; }

.field { display: flex; flex-direction: column; gap: 8px; }

.field label { font-size: 12px; color: var(--muted); letter-spacing: .06em; }

.field input,
.field textarea,
.field select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
  resize: vertical;
}
.field input:focus,
.field textarea:focus { border-color: #555; }
.field textarea { min-height: 140px; }

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 13px 28px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity .2s;
}
.btn-primary:hover { opacity: .85; }

.form-note { font-size: 12px; color: var(--muted); margin-top: 8px; }

.success-msg {
  display: none;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text);
}

/* ── ADMIN / POST EDITOR ─────────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
  margin-bottom: 80px;
}
@media (max-width: 720px) {
  .admin-grid { grid-template-columns: 1fr; }
}

.editor-card,
.sidebar-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}

.editor-card h2,
.sidebar-card h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .08em;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.editor-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.toolbar-btn:hover { background: #2a2a2a; }

#post-body {
  width: 100%;
  min-height: 320px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}
#post-body:focus { border-color: #555; }

.post-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 22px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background .2s;
}
.btn-secondary:hover { background: var(--bg3); }

/* saved posts sidebar */
.saved-post-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.saved-post-item:last-child { border-bottom: none; }
.saved-post-item .sp-title { font-size: 13px; font-weight: 700; }
.saved-post-item .sp-date { font-size: 11px; color: var(--muted); margin-top: 3px; }
.saved-post-item:hover .sp-title { opacity: .7; }

.empty-state { font-size: 13px; color: var(--muted); }

/* delete btn inside saved items */
.sp-actions { display: flex; gap: 8px; margin-top: 6px; }
.sp-btn { font-size: 11px; color: var(--muted); background: none; border: none; cursor: pointer; font-family: var(--font); padding: 0; }
.sp-btn:hover { color: var(--text); }

/* ── SINGLE POST ─────────────────────────────────────────── */
.post-header { padding: 80px 0 40px; }
.post-header .post-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 16px;
}
.post-header h1 {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 400;
  line-height: 1.3;
}
.post-header .post-info {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

.post-content {
  font-size: 14px;
  line-height: 1.85;
  color: var(--text);
  padding-bottom: 80px;
}
.post-content p { margin-bottom: 20px; }
.post-content h2 { font-size: 18px; font-weight: 700; margin: 36px 0 14px; }
.post-content h3 { font-size: 15px; font-weight: 700; margin: 28px 0 10px; }
.post-content pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: 12px;
}
.post-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 20px;
  color: var(--muted);
  margin: 20px 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 48px;
  transition: color .2s;
}
.back-link:hover { color: var(--text); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 600px) {
  nav { padding: 16px 20px; }
  .container { padding: 0 20px; }
  .post-item { grid-template-columns: 1fr; }
  .post-link { align-self: flex-start; }
  .logo-expand { animation: none; max-width: 0; opacity: 0; }
}
