/* Page CSS for Cristopher Valera's portfolio: only what the kit (assets/) lacks.
   The generative ground, the scrims that keep text at AA over it, the lens switch, the experience
   timeline, the case studies, the skill rows and the certification block. Every text block starts on
   the .wrap's left line or the page's one split line (column 8, x 841 at 1440). */

/* ------------------------------------------------ the generative ground (js/background.js) */
/* a fixed layer inside the hero: it stays behind every section, which either lets it show through
   (the hero, the statement) or lays a dim scrim over it (the text-heavy sections) */
.signal { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.signal canvas { width: 100% !important; height: 100% !important; }
.scrim { background: rgb(11 15 18 / .86); }

/* ------------------------------------------------ the lens switch: one quiet line above the h1 */
.lens { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-1); margin-bottom: var(--s-5); font-size: var(--t-small); color: var(--muted); }
.lens__label { margin-right: var(--s-2); }
.lens__dot { color: var(--muted); }
.lens__btn {
  min-height: 44px; padding: 0 var(--s-2); border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: var(--t-small); font-weight: 500;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 6px; text-decoration-thickness: 1px;
  transition: color .18s ease, text-decoration-color .18s ease;
}
.lens__btn:hover { color: var(--ink); text-decoration-color: currentColor; }
.lens__btn[aria-pressed="true"] { color: var(--ink); text-decoration-color: var(--accent); }
.lens__short { display: none; }
@media (max-width: 639px) {
  .lens { margin-bottom: var(--s-3); }
  .lens__long { display: none; }
  .lens__short { display: inline; }
  /* the name on one line and the role on the next, at every lens */
  .hero--word h1 { font-size: clamp(28px, 8.6vw, 40px); }
}

/* the role in the h1: the lens's own words, the accent underline under them only */
.role { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .05em; text-underline-offset: .12em; transition: opacity .18s ease; }
.role.is-swapping { opacity: 0; }

/* content swapped by a lens change fades out and in (never under reduced motion) */
[data-slot].is-swapping { opacity: 0; }
[data-slot="summary"], [data-slot="cases-a"], [data-slot="cases-b"], [data-slot="skills"] { transition: opacity .18s ease; }
@media (prefers-reduced-motion: reduce) { [data-slot] { transition: none !important; } }

/* ------------------------------------------------ about: the statement, and the portrait once photo.jpg exists */
#about .t-label { font-family: var(--font-text); letter-spacing: .01em; margin-bottom: var(--s-6); color: var(--muted); }
#about .about--photo { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: var(--gutter); align-content: start; }
#about .about--photo > .t-label { grid-column: 1 / -1; }
#about .about__photo { grid-column: 2; grid-row: 2; aspect-ratio: 4 / 5; }
@media (max-width: 639px) { #about .about--photo { grid-template-columns: 1fr; } #about .about__photo { grid-column: 1; grid-row: auto; margin-top: var(--s-6); max-width: 240px; } }

/* ------------------------------------------------ diagrams on the dark ground */
.dg-box { padding: 0; height: 300px; margin-top: var(--s-8); }
.dg-box--tall { height: auto; min-height: 420px; margin-top: 0; align-self: stretch; }
.dg-box > .dg { position: absolute; inset: 0; }
@media (max-width: 639px) { .dg-box { height: 360px; margin-top: var(--s-7); } }

/* ------------------------------------------------ experience: one role per screen, folded on a phone
   row 1: the heading on the left line, the dates, place and fold switch on the split line;
   row 2: the duties in two columns on the same two lines */
.xp { display: grid; gap: var(--s-8); }
.xp__item { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.xp__head { grid-column: 1 / span 6; font-size: var(--t-h3); line-height: 1.2; }
.xp__side { grid-column: 8 / span 5; display: grid; gap: var(--s-3); }
.xp__meta { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--gutter); }
.xp__meta dt { font-size: var(--t-label); font-weight: 500; color: var(--muted); }
.xp__meta dd { margin: 0; }
.xp__toggle {
  justify-self: start; display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0; border: 0;
  background: none; cursor: pointer; color: var(--ink); font-size: var(--t-small); font-weight: 500;
}
.xp__label { text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 6px; transition: text-decoration-color .2s ease; }
.xp__toggle:hover .xp__label { text-decoration-color: currentColor; }
.xp__chev { flex: none; width: 14px; height: 14px; color: var(--accent); transition: transform .25s ease; }
.xp__item.is-open .xp__chev { transform: rotate(180deg); }
.xp__body { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.2, .7, .2, 1); }
.xp__item.is-open .xp__body { grid-template-rows: 1fr; }
.xp__points { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s .3s; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-4) var(--gutter); }
.xp__points > li:nth-child(odd) { grid-column: 1 / span 6; }
.xp__points > li:nth-child(even) { grid-column: 8 / span 5; }
.xp__item.is-open .xp__points { padding-top: var(--s-5); visibility: visible; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) { .xp__body, .xp__chev { transition: none; } }
@media (max-width: 1023px) {
  .xp__head, .xp__side, .xp__points > li:nth-child(n) { grid-column: 1 / -1; }
  .xp__side { margin-top: var(--s-3); }
  .xp__points { gap: var(--s-3); }
}
@media (max-width: 639px) { .xp { gap: var(--s-7); } }

