/* Career page — builds on /assets/css/style.css and /assets/css/subpage.css */

/* colour per entry type, shared by the chart, legend and cards */
[data-type="work"] { --type: var(--sumi); }
[data-type="side"] { --type: var(--shu); }
[data-type="school"] { --type: var(--ai); }
[data-type="study"] { --type: var(--usuzumi); }

/* ---------- summary (overlaps the wave band, like the works finder) ---------- */

.career-summary-wrap {
  padding-top: 0;
  padding-bottom: 0;
}

.career-summary {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: calc(-1 * clamp(64px, 8vw, 104px));
  background: var(--washi-card);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -32px rgba(30, 27, 24, 0.45);
}

.career-summary::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 44px;
  height: 3px;
  background: var(--shu);
}

.career-summary > div {
  padding: clamp(20px, 2.6vw, 30px) clamp(18px, 2.4vw, 28px);
}

.career-summary > div + div {
  border-left: 1px solid var(--line);
}

.career-summary dt {
  font-family: var(--f-mincho);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--usuzumi);
  margin-bottom: 6px;
}

.career-summary dd {
  font-family: var(--f-mincho);
  font-weight: 800;
  font-size: clamp(16px, 1.7vw, 19px);
  letter-spacing: 0.08em;
  line-height: 1.5;
}

/* the full address is longer than the other values */
.career-summary .career-summary-address {
  font-size: clamp(14px, 1.4vw, 16px);
  word-break: keep-all;
}

.career-summary strong {
  font-family: var(--f-latin);
  font-weight: 500;
  font-size: 2em;
  line-height: 1;
  color: var(--shu);
  margin-right: 4px;
}

/* ---------- sub headings ---------- */

.sub-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: clamp(28px, 4vw, 44px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
}

.sub-head h2 {
  font-family: var(--f-mincho);
  font-weight: 800;
  font-size: clamp(21px, 2.4vw, 26px);
  letter-spacing: 0.14em;
  position: relative;
  padding-left: 18px;
}

.sub-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  bottom: 0.3em;
  width: 4px;
  background: var(--shu);
}

.sub-head p {
  font-size: 13px;
  color: var(--usuzumi);
  letter-spacing: 0.08em;
}

/* ---------- span chart ---------- */

.career-overview {
  padding-bottom: 0;
}

.span-chart {
  --label: 19em;
  display: grid;
  gap: 10px;
}

.span-row,
.span-axis {
  display: grid;
  grid-template-columns: var(--label) 1fr;
  align-items: center;
  gap: 20px;
}

.span-label {
  font-family: var(--f-mincho);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: var(--sumi-soft);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.span-track {
  position: relative;
  height: 22px;
  /* faint year grid */
  background:
    linear-gradient(var(--line), var(--line)) left center / 100% 1px no-repeat;
}

.span-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  min-width: 6px;
  background: var(--type);
  cursor: pointer;
  transition: filter .3s, transform .3s var(--ease);
  transform-origin: left center;
}

.span-chart.reveal .span-bar {
  transform: scaleX(0);
  transition: transform 1.2s var(--ease), filter .3s;
}

.span-chart.reveal.is-visible .span-bar {
  transform: none;
}

.span-bar:hover {
  filter: brightness(1.25);
}

/* still going: the bar fades out at today's edge */
.span-bar.is-ongoing {
  background: linear-gradient(to right, var(--type) 60%, color-mix(in srgb, var(--type) 35%, transparent));
}

.span-axis .span-track {
  height: 26px;
  background: none;
  border-bottom: 1px solid var(--line-strong);
}

.span-tick {
  position: absolute;
  bottom: 4px;
  transform: translateX(-50%);
  font-family: var(--f-latin);
  font-style: italic;
  font-size: 14px;
  color: var(--usuzumi);
}

.span-tick::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 1px;
  height: 5px;
  background: var(--line-strong);
}

.span-today {
  position: absolute;
  bottom: -4px;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--shu);
}

.type-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--sumi-soft);
}

.type-legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.type-dot {
  width: 18px;
  height: 8px;
  background: var(--type);
}

/* ---------- detailed timeline ---------- */

