:root {
  --ink: #0a0a0a;
  --ink-soft: #444;
  --rule: #d8d8d8;
  --rule-soft: #ececec;
  --blue: #3B6FF5;
  --blue-deep: #1E3A8A;
  --bg: #F3F3F1;
  --status-open: #2bb673;
  --status-closed: #b0b0b0;
  --hover-tone: #E4E4DF;
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }

.stage {
  position: relative;
  min-height: 100vh;
  width: 100vw;
  padding: 48px 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "top   top"
    "hero  hero"
    "projects huy";
  gap: 32px;
  background: var(--bg);
}

/* faded vertical guides — decorative background grid */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
  background-image:
    linear-gradient(to right, transparent calc(25% - 0.4px), rgba(10, 10, 10, 0.12) calc(25% - 0.4px), rgba(10, 10, 10, 0.12) calc(25% + 0.4px), transparent calc(25% + 0.4px)),
    linear-gradient(to right, transparent calc(50% - 0.4px), rgba(10, 10, 10, 0.12) calc(50% - 0.4px), rgba(10, 10, 10, 0.12) calc(50% + 0.4px), transparent calc(50% + 0.4px)),
    linear-gradient(to right, transparent calc(75% - 0.4px), rgba(10, 10, 10, 0.12) calc(75% - 0.4px), rgba(10, 10, 10, 0.12) calc(75% + 0.4px), transparent calc(75% + 0.4px));
}

/* shorter laptops (e.g. MacBook Pro 13"/14" at 100%) — tighten so it still fits in one screen */
@media (max-height: 900px) {
  .stage { padding: 36px 56px; gap: 24px; }
  .hero h1.heading { font-size: clamp(36px, 4.6vw, 58px); margin-bottom: 24px; }
  .hero .body { font-size: 17px; margin-bottom: 24px; }
  .logo-img { height: 36px; }
  .huy-card { width: 200px; }
}

/* very short viewports — tighten more, allow scroll if still needed */
@media (max-height: 760px) {
  .stage { padding: 28px 48px; gap: 20px; }
  .hero h1.heading { font-size: clamp(32px, 4vw, 48px); margin-bottom: 18px; }
  .hero .body { font-size: 16px; margin-bottom: 20px; }
  .logo-img { height: 32px; }
  .huy-card { width: 180px; }
  .projects-title { font-size: 16px; padding-bottom: 10px; }
  .project { padding: 10px 12px; font-size: 16px; }
}

/* ---------- header ---------- */
.top {
  grid-area: top;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* clock centered in the header */
#clock-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
}
.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.spot-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.spot-bolt {
  width: 14px;
  height: 14px;
  color: #fff;
  flex: 0 0 14px;
}
.clock-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink);
  opacity: 0.85;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-closed);
  display: inline-block;
  position: relative;
  transition: background-color 0.3s var(--ease);
}
.status-dot.is-open {
  background: var(--status-open);
  animation: dot-beep 1.6s ease-out infinite;
}
/* expanding ring while open */
.status-dot.is-open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--status-open);
  animation: dot-ring 1.6s ease-out infinite;
  z-index: -1;
}
@keyframes dot-beep {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43, 182, 115, 0.45); }
  50%      { box-shadow: 0 0 0 5px rgba(43, 182, 115, 0); }
}
@keyframes dot-ring {
  0%   { transform: scale(1);   opacity: 0.55; }
  100% { transform: scale(2.6); opacity: 0;    }
}
@media (prefers-reduced-motion: reduce) {
  .status-dot.is-open { animation: none; }
  .status-dot.is-open::after { animation: none; opacity: 0; }
}
.status-text { font-weight: 500; }
.clock-sep { opacity: 0.4; }
.clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-weight: 500;
}

/* ---------- hero ---------- */
.hero {
  grid-area: hero;
  align-self: start;
  max-width: 820px;
  position: relative;
  z-index: 2;
}

.hero h1.heading {
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin-bottom: 32px;
}

/* rotating word */
.rotator {
  display: inline-block;
  position: relative;
  color: var(--blue);
  vertical-align: baseline;
}
.rotator-word {
  display: inline-block;
  transition: opacity 0.16s var(--ease), transform 0.22s var(--ease);
}
.rotator-word.swap-out {
  opacity: 0;
  transform: translateY(-6px);
}
.rotator-word.swap-in {
  opacity: 0;
  transform: translateY(6px);
}

.hero .body {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  opacity: 0.8;
  max-width: 100%;
  margin-bottom: 32px;
}

/* ---------- Send Inquiry button ---------- */
.inquiry-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.inquiry-or {
  font-size: 15px;
  color: var(--ink);
  opacity: 0.7;
}
.inquiry-or a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: opacity 0.2s var(--ease);
}
.inquiry-or a:hover { opacity: 0.6; }

