:root {
  --bg: #0b1220;
  --bg-elevated: #121a2b;
  --surface: #161f33;
  --fg: #e8edf5;
  --muted: #8b95a8;
  --subtle: #6b7589;
  --primary: #2dd4bf;
  --primary-fg: #06201b;
  --border: #243049;
  --danger: #f87171;
  --font: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --display: "Syne", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); }
body { font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.03em; line-height: 1.12; text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; outline: 1px solid color-mix(in srgb, var(--fg) 10%, transparent); outline-offset: -1px; }
button:not(:disabled), [role="button"] { cursor: pointer; }
.wrap { width: min(1152px, calc(100% - 32px)); margin-inline: auto; }
.site { min-height: 100vh; display: flex; flex-direction: column; }
.site main { flex: 1; }
.header, .footer { border-bottom: 1px solid var(--border); }
.footer { border-bottom: 0; border-top: 1px solid var(--border); margin-top: auto; }
.header-inner, .footer-grid { width: min(1152px, calc(100% - 32px)); margin: 0 auto; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: var(--primary-fg); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.nav { display: none; gap: 4px; }
.nav a { font-size: 14px; color: var(--muted); padding: 8px 10px; border-radius: 999px; }
.nav a:hover, .nav a.is-on { color: var(--fg); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 20px; border-radius: 999px; font-size: 14px; font-weight: 500; border: 0; font-family: inherit; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.btn-dark { background: var(--fg); color: var(--bg); }
.btn-danger { background: var(--danger); color: var(--bg); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 12px; }
.btn:disabled { opacity: 0.4; }
.kicker { font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--subtle); }
.kicker.teal { color: var(--primary); }
.hero { position: relative; overflow: hidden; }
.hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.38; }
.hero .veil { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11,18,32,.35), rgba(11,18,32,.78) 55%, var(--bg)); }
.hero-copy { position: relative; width: min(1152px, calc(100% - 32px)); margin: 0 auto; padding: 88px 0 72px; }
.hero-copy h1 { font-size: clamp(32px, 5vw, 56px); max-width: 18ch; }
.lead { margin-top: 20px; max-width: 42rem; color: var(--muted); font-size: 17px; }
.actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.section { padding: 64px 0; }
.grid-3 { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 8%, transparent); }
.card h3 { font-size: 18px; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 0 0; }
.photos img { height: 112px; width: 100%; object-fit: cover; border-radius: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.project { display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 8%, transparent); }
.project img { height: 200px; width: 100%; object-fit: cover; }
.project .pad { padding: 20px; }
.cover { height: 176px; width: 100%; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; }
.form label { display: block; font-size: 13px; margin-bottom: 6px; }
.form input, .form textarea, .form select {
  width: 100%; height: 44px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--fg); padding: 0 12px; font: inherit;
}
.form textarea { height: auto; min-height: 120px; padding: 12px; }
.form .row { display: grid; gap: 16px; }
.flash { margin-top: 12px; font-size: 14px; }
.ok { color: var(--primary); }
.err { color: var(--danger); }
.footer-grid { display: grid; gap: 32px; padding: 56px 0; }
.footer-grid a { display: block; font-size: 14px; color: var(--muted); margin-top: 8px; }
.legal { border-top: 1px solid var(--border); }
.legal .header-inner { height: 52px; font-size: 12px; color: var(--subtle); }
.assist-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 20px; border-radius: 999px; border: 0;
  background: linear-gradient(120deg, #2dd4bf, #67e8f9, #818cf8, #2dd4bf);
  background-size: 220% 220%;
  color: #06201b; font: 600 14px var(--font);
  box-shadow: 0 0 0 0 rgba(45,212,191,.5), 0 12px 40px rgba(45,212,191,.35);
  animation: emPulse 2.4s ease-out infinite, emShift 6s linear infinite;
}
.assist-btn::before {
  content: "";
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px #fff, 0 0 2px #2dd4bf;
  animation: emBlink 1.3s ease-in-out infinite;
}
.assist-panel {
  position: fixed; right: 16px; bottom: 88px; z-index: 40; width: min(380px, calc(100% - 32px));
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 10%, transparent), 0 24px 60px rgba(0,0,0,.45);
  display: none; flex-direction: column;
}
.assist-panel.open { display: flex; }
.assist-head { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.assist-msgs { max-height: 42vh; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 90%; padding: 8px 12px; border-radius: 10px; font-size: 14px; white-space: pre-wrap; }
.bubble.me { align-self: flex-end; background: var(--primary); color: var(--primary-fg); }
.bubble.bot { align-self: flex-start; background: var(--bg-elevated); }
.starters { display: flex; flex-wrap: wrap; gap: 6px; }
.starters button { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 999px; padding: 4px 10px; font-size: 11px; }
.assist-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.assist-form input { flex: 1; height: 44px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--fg); padding: 0 12px; }
.admin { display: flex; min-height: 100vh; }
.side { width: 240px; background: var(--surface); border-right: 1px solid var(--border); display: none; flex-direction: column; }
.side nav a { display: block; margin: 4px 12px; padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.side nav a.is-on, .side nav a:hover { background: var(--bg-elevated); color: var(--fg); }
.admin-main { flex: 1; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.stats { display: grid; gap: 12px; }
.login-split { min-height: 100vh; display: grid; }
.login-art { display: none; position: relative; }
.login-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-art .veil { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg), rgba(11,18,32,.65)); }
.login-art .copy { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; }
.thumb-row { display: flex; gap: 8px; }
@media (min-width: 640px) {
  .grid-2, .grid-3, .photos, .stats, .form .row { grid-template-columns: 1fr 1fr; }
  .photos img { height: 160px; }
}
@media (min-width: 960px) {
  .nav { display: flex; }
  .grid-3, .stats { grid-template-columns: repeat(3, 1fr); }
  .stats.four { grid-template-columns: repeat(4, 1fr); }
  .side { display: flex; }
  .login-split { grid-template-columns: 1fr 1fr; }
  .login-art { display: block; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .admin-grid { display: grid; grid-template-columns: 1fr 360px; gap: 40px; }
}
@media (min-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(900px 400px at 10% -10%, rgba(45,212,191,.12), transparent 55%),
    radial-gradient(700px 360px at 110% 10%, rgba(99,102,241,.1), transparent 50%);
  animation: emAura 12s ease-in-out infinite alternate;
}
.site, .admin, .login-split { position: relative; z-index: 1; }
.hero .veil {
  background:
    linear-gradient(to bottom, rgba(11,18,32,.35), rgba(11,18,32,.78) 55%, var(--bg)),
    repeating-linear-gradient(90deg, transparent, transparent 48px, rgba(45,212,191,.05) 49px);
}
.card, .project { animation: emRise .7s ease both; }
.card:nth-child(2), .project:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3), .project:nth-child(3) { animation-delay: .12s; }

