/* Page CSS: only what sits inside a visual, one --p-h per card group, and the few page parts the kit lacks. */

/* GooDeals: head row over its screenshot across the wrap; the frame links to the code and zooms on hover */
#projects .proj-head { align-items: start; margin-bottom: var(--s-7); }
.proj-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); }
.proj-links .link { display: inline-flex; align-items: center; min-height: 44px; }

.proj-frame { display: block; height: 456px; border-radius: var(--r-lg); overflow: hidden; background: #0d0f12; box-shadow: 0 0 0 1px var(--line); }
.proj-frame .frame__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
@media (max-width: 639px) {
  #projects .proj-head { margin-bottom: var(--s-6); }
  .proj-frame { height: 300px; }
}

/* AvailAPI and Vanish Vault: one panel height for the pair */
#more .panel { --p-h: 300px; }
#more .panel .frame__img { object-fit: cover; object-position: 50% 0; }
#more .ic-chip-row { margin-top: var(--s-4); }
#more .proj-links { margin-top: var(--s-2); }
@media (max-width: 639px) { #more .panel { --p-h: 180px; } }

/* Hero: the facts docked on the photograph's bottom line; below 1024 the hero keeps to one screen without them */
@media (min-width: 1024px) {
  .hero--split .hero__text { align-self: stretch; display: flex; flex-direction: column; }
  .hero--split .hero__text > .hero__facts { margin-top: auto; }
}
@media (max-width: 1023px) { .hero--split .hero__facts { display: none; } }

/* About: the statement, then the education as a list read across, straight under it */
#about .grid { margin-top: var(--s-8); }
.about-edu { list-style: none; margin: 0; padding: 0; }
.about-edu > li > p { color: var(--muted); margin: 0; }
@media (max-width: 639px) { #about .grid { margin-top: var(--s-7); } }

/* Yokogawa: the logo on a white tile as the section's picture */
.exp { align-items: start; }
.exp__logo { width: 100%; height: 380px; border-radius: var(--r-lg); background: #fff; overflow: hidden; }
/* the logo image is the whole tile: it fits inside with a quarter of the width clear on each side */
.exp__logo img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 0 25%; box-sizing: border-box; }
#experience .rows > li { padding-block: var(--s-6); }
#experience .rows > li:first-child { padding-top: 0; }
@media (max-width: 639px) { #experience .rows > li { padding-block: var(--s-4); } }

/* Stack: tool lists beside the hub diagram, then the two certificates */
/* the inner columns share the page gutter, so they sit on page columns 1 and 4 */
.stack-groups { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6) var(--s-5); align-content: start; }
.stack-list { list-style: none; margin: var(--s-3) 0 0; padding: 0; }
.stack-list li { display: flex; align-items: center; gap: var(--s-3); padding: 6px 0; font-size: var(--t-body); }
/* logos sit on a small light tile so dark marks (AWS, Next.js, GitHub) read on the dark ground */
.stack-list .ic { box-sizing: content-box; width: 20px; height: 20px; padding: 4px; object-fit: contain; background: var(--p-ink); border-radius: 6px; }
.stack-panel { --p-h: 368px; --ground-bg: var(--surface); height: var(--p-h); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); }
.certs { margin-top: var(--s-6); }
.card.cert { display: flex; flex-direction: row; justify-content: flex-start; text-align: left; align-items: center; gap: var(--s-5); text-decoration: none; color: inherit; }
.cert .ic { box-sizing: content-box; width: 40px; height: 40px; padding: 8px; object-fit: contain; flex: none; background: var(--p-ink); border-radius: var(--r-md); }
.cert__name { display: block; font-size: var(--t-card); font-weight: 500; }
.cert__link { display: block; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; margin-top: var(--s-1); }
@media (max-width: 1023px) { .stack-panel { --p-h: 340px; } }
@media (max-width: 639px) { .stack-panel { --p-h: 280px; } }

/* the tablet stacks the splits: these sections take two screens there, and on a phone */
@media (min-width: 640px) and (max-width: 1023px) {
  .exp__logo { height: 260px; }
  .stack-panel { --p-h: 260px; }
  .stack-groups { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 639px) {
  #more, #stack, #contact { --hm: 2; }
  .exp__logo { height: 200px; }
  #experience .rows > li { padding-block: var(--s-3); }
  .stack-panel { --p-h: 340px; }
  .stack-groups { grid-template-columns: 1fr; }
  .stack-list li { padding: 2px 0; }
  .ic-chip-row > .ic-chip { flex: 1 1 auto; justify-content: center; }
}

/* on a phone the float card would sit on the face: the portrait shows alone */
@media (max-width: 639px) { .hero__media .ly-float { display: none; } }

/* Buttons: neutral at rest, electric blue only on hover, focus and press (orange stays the site accent) */
:root { --btn-hover: #3d7bff; --btn-hover-ink: #ffffff; }
.btn--primary { background: var(--ink); color: var(--bg); }
html .btn--primary:is(:hover, :focus-visible),
html:not([data-motion="off"]) .btn--primary:is(:hover, :focus-visible) { background: var(--btn-hover); color: var(--btn-hover-ink); }
html .btn--primary:active,
html:not([data-motion="off"]) .btn--primary:active { background: color-mix(in oklab, var(--btn-hover) 86%, #000); color: var(--btn-hover-ink); }
html .btn--secondary:is(:hover, :focus-visible),
html:not([data-motion="off"]) .btn--secondary:is(:hover, :focus-visible) { color: var(--btn-hover); }

/* Nav: GitHub and LinkedIn marks at the right end, each a 44px target; the mark lifts a step on hover */
.nav__social { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: var(--r-sm); color: inherit; }
.nav__social .ic { --ic-s: 22px; transition: transform var(--m-in) var(--ease), opacity var(--m-in) var(--ease); opacity: .85; }
.nav__social:is(:hover, :focus-visible) .ic { opacity: 1; transform: translateY(-1px); }
.nav__actions { gap: var(--s-2); }
.nav__actions > .nav__link { margin-right: var(--s-2); }

/* Email button: a click shows the address on a small card under the button (above it in the phone bar and the
   close), with a copy control and a mail link. The card sits on the surface colour with the kit's hairline. */
.email-pop { position: relative; display: inline-flex; }
.btn--wide .email-pop, .email-pop:has(.btn--wide) { display: flex; width: 100%; }
.email-pop__card { position: absolute; z-index: 30; left: 0; top: calc(100% + var(--s-2)); min-width: 280px;
  display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4) var(--s-5);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 12px 32px rgb(0 0 0 / .35); font-size: var(--t-body); text-align: left; }
.email-pop[data-up] .email-pop__card { top: auto; bottom: calc(100% + var(--s-2)); }
.email-pop__card[hidden] { display: none; }
.email-pop__addr { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; user-select: all; }
.email-pop__copy { align-self: flex-start; font: inherit; font-weight: 500; color: var(--bg); background: var(--ink); border: 0;
  border-radius: 999px; padding: 8px 14px; min-height: 36px; cursor: pointer; }
.email-pop__copy:is(:hover, :focus-visible) { background: var(--btn-hover); color: var(--btn-hover-ink); }
@media (max-width: 639px) {
  .email-pop { display: flex; width: 100%; }
  .email-pop__card { left: 0; right: 0; min-width: 0; }
}

/* Status dots: green for "live", beside the name in the hero and on the AvailAPI card */
:root { --live: #2fd26b; }
.hero__kicker .dot,
.ly-live::before { background: var(--live); box-shadow: 0 0 0 0 color-mix(in oklab, var(--live) 50%, transparent); }

/* Tech stack hub: a calm still. The kit freezes the busiest moment of its pulse (half-lit spokes,
   one node lit); here every spoke is the same hairline and no node is singled out. The soft halo
   under the Spring Boot core stays, a little stronger, so the drawing has a centre. */
.stack-panel .dg { --dg-halo: 0.22; }
.stack-panel .dg .dg-lit { display: none; }
.stack-panel .dg .dg-node.is-hit { border-color: var(--dg-border); box-shadow: var(--dg-shadow); }
.stack-panel .dg .dg-node:is(.dg-node--core, .dg-node--core-pill).is-hit { border-color: transparent; }
.stack-panel .dg .dg-node:is(.dg-node--core, .dg-node--core-pill).is-hit::before { border-color: color-mix(in oklab, var(--dg-ink) 10%, transparent); }

/* Brand mark: an eight-point star turning in 3D, all the time, in an iridescent metal finish (gold, rose,
   purple, blue, teal) whose colours keep shifting. Five stacked layers give it thickness: the two faces bright,
   the three between them darker, so its edge shows as it turns. Hover lifts it a little; reduced motion holds
   it still, face on. */
.mark[data-mark="star"] {
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath stroke='%23000' stroke-width='1.2' stroke-linejoin='round' d='M12 1.1L13.7 7.8L19.7 4.3L16.2 10.3L22.9 12L16.2 13.7L19.7 19.7L13.7 16.2L12 22.9L10.3 16.2L4.3 19.7L7.8 13.7L1.1 12L7.8 10.3L4.3 4.3L10.3 7.8z'/%3E%3C/svg%3E");
  position: relative; background: none; -webkit-mask: none; mask: none;
  transform-style: preserve-3d; animation: star-spin 4s linear infinite;
  transition: scale 400ms cubic-bezier(.34, 1.4, .5, 1);
}
.mark[data-mark="star"] > i {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #f2c94c, #e9a23b, #d9468f, #8e44d6, #3b6fe0, #2bb7c4, #3b6fe0, #8e44d6, #d9468f, #e9a23b, #f2c94c)
    0 0 / 400% 400%;
  filter: brightness(.55); animation: star-flow 5s ease-in-out infinite alternate;
  -webkit-mask: var(--star) center / contain no-repeat; mask: var(--star) center / contain no-repeat;
}
.mark[data-mark="star"] > i:nth-child(1) { transform: translateZ(-1.8px); filter: none; }
.mark[data-mark="star"] > i:nth-child(2) { transform: translateZ(-0.9px); }
.mark[data-mark="star"] > i:nth-child(4) { transform: translateZ(0.9px); }
.mark[data-mark="star"] > i:nth-child(5) { transform: translateZ(1.8px); filter: none; }
@keyframes star-spin {
  from { transform: perspective(90px) rotateX(16deg) rotateY(0deg); }
  to   { transform: perspective(90px) rotateX(16deg) rotateY(360deg); }
}
@keyframes star-flow { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
.nav__logo:is(:hover, :focus-visible) .mark[data-mark="star"] { scale: 1.18; }
@media (prefers-reduced-motion: reduce) { .mark[data-mark="star"], .mark[data-mark="star"] > i { animation: none; transition: none; } }

/* hero project card: three slides on a timer, with dots to pick one */
.ly-float__slide { display: grid; gap: var(--s-1); animation: float-slide 360ms ease both; }
.ly-float__dots { display: flex; gap: 2px; margin-top: var(--s-2); margin-left: -8px; }
.ly-float__dot { position: relative; width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.ly-float__dot::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--line); transition: background 200ms, scale 200ms; }
.ly-float__dot[aria-current="true"]::after { background: var(--ink); scale: 1.3; }
.ly-float__dot:is(:hover, :focus-visible)::after { background: var(--ink); }
.ly-float__dot:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 50%; }
@keyframes float-slide { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .ly-float__slide { animation: none; } }

/* the stack list outgrew one screen: let the section grow with it instead of laying the certificates over the closing */
#stack { height: auto; min-height: 100vh; min-height: 100svh; }

/* stack panel: the stack in orbit around Spring Boot */
.stack-panel { height: auto; min-height: var(--p-h); display: grid; place-items: center; padding: var(--s-5); background: none; border: 0; box-shadow: none; }
.orbit { --size: min(100%, 340px); --item: 44px; position: relative; width: var(--size); aspect-ratio: 1; container-type: inline-size; }
.orbit__core { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--p-ink); box-shadow: 0 0 0 8px color-mix(in oklab, var(--accent) 14%, transparent), 0 0 48px color-mix(in oklab, var(--accent) 30%, transparent); }
.orbit__core .ic { width: 40px; height: 40px; }
.orbit__ring { --r: 50cqw; position: absolute; inset: 50% auto auto 50%; width: calc(var(--r) * 2); height: calc(var(--r) * 2); translate: -50% -50%; border: 1px dashed var(--line); border-radius: 50%; animation: orbit-spin 48s linear infinite; }
.orbit__ring--in { --r: 29cqw; animation-duration: 32s; animation-direction: reverse; }
.orbit__ring--out { --r: 48cqw; }
.orbit__slot { position: absolute; left: 50%; top: 50%; width: var(--item); height: var(--item); margin: calc(var(--item) / -2); transform: rotate(var(--a)) translateX(var(--r)); }
.orbit__tilt { display: block; width: 100%; height: 100%; transform: rotate(calc(var(--a) * -1)); }
.orbit__spin { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 12px; background: var(--p-ink); box-shadow: 0 0 0 1px var(--line); animation: orbit-spin 48s linear infinite reverse; }
.orbit__ring--in .orbit__spin { animation-duration: 32s; animation-direction: normal; }
.orbit__spin .ic { width: 24px; height: 24px; object-fit: contain; }
.orbit:hover :is(.orbit__ring, .orbit__spin) { animation-play-state: paused; }
@keyframes orbit-spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .orbit__ring, .orbit__spin { animation: none; } }
@media (max-width: 639px) { .orbit { --item: 36px; } .orbit__spin .ic { width: 20px; height: 20px; } }
/* the orbit's box: rounded, no outline; the fill stays close to the page so its edge is soft */
.panel.stack-panel {
  position: relative; border: 0; outline: 0; border-radius: 28px;
  background: linear-gradient(155deg, color-mix(in oklab, var(--bg) 88%, #fff) 0%, color-mix(in oklab, var(--bg) 94%, #fff) 50%, var(--bg) 100%);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / .5);
}
.panel.stack-panel::before, .panel.stack-panel::after { content: none; }

.cert-name { display: flex; align-items: center; gap: var(--s-3); }
.cert-name .ic { box-sizing: content-box; width: 20px; height: 20px; padding: 5px; object-fit: contain; flex: none; background: var(--p-ink); border-radius: 8px; }

/* two short rows: size the section to them instead of a full screen */
#certifications { height: auto; min-height: 0; padding-bottom: var(--s-6); }

/* hero card: the project name links to its code */
.ly-float__name { color: var(--ink); font-size: var(--t-label); font-weight: 500; text-decoration: none; }
.ly-float__name:is(:hover, :focus-visible) { text-decoration: underline; text-underline-offset: 3px; }
