/* Paper, satin enamel and a recessed rim are the three surfaces of SEM. */
:root {
  --edge: #cdb2a5;
  --on-paper: #481333;
  --card-shadow: 0 2px 2px #6733270b, 0 10px 24px -12px #672d3952;
  --rim: inset 0 1px 1px #fffdf5e0, inset 0 -1px 2px #6a233428;
}

body {
  position: relative;
  isolation: isolate;
  background-color: #f8eee4;
  background-image:
    radial-gradient(ellipse at 102% 10%, #f4cab088, transparent 40%),
    radial-gradient(ellipse at 0% 100%, #e6b8bc70, transparent 45%),
    radial-gradient(ellipse at 30% 4%, #fffaf2, transparent 65%);
}
body::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: 0;
  background: url('/media/grain.webp') repeat;
  opacity: .058;
  mix-blend-mode: multiply;
}
.top {
  background: #fff8ef52;
  border-color: #d7bfb188;
  box-shadow: 0 1px 0 #fff8;
}
.top-inner { max-width: 1216px; min-height: 80px; }
.nav-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.profile-link, .my-links, .ghost-button, .project-manage, .edit-project {
  color: var(--cherry);
  text-decoration: none;
  font: 640 .9rem/1.25 var(--sans);
}
.profile-link, .my-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: min(33vw, 220px);
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid #d5bdb0;
  border-radius: 40px;
  background: linear-gradient(155deg, #fff8ee, #f4e5d8);
  box-shadow: var(--rim), 0 2px 4px #4820270a;
}
.profile-link:hover, .my-links:hover, .profile-link[aria-current], .my-links[aria-current] { background: #efdfd1; }
.profile-link span:not(.avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 35px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  color: #fff5ed;
  background: #712442 url('/media/satin-carmin.webp') center / cover;
  box-shadow: var(--rim), 0 2px 5px #48133318;
  font: 600 .8rem/1 var(--wide);
  letter-spacing: -.065em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.home { width: min(1110px, 89vw); margin: clamp(38px, 6vh, 68px) auto 55px; }
.intro { margin-bottom: clamp(24px, 3.2vh, 37px); }
.intro h1 { font-size: clamp(2.8rem, 5.1vw, 4.65rem); }
.intro p { color: #684854; }
.choices { gap: clamp(13px, 2vw, 25px); }
.choice {
  --ink: #fff4e9;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: clamp(260px, 22.4vw, 310px);
  padding: clamp(22px, 2.2vw, 34px);
  overflow: hidden;
  border: 1px solid #752341;
  border-radius: 28px;
  color: var(--ink);
  background: #7b2444 url('/media/satin-carmin.webp') center / 100% 100%;
  box-shadow: inset 1px 1px 1px #ffdfd48a, inset 0 -1px 2px #36103165, var(--card-shadow);
  transition: box-shadow .22s ease, transform .22s ease;
}
.choice.send {
  --ink: #47132f;
  background: #f0bc93 url('/media/satin-abricot.webp') center / 100% 100%;
  border-color: #c79880;
}
.choice .stage {
  position: absolute;
  z-index: -1;
  inset: 0 0 17% auto;
  width: 58%;
  height: auto;
  min-height: 0;
  overflow: visible;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  isolation: auto;
  pointer-events: none;
}
.choice .recess { display: none; }
.choice .stage img {
  position: absolute;
  inset: 0 -18%;
  margin: auto;
  width: 136%;
  height: 105%;
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(5px 12px 6px #370d2c55);
}
.choice .choice-content {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  min-width: 0;
  padding: 0;
}
.choice .phrase { color: var(--ink); font-size: 1rem; font-weight: 600; }
.choice .choice-name {
  margin: 13px 0 24px;
  font-size: clamp(2.9rem, 4.3vw, 4.4rem);
  letter-spacing: -.075em;
}
.receive .choice-name > span { color: #ffbb80; }
.send .choice-name > span { color: #ac2350; }
.choice .choice-action {
  padding-top: 13px;
  font-size: .98rem;
  font-weight: 640;
}
@media (hover: hover) {
  .choice:hover {
    transform: translateY(-3px);
    box-shadow: inset 1px 1px 1px #fff9, 0 11px 28px -12px #66273a78;
  }
  .choice:hover .stage img { transform: translateY(-4px) rotate(-2deg); }
  .choice.send:hover .stage img { transform: translateY(-3px) rotate(2deg); }
}
.choice:active { transform: translateY(1px); }
.landing-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 0;
  padding: 3px 1px;
  color: #61414c;
}
.landing-profile a { color: var(--cherry); font-weight: 650; }
.landing-profile .avatar { width: 32px; }

.work { width: min(740px, 89vw); }
.work:has(.project-grid) { width: min(1110px, 89vw); }
.work h1 { overflow-wrap: anywhere; }
.panel, .profile-card, .project-card {
  color: var(--on-paper);
  border: 1px solid var(--edge);
  border-radius: 23px;
  background: linear-gradient(130deg, #fff9f0, #fbede2);
  box-shadow: var(--rim), var(--card-shadow);
}
.panel { padding: clamp(18px, 2.7vw, 31px); }
.primary, .ghost-button, .project-manage, .edit-project { transition: background-color .18s ease, box-shadow .18s ease; }
.ghost-button, .project-manage, .edit-project {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #ccb2a5;
  border-radius: 10px;
  background: #fff5e9;
  box-shadow: var(--rim);
  cursor: pointer;
}
.ghost-button:hover, .project-manage:hover, .edit-project:hover { background: #f5e4d6; }
.form-row { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.form-row label { flex: 1 1 100%; }
.form-row input { flex: 1 1 150px; min-width: 0; }
.profile-form input:not([type="radio"]):not([type="file"]),
.project-settings input, .form-row input, input.project-name, input.sender-name {
  min-height: 44px;
  padding: 10px 13px;
  color: var(--cherry);
  border: 1px solid #b99a92;
  border-radius: 10px;
  background: #fff7ef;
  box-shadow: inset 1px 2px 4px #804e3912, 0 1px 0 #fffc;
}
.profile-form label, .project-settings label, .form-row label { font-weight: 650; }
.profile-card { position: relative; padding: clamp(22px, 3vw, 36px); }
.profile-card h2 { font-size: 1.25rem; }
.profile-card .avatar, .profile-intro .avatar { width: 66px; font-size: 1.3rem; }
.profile-intro { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.profile-form { display: grid; justify-items: start; gap: 12px; }
.profile-form label, .profile-form input:not([type=radio]) { max-width: 100%; }
.profile-form .form-row { width: 100%; }
.profile-form p { color: var(--soft); }
.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 12px 0; color: #64404f; font-weight: 540; font-size: .92rem;
}
.byline .avatar { width: 28px; font-size: .67rem; }
.project-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  align-items: start; gap: clamp(15px, 2vw, 23px);
}
.project-card { min-width: 0; padding: clamp(17px, 2.2vw, 27px); overflow-wrap: anywhere; }
.project-top, .project-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 9px 12px;
}
.project-top { margin-bottom: 15px; }
.project-kind {
  display: inline-flex; align-items: center; gap: 7px;
  font: 670 .85rem/1.2 var(--sans); color: #6c2745;
}
.project-kind::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  background: #b52d59; box-shadow: inset 0 1px 1px #ffdbcfbb, 0 1px 1px #6f244535;
}
[data-kind="tady"] .project-kind::before { background: #c76c2f; }
.project-title, .work h2.project-title, .work h3.project-title {
  margin: 0 0 12px;
  font: 520 clamp(1.19rem, 2.05vw, 1.55rem)/1.24 var(--wide);
  letter-spacing: -.057em;
}
.project-title a { text-decoration: none; }
.project-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.project-expiry { color: #684954; font-size: .83rem; font-variant-numeric: tabular-nums; }
.project-files {
  list-style: none; margin: 0; padding: 0;
  border-radius: 13px; background: #f1e2d7;
  box-shadow: inset 0 1px 3px #734a3f12, 0 1px 1px #fff8;
}
.project-files:empty { display: none; }
.project-files .file-row { padding: 9px 12px; border: 0; min-height: 55px; }
.project-files .file-row + .file-row { border-top: 1px solid #d7c1b5; }
.project-files .file-mark { width: 30px; height: 36px; background: #fff2e5; }
.project-files .file-name { font-size: .93rem; }
.project-files .file-download { min-height: 44px; padding: 3px; }
.project-bottom { margin-top: 13px; }
.project-settings { margin: 10px 0; }
.project-settings summary { cursor: pointer; font-weight: 640; min-height: 40px; padding: 7px 0; }
.project-settings[open] summary { margin-bottom: 7px; }
.picker {
  background: linear-gradient(125deg, #f9e9dc, #f6dfcd);
  box-shadow: inset 2px 3px 8px #814a2e13, 0 1px 1px #fff8;
}
.picker-icon { background: linear-gradient(145deg, #ffdbb2, #ffbc7a); }
.picker.drag { background: #ffd8ad; }
.transfer-motion {
  display: inline-block; position: relative; overflow: hidden;
  pointer-events: none; width: 44px; height: 34px;
  border-radius: 10px; vertical-align: middle; flex: none;
  background: linear-gradient(140deg,#ffead7,#f4d0c2);
  box-shadow: inset 1px 2px 4px #6c294825, 0 1px 0 #fffa;
}
.transfer-motion::before {
  content: ''; position: absolute; width: 11px; height: 14px;
  top: 6px; left: 9px; border-radius: 2px; 
  background: linear-gradient(#fff7ee 4px,#c88383 4px 5px,#fff7ee 5px 7px,#c88383 7px 8px,#fff7ee 8px);
  box-shadow: 0 1px 2px #6123395c;
  transform-origin: 50% 100%; animation: sem-paper 1.6s cubic-bezier(.52,.08,.39,.94) infinite;
}
.transfer-motion::after {
  content:''; position:absolute; left:25px; bottom:5px;
  width:9px; height:5px; border-radius:50%; background:#a32852;
  box-shadow: inset 0 1px 1px #6c103f; animation: sem-aperture 1.6s ease infinite;
}
@keyframes sem-paper {
  0% { transform: translate(-4px,-4px) rotate(-15deg) scale(.76); opacity:0; }
  16%,40% { transform: translate(0,0) rotate(-10deg) scale(1); opacity:1; }
  79% { transform: translate(15px,7px) rotate(15deg) scale(.3); opacity:1; }
  89%,100% { transform: translate(17px,9px) rotate(18deg) scale(.13); opacity:0; }
}
@keyframes sem-aperture { 0%,40%,100% {transform:scaleX(.85)} 75% {transform:scaleX(1.15)} }
@media(max-width: 850px) {
  .choice { min-height: 230px; }
  .choice .choice-name { font-size: 2.9rem; }
  .choice .stage { inset: 4% -3% 17% auto; width: 56%; }
  .choice .phrase { font-size: .92rem; }
}
@media(max-width: 640px) {
  .top-inner { min-height: 66px; width: calc(100% - 32px); }
  .brand img { width: 84px; }
  .nav-actions { gap: 6px; }
  .profile-link,.my-links { max-width: 36vw; gap: 5px; padding: 6px 10px; font-size: .82rem; min-height: 40px; }
  .profile-link .avatar { width: 23px; font-size: .62rem; }
  .home,.work,.work:has(.project-grid) { width: calc(100% - 32px); margin: 29px auto 38px; }
  .intro { margin-bottom: 20px; }
  .intro h1 { font-size: clamp(2.03rem, 8.65vw, 3.3rem); }
  .choices, .project-grid { grid-template-columns: 1fr; gap: 13px; }
  .choice { grid-template-columns: 1fr; min-height: 171px; padding: 15px 18px; border-radius: 20px; }
  .choice .stage { inset: -1% 0 18% auto; width: 48%; }
  .choice .stage img { inset: -13% -18% 0; height: 111%; }
  .choice .choice-content { padding: 0; }
  .choice .phrase { font-size: .85rem; }
  .choice .choice-name { font-size: clamp(2.55rem, 9.6vw, 3.35rem); margin: 4px 0 12px; }
  .choice .choice-action { font-size: .88rem; padding-top: 8px; }
  .project-grid { margin-top: 4px; }
  .landing-profile { margin-top: 18px; gap: 8px; }
  .profile-card, .panel { padding: 17px; border-radius: 18px; }
}
@media(max-width: 355px) {
  .top-inner { width: calc(100% - 24px); }
  .brand img { width: 72px; }
  .profile-link,.my-links { padding: 6px 8px; }
  .home,.work,.work:has(.project-grid) { width: calc(100% - 26px); }
}
@media(prefers-reduced-motion: reduce) {
  .choice:hover, .choice:hover .stage img { transform: none; }
  .transfer-motion::before, .transfer-motion::after { animation: none; }
}

/* Disclosure panels stay in document flow so a long project name wraps. */
details.edit-project {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 10px 0;
  padding: 0;
  background: #fff5e9;
}
details.edit-project[open] { width: 100%; padding: 0 14px 14px; }
details.edit-project > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  margin: 0;
  overflow-wrap: anywhere;
  list-style: none;
}
details.edit-project > summary::-webkit-details-marker { display: none; }
details.edit-project > summary .ico:last-child { margin-left: auto; width: 15px; }
details.edit-project[open] > summary { padding-left: 0; padding-right: 0; }
details.edit-project[open] > summary .ico:last-child { transform: rotate(180deg); }
.project-files > .hint { padding: 13px 12px; }
.project-files .more { padding: 0 12px 4px; margin-top: 0; }
.project-files .more .file-row { padding-left: 0; padding-right: 0; }
.profile-card .profile-intro {
  margin: -1px -1px 20px;
  padding: 19px;
  color: #fff5ea;
  border-radius: 14px;
  background: #702842 url('/media/satin-carmin.webp') center / cover;
  box-shadow: var(--rim);
}
.profile-card .profile-intro .hint { color: #fff3e7; }
.profile-intro .avatar { color: var(--cherry); background: #ffe4c4; }
.profile-card .landing-profile { margin-top: 0; }
.profile-card .landing-profile > p { width: 100%; max-width: 53ch; }
.profile-card .landing-profile .more { width: 100%; margin: 1px 0 0; }
.profile-card .landing-profile .more[open] { padding-top: 4px; }
.profile-form input { max-width: min(100%, 480px); }

@media(max-width: 640px) {
  .choice .choice-content { justify-content: stretch; }
  .choice .stage { width: 45%; }
}
