/* Kaloyan Yordanov, AI Engineer portfolio.
   Type is the personality, three self-hosted families (Latin only):
     Bricolage Grotesque  display voice (name, titles)
     IBM Plex Sans        body, quiet and readable
     IBM Plex Mono        the technical accent (labels, stacks, code motifs)
   Color: a warm ivory paper against one deliberate deep-teal accent.
   Warm ground plus cool jewel-tone accent reads alive, not clinical. */

/* Self-hosted fonts, zero external requests. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-latin-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/plex-sans-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/plex-sans-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f1e8;          /* warm ivory paper, alive not clinical */
  --card: #fffdf7;        /* warm white, lifts gently off the paper */
  --ink: #1c1b18;         /* warm charcoal, not pure black */
  --muted: #5c5850;       /* warm grey */
  --faint: #948d80;       /* warm faint */
  --line: #e6dfd1;        /* warm hairline */
  --line-soft: #eee7da;
  --chip: #f1ebdd;        /* warm chip */

  --accent: #0f766e;      /* deep teal, the single deliberate accent */
  --accent-ink: #0a5b54;  /* hover / pressed */
  --accent-tint: rgba(15, 118, 110, 0.10);
  --accent-tint-2: rgba(15, 118, 110, 0.16);

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 5vw, 2rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-tint-2);
  color: var(--ink);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }

.wrap {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Keyboard focus, deliberate and unmistakable */
a:focus-visible,
.btn:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(2.5rem, 7vh, 4.5rem);
  padding-bottom: clamp(2.75rem, 7vh, 4.75rem);
}

.name {
  font-family: var(--display);
  font-weight: 640;
  font-size: clamp(2.9rem, 8.5vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 40;
}

.lead {
  margin: 1.6rem 0 0;
  max-width: 52ch;
  font-size: clamp(1.12rem, 2.4vw, 1.3rem);
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Section headings ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.35rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--line);
}

.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-meta {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.section-meta::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.55em;
}

/* ---------- Projects ---------- */
.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.project {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: clamp(1.6rem, 4vw, 2.25rem);
  box-shadow: 0 1px 2px rgba(28, 27, 24, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.project:hover {
  transform: translateY(-4px);
  border-color: #ddd4c4;
  box-shadow: inset 3px 0 0 var(--accent), 0 22px 44px -26px rgba(28, 27, 24, 0.30);
}

.project-top {
  display: flex;
  align-items: center;
  margin-bottom: 1.2rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  white-space: nowrap;
}
/* LIVE wears the accent, deployed and healthy */
.status-live { color: var(--accent); background: var(--accent-tint); }
.status-live .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-tint-2);
  animation: pulse 2.4s ease-in-out infinite;
}
.status-soon {
  color: var(--muted);
  background: var(--chip);
  border: 1px solid var(--line);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(15, 118, 110, 0); }
}

.project-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.3vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.hook {
  margin: 0.6rem 0 0;
  font-weight: 500;
  font-size: 1.06rem;
  color: var(--ink);
}

.detail {
  margin: 0.9rem 0 0;
  max-width: var(--measure);
  color: var(--muted);
  font-size: 0.99rem;
  line-height: 1.62;
}

/* Stack, the monospace technical signal */
.stack {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.stack li {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--chip);
  border: 1px solid var(--line-soft);
  padding: 0.3rem 0.62rem;
  border-radius: 7px;
  white-space: nowrap;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.project:hover .stack li { border-color: #e6ddcd; }

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.64rem 1.1rem;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: transform 0.16s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.arrow { font-size: 0.9em; }

.tag {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--chip);
  border: 1px dashed #d6cdba;
  padding: 0.5rem 0.85rem;
  border-radius: 9px;
}

/* ---------- Contact ---------- */
.contact {
  margin-top: clamp(3.75rem, 9vh, 6rem);
  padding-top: 1.5rem;
  padding-bottom: clamp(4.5rem, 11vh, 7rem);
  border-top: 1px solid var(--line);
}
.contact .label { display: block; margin-bottom: 1.6rem; }

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}
.contact-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.contact-key {
  flex: 0 0 5.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Text links with an accent underline that draws in on hover */
.contact-list a {
  color: var(--ink);
  font-size: 1.02rem;
  padding-bottom: 2px;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  transition: background-size 0.28s ease, color 0.2s ease;
}
.contact-list a:hover {
  color: var(--accent);
  background-size: 100% 1.5px;
}

/* ---------- Footer ---------- */
footer { margin: clamp(3.75rem, 9vh, 5.5rem) auto clamp(2.5rem, 6vh, 4rem); }
.footer-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: reveal 0.62s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  }
  .d1 { animation-delay: 0.05s; }
  .d2 { animation-delay: 0.13s; }
  .d3 { animation-delay: 0.22s; }
  .d4 { animation-delay: 0.32s; }
  .d5 { animation-delay: 0.40s; }
  .d6 { animation-delay: 0.48s; }
  .d7 { animation-delay: 0.56s; }
}
@keyframes reveal { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Small screens ---------- */
@media (max-width: 460px) {
  body { font-size: 16px; }
  .contact-list li { flex-direction: column; gap: 0.2rem; }
  .contact-key { flex-basis: auto; }
  .btn { flex: 1 1 auto; justify-content: center; }
}
