:root {
  --bg: #f4f4f5;
  --card: #ffffff;
  --text: #18181b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --border: #e4e4e7;
  --accent: #f5b301;
  --accent-ink: #3f2d00;
  --chip: #f4f4f5;
  --line: #d4d4d8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 8px rgba(0, 0, 0, .04);
  --shadow-hover: 0 4px 24px rgba(0, 0, 0, .08);
  --radius: 18px;
  --ok: #15803d;
  --info: #1d4ed8;
  --sale: #3f2d00;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --card: #161618;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --border: #27272a;
  --chip: #222225;
  --line: #3f3f46;
  --shadow: none;
  --shadow-hover: 0 4px 24px rgba(0, 0, 0, .5);
  --ok: #4ade80;
  --info: #93c5fd;
  --sale: #fcd34d;
  color-scheme: dark;
}
.brand img { mix-blend-mode: multiply; }
:root[data-theme="dark"] .brand img { filter: invert(1); mix-blend-mode: screen; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, sans-serif;
  transition: background .2s, color .2s;
}
a { color: inherit; }
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }

/* Top bar: centered logo, theme toggle on the right */
.topbar {
  max-width: 1180px; margin: 0 auto; padding: 28px 24px 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.top-actions { justify-self: end; display: flex; gap: 8px; align-items: center; }
.lang-toggle {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr;
  height: 40px; padding: 3px; border-radius: 12px; background: var(--card); border: 1px solid var(--border);
}
.lang-toggle button {
  position: relative; z-index: 1; width: 40px; border: 0; background: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--muted); transition: color .2s;
}
.lang-toggle button[aria-pressed=true] { color: var(--bg); }
.lang-toggle .knob {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: 40px; border-radius: 9px;
  background: var(--text); transition: transform .22s cubic-bezier(.3, .7, .4, 1);
}
.lang-toggle[data-lang=tr] .knob { transform: translateX(40px); }
.brand { justify-self: center; display: block; }
.brand img { height: 30px; width: auto; display: block; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  display: grid; place-items: center;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: block; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 24px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* Left column */
.profile { position: sticky; top: 32px; }
.legal { margin: 0 0 14px; font-size: 11px; letter-spacing: .04em; color: var(--faint); font-weight: 600; line-height: 1.5; }
.profile h1 { font-size: 26px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.02em; }
.bio { color: var(--muted); margin: 0 0 24px; }
.nl-title { margin: 0 0 10px; font-weight: 600; }

.newsletter { display: flex; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow); }
.newsletter input[type=email] { flex: 1; min-width: 0; border: 0; padding: 12px 14px; background: transparent; color: var(--text); outline: none; }
.newsletter button { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 0 16px; cursor: pointer; }
.newsletter button:disabled { opacity: .6; cursor: wait; }
.newsletter:focus-within { border-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.nl-msg { min-height: 20px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.nl-msg.ok { color: var(--ok); }
.nl-msg.err { color: #dc2626; }

.consent { margin: 4px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--faint); }
.consent a, .footer a { color: inherit; }
.consent a:hover, .footer a:hover { color: var(--text); }

.section-label { font-size: 12px; font-weight: 600; color: var(--faint); margin: 20px 0 8px; }
.brand-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.brand-row .logo { width: 32px; height: 32px; border-radius: 9px; padding: 4px; }
.brand-row .logo.full { padding: 0; }
.brand-row .name { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; }
.icon-links { display: flex; gap: 2px; }
.icon-links a {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; color: var(--muted);
}
.icon-links a:hover { color: var(--text); background: var(--chip); }
.icon-links svg { width: 16px; height: 16px; }
.owner-card {
  display: flex; align-items: center; gap: 10px; margin-top: 4px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card);
}
.owner-card .avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600;
}
.owner-card .who { flex: 1; line-height: 1.25; }
.owner-card .who b { display: block; font-size: 14px; font-weight: 600; }
.owner-card .who span { font-size: 12px; color: var(--muted); }

/* Toolbar */
.toolbar { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.filters button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.view-toggle { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); }
.view-toggle button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer;
  color: var(--muted); padding: 5px 12px; border-radius: 9px; font-size: 13px; font-weight: 500;
}
.view-toggle button svg { width: 15px; height: 15px; }
.view-toggle button.active { background: var(--chip); color: var(--text); }

