:root {
  color-scheme: dark;
  --bg-top: #0d1d1f;
  --bg-mid: #31413b;
  --bg-bottom: #d6c2a7;
  --ink: #f8f3ea;
  --muted: rgba(248, 243, 234, 0.72);
  --phone-edge: #050706;
  --phone-line: rgba(255, 255, 255, 0.18);
  --screen: #eaf6fb;
  --screen-soft: rgba(255, 255, 255, 0.64);
  --card: rgba(255, 255, 255, 0.92);
  --card-border: rgba(255, 255, 255, 0.58);
  --text: #151918;
  --text-muted: #64706d;
  --shadow: 0 22px 70px rgba(3, 7, 6, 0.32);
  --radius-phone: 48px;
  --ease: cubic-bezier(.2, .9, .2, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #142422;
}

body {
  min-height: 100svh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 52% 24%, rgba(255, 255, 255, 0.16) 0 3%, transparent 14%),
    radial-gradient(circle at 38% 27%, rgba(182, 217, 209, 0.3), transparent 22%),
    linear-gradient(180deg, rgba(9, 27, 29, 0.92) 0%, rgba(33, 45, 39, 0.7) 45%, rgba(85, 70, 54, 0.58) 100%),
    linear-gradient(160deg, #213a3d 0%, #6ca8a4 35%, #d8c5aa 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto -10vw -18vh -10vw;
  height: 42vh;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0 18%, rgba(255, 255, 255, 0.16) 19% 20%, transparent 21% 39%, rgba(255, 255, 255, 0.12) 40% 41%, transparent 42% 100%),
    linear-gradient(0deg, rgba(255, 246, 230, 0.35), rgba(255, 246, 230, 0));
  transform: rotate(-5deg);
  filter: blur(0.2px);
  opacity: .55;
}

body::after {
  inset: 0;
  height: auto;
  background: radial-gradient(circle at 50% -15%, rgba(255, 255, 255, 0.24), transparent 34%);
  opacity: .8;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 16px;
}

.profile {
  text-align: center;
  padding-top: clamp(4px, 2svh, 22px);
}

.profile__photo {
  display: block;
  width: clamp(72px, 19vw, 94px);
  height: clamp(72px, 19vw, 94px);
  margin: 0 auto 10px;
  object-fit: cover;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
}

h1 {
  margin: 0;
  font-family: "Segoe Script", "Brush Script MT", "Snell Roundhand", cursive;
  font-size: clamp(2.55rem, 11vw, 4.1rem);
  line-height: .88;
  font-weight: 700;
  letter-spacing: -0.05em;
  text-shadow: 0 0 18px rgba(137, 140, 255, 0.52), 0 4px 18px rgba(0, 0, 0, 0.35);
}

.role {
  margin: 10px 0 0;
  font-size: .98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 14px rgba(0,0,0,.32);
}

.hint {
  margin: 3px 0 0;
  font-size: .82rem;
  font-style: italic;
  color: var(--muted);
}

.iphone {
  position: relative;
  width: min(100%, 336px);
  min-height: 538px;
  align-self: start;
  margin-top: 2px;
  border-radius: var(--radius-phone);
  background: linear-gradient(135deg, #222826, #050605 52%, #38403d);
  padding: 9px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.18), inset 0 0 0 3px rgba(255,255,255,.05);
}

.iphone::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: calc(var(--radius-phone) - 5px);
  border: 1px solid rgba(255, 255, 255, .16);
  pointer-events: none;
}

.side-button {
  position: absolute;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(#202625, #070908);
  opacity: .9;
}

.side-button--left {
  left: -3px;
  top: 118px;
  height: 68px;
}

.side-button--right {
  right: -3px;
  top: 165px;
  height: 86px;
}

.screen {
  position: relative;
  min-height: 520px;
  height: min(64svh, 660px);
  max-height: 690px;
  overflow: hidden;
  border-radius: calc(var(--radius-phone) - 9px);
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, .9), transparent 8%),
    radial-gradient(circle at 77% 36%, rgba(205, 229, 241, .9), transparent 16%),
    linear-gradient(180deg, rgba(235, 250, 255, .94) 0 55%, rgba(239, 218, 197, .96) 56% 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, transparent 0 55%, rgba(255,255,255,.28) 56%, transparent 57%),
    linear-gradient(111deg, transparent 0 29%, rgba(255,255,255,.5) 30% 31%, transparent 32% 47%, rgba(255,255,255,.34) 48% 49%, transparent 50% 100%);
  opacity: .58;
  pointer-events: none;
}

