/* =====================================================
   COMPONENTS — cards · buttons · section titles · reveals
   ===================================================== */

/* ── Theme transition (smooth color swap on toggle) ── */
.theme-animating,
.theme-animating *,
.theme-animating *::before,
.theme-animating *::after {
  transition:
    background-color 0.35s ease,
    color            0.30s ease,
    border-color     0.30s ease,
    box-shadow       0.30s ease !important;
}

/* ── Theme toggle button ── */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--glass-bg-dark);
  border: 1.5px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-normal), border-color var(--t-normal),
              color var(--t-normal), transform var(--t-spring);
}
.theme-toggle:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: rotate(20deg) scale(1.08);
}

/* Show moon in light mode, sun in dark mode */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Card ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--r-full);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform var(--t-spring), box-shadow var(--t-normal), background var(--t-normal);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent-1);
  color: var(--bg-tertiary);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { box-shadow: var(--shadow-lg); }

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--glass-border);
}
.btn-outline:hover {
  border-color: var(--accent-2);
  background: var(--glass-bg-dark);
}

.btn-ghost {
  background: var(--glass-bg-dark);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--accent-2);
}

.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-private {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.80rem;
}
.btn-full { width: 100%; justify-content: center; }

/* ── Section layout ── */
.section { padding: var(--sp-xl) 0; }

.section-header {
  text-align: center;
  margin-bottom: var(--sp-lg);
}
.section-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  color: var(--text-primary);
  font-weight: 600;
}
.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto var(--sp-md);
  font-size: 1rem;
}

/* ── Reveal animations ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: var(--delay, 0s);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Social icon buttons ── */
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: color var(--t-normal), transform var(--t-spring), box-shadow var(--t-normal), border-color var(--t-normal);
}
.social-btn:hover {
  color: var(--text-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-2);
}

/* ── Tech tags ── */
.tech-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent-2);
  background: rgba(120, 96, 74, 0.08);
  border: 1px solid rgba(120, 96, 74, 0.18);
  border-radius: var(--r-full);
  padding: 0.2rem 0.65rem;
}

/* ── Typing cursor ── */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent-2);
  margin-left: 2px;
  vertical-align: middle;
  border-radius: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Directional reveals (hero name) — observer-based so they re-trigger on scroll ── */
.reveal-left {
  display: inline-block;
  opacity: 0;
  transform: translateX(-90px);
  transition:
    opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reveal-right {
  display: inline-block;
  opacity: 0;
  transform: translateX(90px);
  transition:
    opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: 0.2s;
}
.reveal-left.revealed,
.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* ── Scroll-triggered directional slides ── */
.slide-left,
.slide-right {
  display: inline-block;
  opacity: 0;
  transition:
    opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.slide-left  { transform: translateX(-60px); }
.slide-right { transform: translateX(60px); transition-delay: 0.18s; }
.slide-left.revealed,
.slide-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* ── Intro splash ── */
@keyframes sceneIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideFromLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideFromRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes growLine {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}
@keyframes steamRise {
  0%, 100% { opacity: 0.25; transform: translateY(0) scaleX(1); }
  50%       { opacity: 0.75; transform: translateY(-9px) scaleX(0.7); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.intro-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.25rem;
  animation: sceneIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

/* Icons row */
.intro-icons {
  display: flex;
  align-items: flex-end;
  gap: 5rem;
}

/* ── CSS Laptop ── */
.intro-laptop {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideFromLeft 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
}
.laptop-screen {
  width: 170px;
  height: 110px;
  background: #1a1410;
  border: 2.5px solid #3d2e22;
  border-bottom: none;
  border-radius: 7px 7px 0 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  overflow: hidden;
}
.lc {
  height: 4px;
  border-radius: 2px;
  transform-origin: left;
  transform: scaleX(0);
  animation: growLine 0.4s ease both;
}
.lc-1 { background: #78604a; width: 72%; animation-delay: 0.7s; }
.lc-2 { background: #a07850; width: 48%; animation-delay: 0.88s; }
.lc-3 { background: #e8dfd0; width: 86%; animation-delay: 1.06s; }
.lc-4 { background: #78604a; width: 42%; animation-delay: 1.24s; }
.lc-5 { background: #a07850; width: 62%; animation-delay: 1.42s; }
.laptop-hinge {
  width: 178px;
  height: 5px;
  background: #3d2e22;
}
.laptop-base {
  width: 190px;
  height: 12px;
  background: #2d2018;
  border-radius: 0 0 8px 8px;
}

/* ── CSS Coffee cup ── */
.intro-coffee {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideFromRight 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both;
}
.coffee-steam {
  display: flex;
  gap: 10px;
  margin-bottom: 7px;
  height: 40px;
  align-items: flex-end;
}
.coffee-steam span {
  width: 4px;
  border-radius: 3px;
  background: var(--text-muted);
  animation: steamRise 2.2s ease-in-out infinite;
}
.coffee-steam span:nth-child(1) { height: 18px; animation-delay: 0s; }
.coffee-steam span:nth-child(2) { height: 28px; animation-delay: 0.45s; }
.coffee-steam span:nth-child(3) { height: 15px; animation-delay: 0.9s; }
.coffee-cup {
  width: 86px;
  height: 74px;
  background: linear-gradient(160deg, var(--accent-2), var(--accent-3));
  clip-path: polygon(8% 0%, 92% 0%, 82% 100%, 18% 100%);
  position: relative;
}
.coffee-liquid {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 11px;
  background: #1c1210;
  border-radius: 50%;
}
.coffee-handle {
  position: absolute;
  right: -20px;
  top: 16px;
  width: 22px;
  height: 32px;
  border: 5px solid var(--accent-2);
  border-left: none;
  border-radius: 0 13px 13px 0;
}
.coffee-saucer {
  width: 104px;
  height: 12px;
  background: var(--accent-3);
  border-radius: 0 0 50px 50px;
  opacity: 0.65;
  margin-top: 2px;
}

/* ── Terminal window ── */
.intro-terminal {
  width: min(520px, 90vw);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(28, 25, 23, 0.12);
  animation: sceneIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.55s both;
}
.terminal-bar {
  background: #2d2420;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tb-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tb-red    { background: #ff5f57; }
.tb-yellow { background: #ffbd2e; }
.tb-green  { background: #28c840; }
.tb-title {
  flex: 1;
  text-align: center;
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  padding-right: 33px;
  letter-spacing: 0.03em;
}
.terminal-body {
  background: #1a1410;
  padding: 16px 18px 18px;
  min-height: 108px;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
  font-size: clamp(0.74rem, 2vw, 0.875rem);
  line-height: 1.75;
  color: #e8dfd0;
}
.t-line   { display: block; min-height: 1.75em; }
.t-prompt { color: var(--accent-2); }
.t-check  { color: #5cba6e; }
.t-cursor {
  display: inline-block;
  width: 0.5em;
  height: 1.05em;
  background: var(--accent-2);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 0.9s step-end infinite;
}

/* ── Now Building widget ── */
.now-building {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1rem;
  border-radius: var(--r-full);
  background: var(--glass-bg-light);
  border: 1px solid var(--glass-border);
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.now-building strong { color: var(--text-primary); }
.now-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  animation: nowPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes nowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}
