/* ==========================================================================
   03 — COMPONENTS
   ==========================================================================
   Reusable pieces used across several sections: buttons, the fake terminal
   window chrome, cards, chips, form fields, and small text utilities.
   Section-specific styling lives in 05-sections.css instead.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Text colour utilities
   -------------------------------------------------------------------------- */
.accent-green { color: var(--green); }
.accent-amber { color: var(--amber); }
.dim          { color: var(--dim); }

/* --------------------------------------------------------------------------
   Traffic-light dots (window chrome + status indicators)
   -------------------------------------------------------------------------- */
.dots { display: flex; gap: 7px; flex: none; }

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
.dot-red   { background: #ff5f56; }
.dot-amber { background: #ffbd2e; }
.dot-green { background: #27c93f; }

/* Pulsing "live" indicator. */
.dot-live {
  width: 9px;
  height: 9px;
  background: var(--green);
  animation: glow 2.4s ease-in-out infinite;
}

/* Blinking terminal cursor. */
.caret {
  width: 9px;
  height: 17px;
  background: var(--green);
  animation: blink 1.1s step-end infinite;
  flex: none;
  display: inline-block;
}

/* --------------------------------------------------------------------------
   Terminal window chrome
   .win      = the window shell
   .winbar   = its title bar
   -------------------------------------------------------------------------- */
.win {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -30px var(--shadow);
}

.winbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line2);
  background: var(--panel2);
}

.winbar-title {
  margin-left: 8px;
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Lets the ellipsis actually engage inside the flex bar, instead of the
     title text forcing the whole window wider on narrow screens. */
  min-width: 0;
}

/* Right-aligned extra content in a title bar (scores, load average, chips). */
.winbar-meta {
  margin-left: auto;
  font-size: 11px;
  flex: none;
}

/* --------------------------------------------------------------------------
   Buttons
   .btn-primary = solid accent fill with an animated sheen
   .btn-ghost   = transparent with an animated gradient border
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  color: var(--onacc);
  background: var(--green);
  border: none;
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 700;
  transition: box-shadow var(--speed) ease, transform .2s ease;
}
.btn-primary:hover {
  box-shadow: 0 0 22px var(--line);
  transform: translateY(-1px);
  color: var(--onacc);
}
/* Diagonal light sweep across the button. */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-20deg);
  animation: sheen 5s ease-in-out infinite;
  pointer-events: none;
}

.btn-ghost {
  color: var(--text);
  /* Two-layer background: flat panel inside, animated gradient on the border. */
  background:
    linear-gradient(var(--panel2), var(--panel2)) padding-box,
    linear-gradient(90deg, var(--green), var(--amber), var(--green), var(--amber), var(--green)) border-box;
  border: 1.5px solid transparent;
  background-size: 250% 100%;
  animation: borderslide 4s linear infinite;
  padding: 10px 18px;
  font-size: 13.5px;
  transition: box-shadow var(--speed) ease, color .2s ease;
}
.btn-ghost:hover { color: var(--ink); box-shadow: 0 0 18px var(--line); }

/* Compact variant used inside project cards and terminal output. */
.btn-sm { padding: 8px 12px; font-size: 12px; }

/* Disabled state, applied while the contact form is submitting. */
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* --------------------------------------------------------------------------
   Pills and chips
   .pill-btn = rounded nav buttons (theme, sound)
   .chip     = square-ish filter buttons
   -------------------------------------------------------------------------- */
.pill-btn {
  background: var(--chipbg);
  border: 1px solid var(--line);
  color: var(--green);
  border-radius: 20px;
  padding: 5px 12px;
  font: 500 12px var(--font-mono);
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.pill-btn:hover { background: var(--hover); }

.chip {
  background: var(--chipbg);
  color: var(--green);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
  font: 500 11.5px var(--font-mono);
  cursor: pointer;
}
.chip:hover { background: var(--hover); }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-pad { padding: 16px 18px; }

.card-kicker {
  font-size: 12px;
  margin-bottom: 12px;
  letter-spacing: .04em;
}

/* Lift-on-hover behaviour for clickable cards. */
.card-hover {
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card-hover:hover {
  border-color: var(--green);
  box-shadow: 0 14px 34px -20px var(--line);
  transform: translateY(-2px);
}

/* Small outlined label, e.g. tech-stack tags on project cards. */
.tag {
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Form fields
   .field = underlined single-line input
   .ta    = boxed textarea
   -------------------------------------------------------------------------- */
.field {
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--line);
  outline: none;
  font-size: 14px;
  padding: 4px 2px;
  width: 100%;
}
.field:focus-visible { outline-offset: 2px; }

.ta {
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  font: 400 14px/1.6 var(--font-mono);
  padding: 10px 12px;
  width: 100%;
  resize: vertical;
  min-height: 96px;
}

/* Browser-native validation styling, only after the user has interacted. */
.field:user-invalid,
.ta:user-invalid { border-color: var(--red); }

/* --------------------------------------------------------------------------
   Section heading  ( ~/apps  ·  descriptive subtitle )
   -------------------------------------------------------------------------- */
.sec-h {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sec-h h2 {
  font-size: 15px;
  color: var(--green);
  font-weight: 700;
}
.sec-h span {
  font-size: 13px;
  color: var(--dim);
}