@keyframes emPulse {
  0% { box-shadow: 0 0 0 0 rgba(45,212,191,.55), 0 12px 40px rgba(45,212,191,.35); }
  70% { box-shadow: 0 0 0 16px rgba(45,212,191,0), 0 12px 40px rgba(45,212,191,.35); }
  100% { box-shadow: 0 0 0 0 rgba(45,212,191,0), 0 12px 40px rgba(45,212,191,.35); }
}
@keyframes emShift { to { background-position: 200% 0; } }
@keyframes emSpin { to { --spin: 360deg; transform: rotate(360deg); } }
@keyframes emBlink { 50% { opacity: .25; transform: scale(.7); } }
@keyframes emAura { to { opacity: .65; transform: scale(1.05); } }
@keyframes emRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .assist-btn, .card, .project, body::before { animation: none !important; }
}

.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.lang-wrap { display:inline-flex; }
.lang-select {
  height: 36px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--fg); padding: 0 10px;
  font: 12px var(--font); max-width: 132px;
}
html[dir="rtl"] .header-inner, html[dir="rtl"] .header-actions, html[dir="rtl"] .nav { flex-direction: row-reverse; }
html[dir="rtl"] .assist-btn { right: auto; left: 20px; }
html[dir="rtl"] .assist-panel { right: auto; left: 16px; }
html[dir="rtl"] .bubble.me { align-self: flex-start; }
html[dir="rtl"] .bubble.bot { align-self: flex-end; }
html[dir="rtl"] .legal .header-inner { flex-direction: row-reverse; }
