/* =============================================
   testingsoul — style.css
   Light theme mirroring the testingsoul.com brand:
   cream background, deep purple, sage green.
   All colours are CSS variables — never hardcode.
   ============================================= */

:root {
  /* Brand palette (from testingsoul.com) */
  --cream:       #faf8ec;   /* page background */
  --purple:      #422963;   /* primary / brand */
  --purple-soft: #5c3d82;
  --sage:        #d8dbc8;   /* secondary surface / accents */
  --sage-soft:   #e7e9dc;
  --slate:       #304254;   /* dark text */
  --white:       #ffffff;

  --bg:          var(--cream);
  --bg-card:     var(--white);
  --bg-soft:     var(--sage-soft);
  --border:      #e2e0d0;
  --border-soft: #ece9da;

  --text:        #45464a;
  --text-bright: var(--slate);
  --dim:         #8a8b86;
  --accent:      var(--purple);

  --maxw: 880px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(66, 41, 99, 0.08);

  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

/* ───────────── Reset / base ───────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  /* Reserve the scrollbar gutter on both sides so centred content
     stays truly centred (no slight left shift when a scrollbar shows). */
  scrollbar-gutter: stable both-edges;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-image:
    radial-gradient(48rem 32rem at 88% -8%, rgba(66, 41, 99, 0.07), transparent 60%),
    radial-gradient(40rem 30rem at -8% 8%, rgba(216, 219, 200, 0.55), transparent 60%);
  background-attachment: fixed;
}

a {
  color: var(--purple);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--purple-soft);
}

strong {
  color: var(--text-bright);
  font-weight: 600;
}

code,
.mono {
  font-family: var(--font-mono);
}

.hl {
  color: var(--purple);
}

/* ───────────── Logo wordmark ───────────── */
.logo-words {
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}

.logo-testing {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.72em;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--slate);
}

.logo-soul {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--purple);
}

/* ───────────── Header ───────────── */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.85rem 0;
  background: rgba(250, 248, 236, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 5vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: block;
}

nav {
  display: flex;
  gap: 1.6rem;
}

nav a {
  font-size: 0.92rem;
  color: var(--slate);
  font-weight: 500;
}

nav a:hover,
nav a.active {
  color: var(--purple);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--purple);
  transition: 0.2s;
}

/* ───────────── Layout / sections ───────────── */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 5vw, 2rem);
}

.section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border-soft);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.in,
.hero-inner.in {
  opacity: 1;
  transform: none;
}

.section-heading {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--purple);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.section-lead {
  color: var(--dim);
  max-width: 52ch;
  margin-bottom: 2rem;
}

/* ───────────── Hero ───────────── */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-inner {
  padding: 3.5rem 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
  width: 100%;
}

.hero-about {
  align-self: center;
  max-width: 62ch;
  padding-top: 1.8rem;
  border-top: 2px solid var(--sage);
  text-align: center;
}

.hero-about p {
  color: var(--text);
}

.hero-about p + p {
  margin-top: 0.9rem;
}

.hero-head {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.8rem);
  margin-bottom: 1.6rem;
}

.hero-mark {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.hero-mark img {
  width: clamp(80px, 15vw, 124px);
  height: auto;
}

.hero-headtext {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 4rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--text-bright);
  margin-bottom: 0.7rem;
}

.hero-tagline {
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: var(--slate);
  margin-bottom: 0;
  min-height: 1.6em;
}

.prompt {
  color: var(--purple);
  margin-right: 0.45rem;
}

.cursor {
  color: var(--purple);
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  /* Align the buttons with the title text, past the logo column */
  margin-left: calc(clamp(80px, 15vw, 124px) + clamp(1rem, 3vw, 1.8rem));
}

/* ───────────── Buttons ───────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.72rem 1.4rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: 0.2s ease;
}

.btn-primary {
  background: var(--purple);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--purple-soft);
  color: var(--cream);
  box-shadow: var(--shadow);
}

.btn-ghost {
  border-color: var(--purple);
  color: var(--purple);
}

.btn-ghost:hover {
  background: var(--purple);
  color: var(--cream);
}

/* ───────────── About ───────────── */
.about-text {
  max-width: 60ch;
}

.about-text p + p {
  margin-top: 1rem;
}

/* ───────────── Timeline ───────────── */
.timeline {
  position: relative;
  margin-left: 0.4rem;
  padding-left: 1.6rem;
  border-left: 2px solid var(--sage);
}