.screen::after {
  content: "";
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: -13%;
  height: 40%;
  background:
    linear-gradient(90deg, rgba(137, 118, 97, .23) 1px, transparent 1px) 0 0 / 35px 100%,
    linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(205, 186, 158, .2));
  transform: rotate(-5deg);
  pointer-events: none;
}

.dynamic-island {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 76px;
  height: 25px;
  border-radius: 999px;
  background: #050606;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

.dynamic-island span {
  position: absolute;
  right: 12px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #617b8e, #111 70%);
  opacity: .75;
}

.screen-content {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 66px 22px 34px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.screen-content::-webkit-scrollbar {
  width: 0;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 16px;
  align-items: start;
}

.app {
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  display: grid;
  justify-items: center;
  gap: 7px;
  cursor: pointer;
  touch-action: manipulation;
  isolation: isolate;
}

.app__icon-wrap {
  width: clamp(58px, 18vw, 68px);
  height: clamp(58px, 18vw, 68px);
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.23);
  box-shadow: 0 9px 24px rgba(24, 42, 45, .16);
  transition: transform .22s var(--ease), filter .22s var(--ease), box-shadow .22s var(--ease);
}

.app__icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 19px;
}

.app__label {
  width: 100%;
  min-height: 2.1em;
  padding-inline: 1px;
  font-size: .72rem;
  line-height: 1.05;
  font-weight: 750;
  color: rgba(12, 18, 18, .88);
  text-shadow: 0 1px 9px rgba(255, 255, 255, .82);
  overflow-wrap: anywhere;
}

.app:is(:hover, :focus-visible) .app__icon-wrap {
  transform: translateY(-4px) scale(1.04);
  filter: saturate(1.06);
  box-shadow: 0 13px 28px rgba(24, 42, 45, .2);
}

.app:focus-visible,
.detail-card__link:focus-visible,
.detail-card__close:focus-visible,
.footer a:focus-visible {
  outline: 3px solid rgba(20, 116, 255, .44);
  outline-offset: 5px;
}

.app.is-active .app__icon-wrap {
  transform: translateY(-3px) scale(1.07);
  box-shadow: 0 0 0 3px rgba(255,255,255,.72), 0 16px 30px rgba(24, 42, 45, .25);
}

.detail-card {
  grid-column: 1 / -1;
  min-width: 0;
  border: 1px solid var(--card-border);
  border-radius: 26px;
  background: var(--card);
  color: var(--text);
  padding: 16px;
  box-shadow: 0 18px 42px rgba(37, 47, 46, .2);
  transform-origin: top center;
  animation: reveal .28s var(--ease) both;
  will-change: transform, opacity;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.detail-card__header {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
}

.detail-card__icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

.detail-card h2 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.08;
  letter-spacing: -.02em;
}

.detail-card__tag {
  margin: 3px 0 0;
  font-size: .79rem;
  color: var(--text-muted);
  font-weight: 750;
}

.detail-card__description {
  margin: 13px 0 15px;
  font-size: .91rem;
  line-height: 1.42;
  color: #26302e;
}

.detail-card__actions {
  display: flex;
  gap: 9px;
}

.detail-card__link,
.detail-card__close {
  min-height: 42px;
  border-radius: 999px;
  border: 0;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .84rem;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.detail-card__link {
  flex: 1;
  color: white;
  background: #151918;
  box-shadow: 0 9px 20px rgba(21, 25, 24, .18);
}

.detail-card__close {
  color: #1e2625;
  background: rgba(21, 25, 24, .09);
}

.footer {
  padding: 0 0 4px;
  opacity: .78;
}

.footer a {
  color: rgba(255, 255, 255, .82);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-7px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 370px) {
  .page-shell {
    padding-inline: 10px;
  }

  .iphone {
    width: min(100%, 318px);
  }

  .screen-content {
    padding-inline: 16px;
  }

  .app-grid {
    gap: 19px 12px;
  }

  .detail-card {
    padding: 14px;
  }
}

@media (min-width: 760px) {
  .page-shell {
    width: min(100%, 620px);
    padding-top: 38px;
  }

  .iphone {
    width: 360px;
  }

  .profile__photo {
    width: 88px;
    height: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
