/* ===== Animations ===== */
@keyframes pcFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes pcEmber { 0% { transform: translateY(0) scale(1); opacity: 0; } 12% { opacity: .9; } 100% { transform: translateY(-340px) scale(.4); opacity: 0; } }
@keyframes pcPulse { 0%, 100% { opacity: .35; } 50% { opacity: .85; } }
@keyframes pcBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ===== Hero ===== */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 96px) 32px 72px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: clamp(36px, 5vw, 56px);
  align-items: center;
}
.hero-embers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.ember {
  position: absolute;
  bottom: -40px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation-name: pcEmber;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.ember:nth-child(1) { left: 18%; animation-duration: 6s; animation-delay: 0s; }
.ember:nth-child(2) { left: 34%; width: 4px; height: 4px; animation-duration: 7.5s; animation-delay: 1.4s; }
.ember:nth-child(3) { left: 52%; width: 5px; height: 5px; animation-duration: 6.8s; animation-delay: 2.6s; }
.ember:nth-child(4) { left: 64%; width: 3px; height: 3px; animation-duration: 8s; animation-delay: 0.8s; }

.hero-copy { position: relative; z-index: 2; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--fm);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  margin-bottom: 28px;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pcPulse 2.4s ease-in-out infinite; }

.hero-title {
  font-family: var(--fd);
  font-weight: 700;
  font-size: clamp(44px, 6vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 24px;
}
.hero-sub { font-size: 18.5px; line-height: 1.62; color: var(--muted); max-width: 480px; margin-bottom: 38px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 52px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.stat-num { font-family: var(--fd); font-weight: 700; font-size: 28px; color: var(--ink); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

.hero-visual { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.phoenix-wrap { position: relative; width: 100%; display: flex; justify-content: center; }
.phoenix-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 232, 41, 0.16), transparent 68%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  animation: pcPulse 4s ease-in-out infinite;
}
.phoenix-img {
  position: relative;
  width: min(80%, 400px);
  height: auto;
  animation: pcFloat 6s ease-in-out infinite;
  filter: drop-shadow(0 24px 60px rgba(200, 232, 41, 0.18));
}

.terminal-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.6);
}
.terminal-topbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dot { width: 11px; height: 11px; border-radius: 50%; background: #37486B; }
.dot-accent { background: var(--accent); }
.terminal-label { font-family: var(--fm); font-size: 11.5px; color: var(--muted); margin-left: 8px; }
.terminal-body { padding: 18px 18px 22px; font-family: var(--fm); font-size: 13px; line-height: 1.85; min-height: 118px; }
.terminal-line { min-height: 24px; }
.term-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: -2px;
  animation: pcBlink 1.1s step-end infinite;
}

/* ===== Services ===== */
.services { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 80px 32px; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 18px; }
.service-card { padding: 30px 26px 32px; transition: border-color .2s, transform .2s; }
.service-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.card-num { font-family: var(--fm); font-size: 13px; color: rgba(255, 255, 255, 0.22); }
.service-card h3 { font-family: var(--fd); font-weight: 600; font-size: 20px; margin-bottom: 10px; color: var(--ink); }
.service-card p { font-size: 14.5px; line-height: 1.6; color: var(--muted); }

/* ===== Work ===== */
.work { position: relative; z-index: 1; background: var(--surface2); border-top: 1px solid rgba(255, 255, 255, 0.05); border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.work-inner { max-width: 1240px; margin: 0 auto; padding: 80px 32px; }
.link-arrow { font-family: var(--fd); font-weight: 600; font-size: 14.5px; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.link-arrow:hover { border-color: var(--accent); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 22px; }
.project-card { border-radius: 18px; overflow: hidden; transition: border-color .2s, transform .2s; }
.project-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.project-shot { position: relative; height: 220px; background-color: #0E2143; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.project-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--fm);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--accent);
  padding: 5px 11px;
  border-radius: 6px;
}
.project-body { padding: 26px 26px 28px; }
.project-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.project-head h3 { font-family: var(--fd); font-weight: 600; font-size: 22px; color: var(--ink); }
.project-year { font-size: 13px; color: var(--muted); }
.project-body p { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin-bottom: 18px; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; }
.stack span { font-family: var(--fm); font-size: 11.5px; color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px; padding: 4px 10px; }

/* ===== Story ===== */
.story { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 90px 32px; }
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: clamp(36px, 5vw, 64px); align-items: center; }
.story-title { font-size: clamp(32px, 4vw, 48px); line-height: 1.05; margin-bottom: 24px; }
.story-p { font-size: 17px; line-height: 1.68; color: var(--muted); margin-bottom: 18px; }
.story-p:last-child { margin-bottom: 0; }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 16px; }
.value-card { padding: 28px 24px; min-height: 170px; display: flex; flex-direction: column; justify-content: space-between; }
.value-num { font-family: var(--fm); font-size: 13px; color: var(--accent); }
.value-card h3 { font-family: var(--fd); font-weight: 600; font-size: 19px; margin-bottom: 8px; color: var(--ink); }
.value-card p { font-size: 13.5px; line-height: 1.55; color: var(--muted); }

/* ===== Contact ===== */
.contact { position: relative; z-index: 1; background: var(--surface2); border-top: 1px solid rgba(255, 255, 255, 0.05); }
.contact-grid {
  max-width: 1240px;
  margin: 0 auto;
  padding: 88px 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(36px, 5vw, 64px);
  align-items: start;
}
.contact-lede { font-size: 17px; line-height: 1.65; color: var(--muted); margin-bottom: 40px; max-width: 420px; }
.contact-details { display: flex; flex-direction: column; gap: 22px; }
.detail-label { font-family: var(--fm); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.detail-value { font-family: var(--fd); font-size: 19px; color: var(--ink); }
.detail-value.link { text-decoration: none; }
.detail-value.link:hover { color: var(--accent); }

.contact-panel { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 20px; padding: 34px; }
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 14px; }
.contact-form label { display: flex; flex-direction: column; gap: 7px; }
.contact-form label span { font-family: var(--fm); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.contact-form input, .contact-form textarea {
  font-family: var(--fb);
  font-size: 15px;
  color: var(--ink);
  background: #0E2143;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 13px 14px;
  outline: none;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); }

.contact-form[hidden] { display: none; }
.form-error { font-size: 13.5px; color: #e0575c; margin: -6px 0 0; }
.form-error[hidden] { display: none; }
.contact-sent { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 380px; gap: 16px; }
.contact-sent[hidden] { display: none; }
.sent-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
.contact-sent h3 { font-family: var(--fd); font-weight: 700; font-size: 24px; color: var(--ink); }
.contact-sent p { font-size: 15px; color: var(--muted); max-width: 280px; }