.tl-year {
  padding-bottom: 2.2rem;
}

.tl-year:last-child {
  padding-bottom: 0;
}

.tl-year-label {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--purple);
  margin-bottom: 1rem;
}

.tl-dot {
  position: absolute;
  left: calc(-1.6rem - 1px);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--purple);
  border: 3px solid var(--cream);
}

.tl-entries {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tl-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
}

.tl-kind {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
}

.tl-kind.speaker        { background: var(--purple);   color: var(--cream); }
.tl-kind.attendee       { background: var(--sage);     color: var(--slate); }
.tl-kind.course         { background: var(--sage-soft); color: var(--purple); border: 1px solid var(--sage); }
.tl-kind.certification  { background: var(--slate);    color: var(--cream); }
.tl-kind.studies        { background: var(--purple-soft); color: var(--cream); }
.tl-kind.research       { background: transparent; color: var(--purple); border: 1px solid var(--purple); }

.tl-items {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
}

.tl-items li {
  font-size: 0.9rem;
  color: var(--slate);
  position: relative;
  padding-left: 0.9rem;
}

.tl-items li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--purple);
}

.timeline-note {
  margin-top: 1.8rem;
  font-size: 0.9rem;
  color: var(--dim);
  font-style: italic;
}

/* ───────────── Tools & Skills ───────────── */
.ts-group + .ts-group {
  margin-top: 2rem;
}

.ts-subtitle {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple);
  margin-bottom: 0.9rem;
}

.tech-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tech {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--slate);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  transition: 0.18s ease;
}

.tech:hover {
  background: var(--purple);
  color: var(--cream);
  border-color: var(--purple);
}

/* ───────────── Projects ───────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.project-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: 0.2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--purple);
}

.project-status {
  position: absolute;
  top: 1.3rem;
  right: 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

.project-status.active      { background: var(--purple);   color: var(--cream); }
.project-status.maintained  { background: var(--sage);     color: var(--slate); }
.project-status.research    { background: transparent; color: var(--purple); border: 1px solid var(--purple); }

.project-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.3rem;
  padding-right: 5rem;
}

.project-title a {
  color: var(--text-bright);
}

.project-title a:hover {
  color: var(--purple);
}

.project-tagline {
  font-size: 0.9rem;
  color: var(--purple);
  margin-bottom: 0.7rem;
}

.project-desc {
  font-size: 0.93rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.pip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-soft);
  border: 1px solid var(--sage);
  border-radius: 7px;
  padding: 0.35rem 0.6rem;
  color: var(--purple);
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--dim);
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 0.18rem 0.5rem;
}

.project-links {
  display: flex;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* ───────────── Community ───────────── */
.community-card {
  display: flex;
  align-items: center;
  gap: clamp(1.4rem, 4vw, 2.4rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.2rem);
  box-shadow: var(--shadow);
}

.community-logo {
  flex: 0 0 auto;
}

.community-logo img {
  width: clamp(110px, 22vw, 170px);
  height: auto;
  display: block;
  border-radius: 50%;
}

.community-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.6rem;
}

.community-body p + p {
  margin-top: 0.8rem;
}

.community-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

@media (max-width: 600px) {
  .community-card {
    flex-direction: column;
    text-align: center;
  }

  .community-links {
    justify-content: center;
  }
}

/* ───────────── Contact ───────────── */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 1.02rem;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.contact-links .ico {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
}

/* ───────────── Footer ───────────── */
footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 2rem;
  background: var(--sage-soft);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.2rem clamp(1.2rem, 5vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--dim);
}

/* ───────────── Project subpage ───────────── */
.back-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--dim);
}

.back-link:hover {
  color: var(--purple);
}

.prose {
  max-width: 62ch;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 2.2rem 0 0.8rem;
}

.prose p + p {
  margin-top: 1rem;
}

.prose ul {
  margin: 0.8rem 0 0.8rem 1.2rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.codeblock {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--slate);
  overflow-x: auto;
  margin: 1rem 0;
  white-space: pre;
  box-shadow: var(--shadow);
}

/* ───────────── Responsive ───────────── */
@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  nav.open {
    max-height: 360px;
  }

  nav a {
    padding: 0.9rem clamp(1.2rem, 5vw, 3rem);
    border-top: 1px solid var(--border-soft);
  }
}