/* ------------------------------------------------ selected work: the case on the left, the steps on the split line */
.cases { display: grid; gap: var(--s-7); }
.case { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.case__head { grid-column: 1 / span 6; }
.case__sector { color: var(--accent); margin-bottom: var(--s-3); }
.case__title { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--t-h3); line-height: 1.2; letter-spacing: var(--display-tracking); max-width: 22ch; }
.case__steps { grid-column: 8 / span 5; display: grid; gap: var(--s-3); margin: 0; }
.case__steps dt { font-size: var(--t-label); font-weight: 500; color: var(--muted); }
.case__steps dd { margin: 0; }
.case__metrics { grid-column: 8 / span 5; display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-4); font-variant-numeric: tabular-nums; }
@media (max-width: 1023px) {
  .case__head, .case__steps, .case__metrics { grid-column: 1 / -1; }
  .case__steps { margin-top: var(--s-4); }
}
@media (max-width: 639px) {
  .cases { gap: var(--s-6); }
  /* the step's name runs into its sentence, so a case holds about half the height */
  .case__steps > div { display: block; }
  .case__steps dt, .case__steps dd { display: inline; }
  .case__steps dt::after { content: ": "; }
}

/* ------------------------------------------------ skills: one row per group, the lens's key skills in ink */
.skills { align-items: stretch; }
.skill-groups { display: grid; align-content: start; }
.skill-group { padding-block: var(--s-3); border-bottom: 1px solid var(--line); }
.skill-group:first-child { padding-top: 0; }
.skill-group .t-label { font-family: var(--font-text); letter-spacing: .01em; color: var(--ink); margin-bottom: var(--s-1); }
.chips { display: block; color: var(--muted); }
.chip { display: inline; }
.chip + .chip::before { content: ", "; color: var(--muted); }
.chip.is-key { color: var(--ink); font-weight: 500; }
@media (max-width: 1023px) {
  .skill-groups { grid-column: 1 / -1; }
  .skills > .dg-box { grid-column: 1 / -1; min-height: 340px; margin-top: var(--s-6); }
}

/* ------------------------------------------------ certifications and education */
.certs .rows__name small { display: block; font-weight: 400; color: var(--muted); font-size: var(--t-small); margin-top: 2px; }
.edu { display: grid; gap: var(--s-6); align-content: start; }
.edu .t-label { font-family: var(--font-text); letter-spacing: .01em; color: var(--muted); margin-bottom: var(--s-2); }
.edu__name { font-weight: 500; }
.edu__list { display: grid; gap: var(--s-2); }
#certifications .group { align-self: start; }
@media (max-width: 1023px) { #certifications .group, .edu { grid-column: 1 / -1; } .edu { margin-top: var(--s-7); } }
@media (max-width: 639px) { .edu { margin-top: 0; } }

/* ------------------------------------------------ contact */
.contact__line { margin-top: var(--s-3); max-width: 52ch; }