.inquiry-btn {
  --icon-w: 38px;
  --gap: 14px;
  --label-w: 120px;
  display: inline-flex;
  align-items: center;
  gap: var(--gap);
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  padding: 8px 28px 8px 8px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: background-color 0.4s var(--ease), box-shadow 0.35s var(--ease);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.inquiry-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-w);
  height: var(--icon-w);
  border-radius: 50%;
  background: #fff;
  color: #0a0a0a;
  transition: transform 0.45s var(--ease);
  flex: 0 0 var(--icon-w);
}
.inquiry-icon svg { width: 18px; height: 18px; }

.inquiry-label {
  display: inline-block;
  transition: transform 0.45s var(--ease);
}

/* swap places: icon moves right past the label, label slides left into icon's spot
   (-32px keeps a 20px breathing room from the left edge after the swap) */
.inquiry-btn:hover .inquiry-icon {
  transform: translateX(calc(var(--label-w) + var(--gap)));
}
.inquiry-btn:hover .inquiry-label {
  transform: translateX(-32px);
}
.inquiry-btn:active .inquiry-icon,
.inquiry-btn:active .inquiry-label {
  transition-duration: 0.3s;
}

/* ---------- projects ---------- */
.projects {
  grid-area: projects;
  align-self: end;
  width: 100%;
  max-width: 720px;
  position: relative;
  z-index: 2;
}

.projects-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 0;
}

.project-list { list-style: none; }
.project-list li { border-bottom: 1px solid var(--rule); }

.project {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 14px 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 17px;
  transition: background-color 0.18s ease, transform 0.18s ease, padding-left 0.18s ease;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
}
.project-name, .project-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project:hover {
  background-color: var(--hover-tone);
  padding-left: 18px;
}

.project:active {
  background-color: #D8D8D2;
}

.project-name { font-weight: 500; }
.project-desc { color: var(--ink-soft); }

/* ---------- Huy card ---------- */
.huy-card {
  grid-area: huy;
  justify-self: end;
  align-self: end;
  width: 220px;
  background: #0d0d0d;
  border-radius: 6px;
  padding: 10px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.huy-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 10 / 11;
  overflow: hidden;
  border-radius: 3px;
  background: #2a2520;
}
.huy-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.huy-linkedin {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: #0a66c2;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
  backdrop-filter: blur(4px);
}
.huy-linkedin:hover {
  background: #0a66c2;
  color: #fff;
}
.huy-linkedin svg { width: 14px; height: 14px; display: block; }

.huy-text { padding: 0 4px 4px; color: #fff; }
.huy-text p {
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 10px;
}

.huy-cta {
  --swap-label: 62px;   /* how far the label slides right on hover */
  --swap-icon: -154px;  /* how far the arrow slides left on hover */
  position: relative;
  display: block;
  height: 34px;
  background: #fff;
  color: #0d0d0d;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.3s var(--ease);
}
.huy-cta:hover  { background: #f0f0f0; }
.huy-cta:active { background: #e7e7e7; }

.huy-cta-label {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translate(0, -50%);
  transition: transform 0.5s var(--ease);
  white-space: nowrap;
}

.huy-cta .arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 18px;
  height: 18px;
  background: #0d0d0d;
  color: #fff;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(0, -50%);
  transition: transform 0.5s var(--ease);
}
.huy-cta .arrow svg { width: 10px; height: 10px; }

/* swap on hover — label slides toward the right side, arrow slides to the left */
.huy-cta:hover .huy-cta-label {
  transform: translate(var(--swap-label), -50%);
}
.huy-cta:hover .arrow {
  transform: translate(var(--swap-icon), -50%);
}

/* ---------- mobile fallback ---------- */
@media (max-width: 768px) {
  .stage {
    padding: 24px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "hero"
      "projects"
      "huy";
    gap: 40px;
  }
  .hero h1.heading { font-size: 40px; margin-bottom: 32px; }
  .huy-card { justify-self: stretch; width: 100%; }
  .logo-img { height: 32px; }

  /* hide decorative grid on narrow screens — too cramped */
  .stage::before { display: none; }

  /* stack nav vertically on mobile: logo on top, clock, spot pill */
  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  #clock-center {
    position: static;
    transform: none;
  }
  .spot-pill {
    align-self: flex-start;
  }

  /* tighten body copy on mobile */
  .hero .body {
    font-size: 15px;
    margin-bottom: 24px;
  }
  .inquiry-or { font-size: 13px; }

  /* projects: stack name above description, allow wrap, shrink type */
  .projects-title {
    font-size: 14px;
    padding-bottom: 10px;
  }
  .project {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 10px;
    font-size: 14px;
    white-space: normal;
  }
  .project-name {
    font-size: 15px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .project-desc {
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  /* on mobile we don't need the slide-right effect — it pushes content off-screen */
  .project:hover { padding-left: 10px; }
}
