/* Reset default styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
}

/* Colours come from tokens.css */
body {
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  cursor: default;
  text-align: center;
  padding: var(--space-section) 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s;
}

.container {
  width: 90%;
  max-width: 450px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.site-nav__crumb {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.site-nav__home {
  font-weight: 600;
}

.site-nav__current {
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Breadcrumb ("Juan Visbal / Now"): one line at every width. The size scales down on
   phones so the longest crumb fits a 320px screen; anything longer ends in "…". */
.site-nav .site-nav__title {
  display: flex;
  align-items: baseline;
  gap: 0.6em; /* one monospace space between the parts */
  min-width: 0;
  white-space: nowrap;
  font-size: clamp(1.1rem, 5.6vw, 1.75rem);
}

.site-nav .site-nav__title > * {
  flex-shrink: 0;
}

.site-nav .site-nav__title > .site-nav__current {
  flex-shrink: 1;
  min-width: 0;
}

.site-nav__menu {
  position: relative;
}

.site-nav__menu summary {
  list-style: none;
  cursor: pointer;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-muted);
}

.site-nav__menu summary::-webkit-details-marker {
  display: none;
}

.site-nav__menu[open] summary,
.site-nav__menu summary:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.site-nav__menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  min-width: 10rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--menu-bg);
  box-shadow: 0 8px 24px var(--menu-shadow);
  z-index: 10;
}

.site-nav__menu li a {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
}

.site-nav__menu li a:hover {
  background: var(--surface);
}

.profile-pic {
  display: block;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--space-content);
  border: 2px solid var(--text);
}

.name {
  font-size: 1.75rem;
  font-weight: bold;
  margin: var(--space-small) 0;
}

.description {
  font-size: 1rem;
  margin-bottom: var(--space-section);
  line-height: 1.6;
  color: var(--text-muted);
}

.links {
  display: flex;
  flex-direction: column;
  gap: var(--space-content);
  margin-top: var(--space-content);
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background-color: var(--surface);
  color: var(--text);
  padding: 15px;
  border-radius: 8px;
  font-size: 1.125rem;
  font-weight: 500;
  transition: background-color 0.3s, transform 0.2s;
}

.link-button:hover {
  background-color: var(--surface-hover);
  transform: scale(1.05);
}

.link-button svg {
  width: 1em;
}

.link-button--external {
  width: 100%;
}

.external-link-icon {
  margin-left: auto;
  font-size: 0.78rem;
  line-height: 1;
  color: var(--text-muted);
}

.link-button:hover .external-link-icon {
  color: var(--text);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.75rem; /* 12px: fine print, but AA contrast via --text-subtle */
  color: var(--text-subtle);
}

/* Home page: centred under the social icons */
body:not(.content-page) .footer {
  justify-content: center;
  margin-top: var(--space-section);
}

.footer__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Language switcher in the footer (layouts/_partials/site/language-switcher.html) */
.footer__lang {
  display: inline-flex;
  align-items: center;
}

.footer a:hover {
  color: var(--text);
}

/* IndieWeb Webring links (rendered only when [params.webring] is set) */
.footer__webring {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer__webring a:hover {
  color: var(--text);
}

.button-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.button-group {
  display: flex;
  gap: var(--space-content);
  margin-top: var(--space-section);
}

.icon-button {
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
  background: none;
  color: var(--text);
}

.icon-button i {
  font-size: 1.5rem;
}

.icon-button:hover {
  transform: scale(1.1);
  color: var(--text-muted);
}

.icon-button:active {
  transform: scale(0.95);
}

.link-button-text {
  font-size: 0.875rem;
  color: var(--text-subtle);
}

.section-separator {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-section) 0;
}

@media (max-width: 760px) {
  .name {
    font-size: 1.675rem;
  }
}

/* System/light/dark cycle in the footer (layouts/_partials/site/theme-toggle.html). */
.theme-toggle {
  /* Same size as the header menu button (.site-nav__menu summary) */
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Keep a non-functional control hidden if JS is disabled. */
.theme-toggle[hidden],
.theme-toggle > span {
  display: none;
}

/* Show the next action in the fixed cycle, independent of the current OS theme. */
:root:has(> head > meta[name="color-scheme"][content="light dark"]) .theme-toggle__to-light,
:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-toggle__to-dark,
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-toggle__to-system {
  display: inline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* "Skip to content": hidden until focused with the keyboard */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  z-index: 20;
}

.skip-link:focus {
  top: 1rem;
}