/* Logos (project logo or emoji fallback) */
.logo {
  width: 40px; height: 40px; flex: none; border-radius: 11px;
  display: grid; place-items: center; font-size: 20px; overflow: hidden;
  background: color-mix(in srgb, var(--c, #888) 14%, transparent);
}
.logo.img { background: #fff; border: 1px solid var(--border); padding: 5px; }
/* Icon tiles follow the theme: white card in light mode, dark card in dark mode */
.logo.glyph { background: var(--card); border: 1px solid var(--border); color: var(--text); }
.logo.glyph svg { width: 52%; height: 52%; }
.logo.img img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* Logos with their own background fill the tile edge to edge */
.logo.img.full { padding: 0; border-color: transparent; }
.logo.img.full img { object-fit: cover; }

/* List view */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid > *, .profile, .content { min-width: 0; }
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .18s, box-shadow .18s, outline-color .18s;
  outline: 2px solid transparent; outline-offset: 2px;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card:focus-visible { outline-color: var(--accent); }
.card.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 100% { outline-color: transparent; } 20%, 60% { outline-color: var(--accent); } }

.card-head { display: flex; align-items: center; gap: 12px; }
.card-title { min-width: 0; flex: 1; }
.card-title h3 { margin: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title .date { font-size: 12px; color: var(--faint); }
.ext { font-size: 13px; color: var(--faint); font-weight: 500; }
.card:hover .ext { color: var(--text); }
.tagline { margin: 0; color: var(--muted); font-size: 14px; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.badge { font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.badge.active { color: var(--ok); background: color-mix(in srgb, #22c55e 14%, transparent); }
.badge.active::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; margin-right: 6px; vertical-align: 1px; }
.badge.completed { color: var(--info); background: color-mix(in srgb, #3b82f6 14%, transparent); }
.badge.sale { color: var(--sale); background: color-mix(in srgb, var(--accent) 30%, transparent); }

.used-in { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.used-in a { text-decoration: none; color: var(--text); font-weight: 500; padding: 2px 8px; border-radius: 6px; border: 1px dashed var(--border); }
.used-in a:hover { border-color: var(--accent); border-style: solid; }
.card-socials .icon-links { margin-left: -6px; }
.invest {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 10px; font-size: 12.5px; color: var(--muted);
  background: color-mix(in srgb, #0a66c2 7%, transparent); border: 1px solid color-mix(in srgb, #0a66c2 18%, transparent);
}
.invest a { display: inline-flex; align-items: center; gap: 6px; color: #0a66c2; font-weight: 600; text-decoration: none; }
.invest a:hover { text-decoration: underline; }
.invest svg { width: 15px; height: 15px; }
:root[data-theme="dark"] .invest a { color: #70b5f9; }
.empty { color: var(--muted); grid-column: 1 / -1; text-align: center; padding: 40px 0; }

/* Map view */
.map { display: flex; flex-direction: column; gap: 20px; position: relative; }
.hovercard {
  position: absolute; top: 0; left: 0; z-index: 10; width: 300px; max-width: 100%;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .14); pointer-events: none;
  display: flex; flex-direction: column; gap: 8px;
}
.hovercard .tagline { font-size: 13px; }
.hovercard .badges { margin-top: 2px; padding-top: 0; }
.hovercard.pinned { pointer-events: auto; }
.hc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.hc-actions .btn { padding: 8px 12px; font-size: 13px; }
.map-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.map-section h2 { margin: 0 0 4px; font-size: 15px; }
.map-section > p { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.diagram { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(40px, 140px) minmax(0, 1fr); }
.diagram .col { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; position: relative; z-index: 1; }
.col-label { font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; margin-bottom: -4px; }
.diagram svg.edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.edges path { fill: none; stroke: var(--line); stroke-width: 1.5; transition: stroke .15s, opacity .15s; }
.edges path.on { stroke: var(--accent); stroke-width: 2.5; }
.diagram.focus .edges path:not(.on) { opacity: .25; }
.diagram.focus .node:not(.on) { opacity: .4; }

.node {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  transition: opacity .15s, border-color .15s;
}
.node:hover, .node.on { border-color: var(--accent); }
.node .logo { width: 32px; height: 32px; border-radius: 9px; font-size: 16px; padding: 4px; }
.node .t { min-width: 0; line-height: 1.25; }
.node .t b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node .t span { font-size: 12px; color: var(--muted); }
.standalone { display: flex; flex-wrap: wrap; gap: 8px; }
.standalone .node { padding: 6px 10px 6px 6px; }
.standalone .node .logo { width: 26px; height: 26px; font-size: 14px; border-radius: 7px; padding: 3px; }

/* Full-bleed logos stay edge to edge in every context (cards, map nodes, sidebar) */
.logo.img.full, .node .logo.img.full, .standalone .node .logo.img.full { padding: 0; }
.logo.glyph, .node .logo.glyph, .standalone .node .logo.glyph { padding: 0; }

.footer { max-width: 1180px; margin: 0 auto; padding: 32px 24px 40px; color: var(--faint); font-size: 12px; text-align: center; line-height: 1.8; }

/* Modal */
.modal {
  border: 1px solid var(--border); border-radius: 20px; padding: 0;
  width: min(560px, calc(100vw - 32px));
  background: var(--card); color: var(--text);
}
.modal::backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(2px); }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-body h2 { margin: 0; font-size: 22px; }
.modal-body p { margin: 0; }
.modal .close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border-radius: 8px; border: 0; background: var(--chip); color: var(--text); cursor: pointer; font-size: 18px;
}
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.meta dt { color: var(--faint); }
.meta dd { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14px;
  border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ts:empty { display: none; }
.ts { margin-top: 8px; }
.interest { border-top: 1px solid var(--border); padding-top: 16px; }
.interest h3 { margin: 0 0 4px; font-size: 16px; }
.interest > p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.interest form { display: flex; flex-direction: column; gap: 8px; }
.interest input[type=email], .interest textarea {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  background: var(--bg); color: var(--text); outline: none; resize: vertical;
}
.interest input:focus, .interest textarea:focus { border-color: var(--accent); }
.interest .btn { align-self: flex-start; }
.interest .ts { margin-top: 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 28px 16px 16px; }
  .topbar { padding: 20px 16px 0; }
  .profile { position: static; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .legal { overflow-wrap: anywhere; }
  /* Logo left, controls right: a centered logo doesn't fit next to the controls on phones */
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .topbar > span:first-child { display: none; }
  .brand { justify-self: start; }
  .brand img { height: 22px; }
  .lang-toggle, .theme-toggle { height: 36px; }
  .theme-toggle { width: 36px; }
  .lang-toggle button, .lang-toggle .knob { width: 36px; }
  .lang-toggle[data-lang=tr] .knob { transform: translateX(36px); }
  .grid { grid-template-columns: 1fr; }
  .diagram { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); }
  .node { padding: 8px; gap: 8px; }
  .node .t span { display: none; }
  .node .t b { font-size: 12.5px; white-space: normal; }
  .map-section { padding: 14px; }
}
