/* Projects, About and Contact: ordinary scrolling pages, in the approved design. */

/* ---------- Projects: closed cards in a carousel, and a short stacked list for work ---------- */

/* ---------- Shared card parts ---------- */
.card-head { display: grid; align-items: center; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: 12px; }
.card-head:focus-visible { outline-offset: 4px; border-radius: 12px; }
.num { color: var(--dim); }
.name { font-size: 19px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.line { color: var(--muted); font-size: 13.5px; }
.status { font: 400 11px/1.4 var(--mono); color: var(--dim); }
.plus { position: relative; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; justify-self: end;
  transition: transform 0.3s var(--spring), border-color 0.18s, background-color 0.18s; }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.5px; background: var(--fg); border-radius: 1px; transform: translate(-50%, -50%); }
.plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.card-head:hover .plus { border-color: var(--line-2); background: rgb(255 255 255 / 0.04); }
.open .plus { transform: rotate(45deg); border-color: var(--muted); background: var(--ink-3); }
.more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.32s var(--ease); }
.open .more { grid-template-rows: 1fr; }
.more-inner { overflow: hidden; min-height: 0; }
.more-inner > p { padding-top: 12px; color: var(--muted); font-size: 14px; max-width: 46ch; opacity: 0; transform: translateY(-4px); transition: opacity 0.22s 0.05s, transform 0.3s var(--ease) 0.05s; }
.open .more-inner > p { opacity: 1; transform: none; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 0 2px; }
.textlink { padding: 0; border: 0; background: none; color: var(--fg); font-size: 13.5px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.no-demo { padding: 12px 0 2px; font: 400 11.5px/1.4 var(--mono); color: var(--dim); }

/* ---------- A: carousel ---------- */
.carousel { --edge: max(var(--gutter), calc((100vw - 1080px) / 2)); margin: 40px calc(50% - 50vw) 0; }
.carousel-bar { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; padding: 0 var(--edge); }
.pos { min-width: 7ch; }
.dots { display: flex; gap: 6px; flex: 1; }
.dot-btn { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.dot-btn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: width 0.25s var(--ease), background-color 0.2s; }
.dot-btn[aria-current="true"]::before { width: 18px; border-radius: 3px; background: var(--fg); }
.arrows { display: flex; gap: 8px; }
.track { display: flex; align-items: flex-start; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 4px 30vw 18px var(--edge); scroll-padding-left: var(--edge); outline: none; } /* right padding is fitted in JS */
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { outline: 2px solid var(--line-2); outline-offset: -2px; border-radius: 18px; }
.card { flex: 0 0 300px; scroll-snap-align: start; display: grid; align-content: start; gap: 12px; padding: 16px 18px 18px;
  border: 1px solid var(--line); border-radius: 20px; background: rgb(25 28 32 / 0.78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: border-color 0.25s, transform 0.3s var(--ease), opacity 0.3s; }
.card:not(.current) { opacity: 0.72; }
.card.current { border-color: var(--line-2); }
.card:hover { opacity: 1; transform: translateY(-2px); }
.art { margin: 0; height: 96px; display: grid; place-items: center; border-radius: 12px; background: rgb(255 255 255 / 0.025);
  font: 400 12.5px/1.35 var(--mono); color: var(--muted); white-space: pre; }
.card.open .art { color: var(--fg); }
.card .card-head { grid-template-columns: auto 1fr auto; column-gap: 12px; }
.card .titles { display: grid; gap: 2px; }

/* ---------- B: stacked list ---------- */
.stack { margin-top: 40px; border-top: 1px solid var(--line); }
.row-card { border-bottom: 1px solid var(--line); }
.row-card .card-head { grid-template-columns: 3ch minmax(10ch, 14rem) 1fr auto 30px; column-gap: 20px; padding: 18px 2px; }
.row-card .more-inner { padding-left: calc(3ch + 20px); }
.row-card .more-inner > p { padding-top: 0; }
.row-card .card-actions, .row-card .no-demo { padding-bottom: 20px; }
.row-card:hover .name { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 5px; }
.row-card.open { background: linear-gradient(90deg, rgb(255 255 255 / 0.025), transparent 70%); }

@media (max-width: 720px) {
  .card { flex-basis: min(82vw, 320px); }
  .carousel-bar { gap: 10px; }
  .dots { gap: 0; }
  .dot-btn { width: 18px; }
  .row-card .card-head { grid-template-columns: 3ch 1fr 30px; row-gap: 3px; }
  .row-card .line, .row-card .status { grid-column: 2; }
  .row-card .plus { grid-column: 3; grid-row: 1 / span 3; }
  .row-card .more-inner { padding-left: calc(3ch + 20px); }
}


/* Card details: short lines, real links. */
.more-inner .lines { display: grid; gap: 6px; padding-top: 12px; max-width: 46ch; }
.more-inner .lines p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.more-inner .fact { padding-top: 10px; font: 400 11.5px/1.5 var(--mono); color: var(--dim); }
.card-actions .textlink { font-size: 13px; }
.domain { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.domain small { color: var(--dim); font-size: 11px; }
.section-title { margin-top: 64px; font-size: 13px; font-weight: 500; letter-spacing: 0.04em; color: var(--muted); }
.work { margin-top: 14px; }

/* ---------- About ---------- */
.about { display: grid; gap: 36px; margin-top: 40px; align-items: start; }
@media (min-width: 760px) { .about { grid-template-columns: 260px 1fr; gap: 56px; } }
.portrait { margin: 0; width: min(260px, 64vw); aspect-ratio: 4 / 5; overflow: hidden; border-radius: 22px; border: 1px solid var(--line); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 48% 64%; display: block; } /* him, the cliffs and a strip of sky */
.lines { display: grid; gap: 14px; max-width: 42ch; font-size: 17px; color: var(--muted); }
.lines strong { color: var(--fg); font-weight: 500; }
.edu { margin: 28px 0 0; padding: 0; list-style: none; max-width: 520px; }
.edu li { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.edu li span:first-child { color: var(--fg); }
.edu li span:nth-child(2) { grid-column: 1; color: var(--muted); }
.edu li span:nth-of-type(3) { grid-column: 2; grid-row: 1; font: 400 12px/1.6 var(--mono); color: var(--dim); }
.acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* ---------- Contact ---------- */
.mail { display: inline-block; margin-top: 30px; font-size: clamp(26px, 5.4vw, 46px); font-weight: 500; letter-spacing: -0.03em; text-decoration: none;
  background: linear-gradient(var(--fg), var(--fg)) 0 100% / 0 1px no-repeat; transition: background-size 0.4s var(--ease); overflow-wrap: anywhere; }
.mail:hover, .mail:focus-visible { background-size: 100% 1px; }
.small { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 30px; }

/* The detail lines fade in with the card, like a single paragraph would. */
.more-inner .lines { opacity: 0; transform: translateY(-4px); transition: opacity 0.22s 0.05s, transform 0.3s var(--ease) 0.05s; }
.open .more-inner .lines { opacity: 1; transform: none; }
.row-card .more-inner .lines { padding-top: 0; }
.work .more-inner .lines:last-child { padding-bottom: 20px; }

/* Without JavaScript every card simply shows its details and the carousel is a scrolling row. */
html:not(.cards-ready) .more { grid-template-rows: 1fr; }
html:not(.cards-ready) .more-inner .lines { opacity: 1; transform: none; }
html:not(.cards-ready) .carousel-bar, html:not(.cards-ready) .plus { display: none; }

/* About: Education with a short line for each. */
.edu-title { margin-top: 30px; font-size: 13px; font-weight: 500; letter-spacing: 0.04em; color: var(--muted); }
.edu { margin-top: 10px !important; }
.edu li p { grid-column: 1 / -1; margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
