/* Landing page. Tokens come from /tokens.css (copied from design/tokens.css at build). */

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,
h2,
p,
ul {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
img {
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
/* Controls are not text: their labels never get selected by taps or double-clicks. */
button,
.theme,
.socials,
.tags,
.strip-label,
.rows a {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.page {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: max(var(--space-6), env(safe-area-inset-top))
    max(var(--space-4), env(safe-area-inset-right)) max(var(--space-6), env(safe-area-inset-bottom))
    max(var(--space-4), env(safe-area-inset-left));
}
@media (min-height: 760px) {
  .page {
    padding-top: 9vh;
  }
}

/* Flat sheet: hairline, large squircle, no shadow */
.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* ------------------------------------------------------------------ Profile */

.band {
  position: relative;
  height: 108px; /* 12 + n * 24, see --pattern-grid */
  margin-bottom: -60px;
  background: var(--pattern-grid);
  border-bottom: 1px solid var(--line);
}
/* Brand mark (same art as the favicon) floating in the band's corner on a soft glow */
.band::before {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  corner-shape: round;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--pink) 30%, transparent),
    color-mix(in srgb, var(--amber) 14%, transparent) 45%,
    transparent 70%
  );
  filter: blur(8px);
}
.mark {
  position: absolute;
  top: 26px;
  right: 32px;
  width: 40px;
  height: 40px;
  transform: rotate(-8deg);
  filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--pink) 35%, transparent));
}
.profile-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: 0 var(--space-5) var(--space-5);
}
.profile-id {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.photo {
  /* white frame + hairline around the round photo */
  display: block;
  width: fit-content;
  padding: 5px;
  margin-bottom: var(--space-2);
  border: 1px solid var(--line);
  border-radius: 50%;
  corner-shape: round;
  background: var(--surface);
  position: relative;
}
.photo img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  corner-shape: round;
  object-fit: cover;
}
.profile h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-2);
  font-size: 15px;
}
.sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  corner-shape: round;
  background: var(--ink-3);
}

.profile-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
}
.socials {
  display: flex;
  gap: var(--space-2);
}
.socials a {
  display: block;
  border-radius: var(--radius-sm);
  transition: transform 0.12s var(--ease);
}
.socials a:hover {
  transform: translateY(-1px);
}
.socials img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}
.email {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 var(--space-3) 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  corner-shape: round;
  font-weight: 500;
  transition:
    background-color 0.12s var(--ease),
    border-color 0.12s var(--ease);
}
.email img {
  border-radius: 50%;
  corner-shape: round;
}
.email span {
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.email:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

/* Label cell + outline dot tags, split from the profile by a hairline */
.strip {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--line);
}
.strip-label {
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px var(--space-3);
}
.tags li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  corner-shape: round;
  font-size: var(--text-xs);
  color: var(--ink);
  white-space: nowrap;
}
.tags li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  corner-shape: round;
  background: var(--tone);
}

/* ------------------------------------------------------------------ Apps */

.eyebrow {
  margin-top: var(--space-4);
  padding: 0 var(--space-1);
  color: var(--ink-3);
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* List block: one row per link, full-width hairlines between rows */
.rows li + li {
  border-top: 1px solid var(--line);
}
.rows a {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 14px var(--space-3);
  transition: background-color 0.12s var(--ease);
}
.rows a:hover {
  background: var(--surface-2);
}
.rows a:focus-visible {
  box-shadow: inset var(--focus-ring);
}
.rows img {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
}
.row-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.35;
}
.row-text strong {
  font-size: var(--text-md);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.row-text > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--ink-3);
}
.out {
  flex: none;
  transition: transform 0.12s var(--ease);
}
.rows a:hover .out {
  transform: translate(1px, -1px);
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding: 0 var(--space-1);
  color: var(--ink-3);
  font-size: var(--text-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Compact theme switch: three round icon buttons in a capsule track (same as Console) */
.theme {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  corner-shape: round;
  background: var(--surface-2);
}
.theme button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  corner-shape: round;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.theme button:hover {
  color: var(--ink);
}
.theme button[aria-checked="true"] {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}
.theme button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Instant tooltips for icon-only links and buttons (no slow native title) */
[data-tip] {
  position: relative;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 10;
  bottom: calc(100% + 6px);
  left: 50%;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  corner-shape: round;
  background: var(--tooltip-bg);
  color: var(--tooltip-ink);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 2px);
  transition:
    opacity 0.1s var(--ease) 0.06s,
    transform 0.1s var(--ease) 0.06s;
}
[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* The theme switch sits at the bottom right: open its tooltips leftward-safe */
.theme [data-tip]:last-child::after {
  left: auto;
  right: 0;
  transform: translateY(2px);
}
.theme [data-tip]:last-child:hover::after,
.theme [data-tip]:last-child:focus-visible::after {
  transform: none;
}

/* ------------------------------------------------------------------ Phones */

@media (max-width: 560px) {
  .profile-main {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 var(--space-4) var(--space-4);
  }
  .profile-links {
    align-items: flex-start;
  }
  .photo img {
    width: 84px;
    height: 84px;
  }
  .band {
    height: 84px;
    margin-bottom: -52px;
  }
  .mark {
    top: 18px;
    right: 20px;
    width: 34px;
    height: 34px;
  }
  .band::before {
    top: 0;
    right: -6px;
  }
  .strip {
    flex-direction: column;
  }
  .strip-label {
    padding: var(--space-2) var(--space-4);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .email span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