.career-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.career-item {
  position: relative;
  display: grid;
  grid-template-columns: 11em 1fr;
  gap: 0 clamp(36px, 5vw, 64px);
  padding-bottom: clamp(28px, 4vw, 40px);
}

/* vertical line + seal dot between the date column and the card */
.career-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(11em + clamp(36px, 5vw, 64px) / 2);
  width: 1px;
  background: var(--line-strong);
}

.career-item:last-child::before {
  bottom: auto;
  height: 28px;
}

.career-item::after {
  content: "";
  position: absolute;
  top: 18px;
  left: calc(11em + clamp(36px, 5vw, 64px) / 2 - 6px);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--washi);
  border: 2px solid var(--type);
}

.career-item:first-child::after {
  background: var(--type);
}

.career-when {
  text-align: right;
  padding-top: 4px;
}

.career-year {
  display: block;
  font-family: var(--f-latin);
  font-style: italic;
  font-size: clamp(38px, 4vw, 48px);
  line-height: 1;
  color: var(--sumi);
  margin-bottom: 10px;
}

.career-range {
  font-family: var(--f-mincho);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--shu);
  line-height: 1.6;
}

.career-duration {
  font-size: 13px;
  color: var(--usuzumi);
  letter-spacing: 0.08em;
}

.career-now {
  display: inline-block;
  margin-right: 8px;
  padding: 0 7px;
  background: var(--shu);
  color: var(--washi);
  font-size: 11px;
  letter-spacing: 0.1em;
  vertical-align: 1px;
}

.career-card {
  position: relative;
  padding: clamp(22px, 2.8vw, 32px);
  background: var(--washi-card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--type);
  transition: box-shadow .4s var(--ease), transform .4s var(--ease);
}

.career-item:hover .career-card {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px -28px rgba(30, 27, 24, 0.5);
}

.career-type {
  display: inline-block;
  margin-bottom: 12px;
  padding: 1px 10px;
  border: 1px solid var(--type);
  color: var(--type);
  font-family: var(--f-mincho);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
}

.career-card h3 {
  font-family: var(--f-mincho);
  font-weight: 800;
  font-size: clamp(18px, 2vw, 21px);
  letter-spacing: 0.08em;
  line-height: 1.55;
  margin-bottom: 10px;
}

.career-card > p {
  font-size: 14px;
  color: var(--sumi-soft);
  margin-bottom: 16px;
}

.career-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.career-tech li {
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.7;
  color: var(--sumi-soft);
  border: 1px solid var(--line);
  padding: 0 10px;
}

.career-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-family: var(--f-mincho);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.1em;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line-strong);
  transition: color .3s, border-color .3s;
}

.career-link i {
  font-size: 0.8em;
  transition: transform .4s var(--ease);
}

.career-link:hover {
  color: var(--shu);
  border-color: var(--shu);
}

.career-link:hover i {
  transform: translateX(4px);
}

/* highlight after jumping from the chart */
.career-item.is-flash .career-card {
  animation: career-flash 1.6s var(--ease);
}

@keyframes career-flash {
  0%,
  30% {
    box-shadow: 0 0 0 3px rgba(183, 40, 46, 0.35);
  }
}

.career-detail {
  padding-bottom: clamp(40px, 6vw, 72px);
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .career-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .career-summary > div:nth-child(3) {
    border-left: 0;
  }

  .career-summary > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .span-chart {
    --label: 13em;
  }
}

@media (max-width: 640px) {
  /* chart: label above each bar */
  .span-row,
  .span-axis {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .span-axis .span-label {
    display: none;
  }

  .span-label {
    text-align: left;
    font-size: 12px;
  }

  .span-tick {
    font-size: 12px;
  }

  /* timeline: line on the left, date above the card */
  .career-item {
    grid-template-columns: 1fr;
    padding-left: 28px;
  }

  .career-item::before {
    left: 6px;
  }

  .career-item::after {
    left: 0;
    top: 10px;
  }

  .career-when {
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    margin-bottom: 14px;
    padding-top: 0;
  }

  .career-year {
    font-size: 34px;
    margin-bottom: 0;
  }

  .career-duration {
    width: 100%;
  }
}
