:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-accent: #1a1a1a;
  --color-accent-text: #ffffff;
  --color-border: #d8d8d8;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Centers a single element both horizontally and vertically. */
.page-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

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

.home-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

.home-note {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  color: #6b6b6b;
}

/* Hidden login trigger: invisible at rest, requires a 5s press-and-hold.
   While holding, a large, high-contrast progress ring + percentage is shown. */
.login-hotspot {
  position: relative;
  display: block;
  width: 3rem;
  height: 3rem;
  padding: 0;
  color: transparent;          /* no visible text at rest */
  text-decoration: none;
  background: transparent;     /* no visible button at rest */
  border: none;
  border-radius: 50%;
  outline: none;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  --hold: 0;
}

/* Soft halo behind the ring — makes the progress pop. */
.login-hotspot-halo {
  position: absolute;
  inset: -0.75rem;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  background: radial-gradient(circle, rgba(26, 26, 26, 0.16) 0%, rgba(26, 26, 26, 0) 70%);
  pointer-events: none;
}

.login-hotspot.is-ringing .login-hotspot-halo {
  opacity: 1;
  transform: scale(1);
}

/* Progress ring — hidden until the hold passes its start threshold. */
.login-hotspot-ring {
  position: absolute;
  inset: -0.35rem;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  /* Faint full-circle track + bold dark progress arc. */
  background:
    conic-gradient(#111 calc(var(--hold) * 360deg),
                   rgba(26, 26, 26, 0.15) 0);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%);
  mask: radial-gradient(circle, transparent 62%, #000 64%);
  filter: drop-shadow(0 0 4px rgba(17, 17, 17, 0.45));
  pointer-events: none;
}

.login-hotspot.is-ringing .login-hotspot-ring {
  opacity: 1;
}

/* Percentage readout in the centre of the ring. */
.login-hotspot-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #111;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  pointer-events: none;
}

.login-hotspot.is-ringing .login-hotspot-pct {
  opacity: 1;
}

.login-hotspot.is-holding {
  cursor: progress;
}

/* Keep it operable but visually silent when focused. */
.login-hotspot:focus-visible {
  box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.25);
  border-radius: 50%;
}

@media (prefers-reduced-motion: reduce) {
  .login-hotspot-ring,
  .login-hotspot-halo,
  .login-hotspot-pct {
    transition: none;
  }

  .login-hotspot-halo {
    transform: none;
  }
}

.button {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-accent-text);
  background-color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  transition: opacity 0.15s ease-in-out;
}

.button:hover,
.button:focus-visible {
  opacity: 0.8;
}

.button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Secondary action (e.g. Log in) — outlined variant of the primary button. */
.button-secondary {
  color: var(--color-accent);
  background-color: transparent;
}

.button-secondary:hover,
.button-secondary:focus-visible {
  opacity: 1;
  background-color: #f3f3f3;
}

/* Projects page */
.projects {
  max-width: 52rem;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.page-title {
  margin: 0 0 2.5rem;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Project card */
.project {
  padding: 1.75rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background-color: var(--color-bg);
}

.project + .project {
  margin-top: 1.5rem;
}

.project-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.project-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.project-year {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b6b6b;
  font-variant-numeric: tabular-nums;
}

.project-description {
  margin: 0 0 1rem;
  color: #3d3d3d;
}

.project-details {
  margin: 0 0 1.25rem;
  padding-left: 1.15rem;
  color: #3d3d3d;
}

.project-details li + li {
  margin-top: 0.35rem;
}

/* Technology tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #3d3d3d;
  background-color: #f3f3f3;
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

/* Login page — "jump up" window */
.auth-body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #eef1f6 0%, rgba(238, 241, 246, 0) 60%),
    var(--color-bg);
}

.auth {
  position: relative;
  width: 100%;
  max-width: 23rem;
  padding: 2.25rem 2rem 2rem;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background-color: var(--color-bg);
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.04),
    0 12px 32px rgba(16, 24, 40, 0.12),
    0 32px 64px rgba(16, 24, 40, 0.08);
  text-align: center;
  /* "Jump up" entrance */
  animation: auth-jump-up 0.55s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

@keyframes auth-jump-up {
  0% {
    opacity: 0;
    transform: translateY(48px) scale(0.94);
  }
  60% {
    opacity: 1;
    transform: translateY(-6px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin: -3.75rem auto 1rem;
  color: var(--color-accent-text);
  background: linear-gradient(135deg, #2b2b2b 0%, #1a1a1a 100%);
  border: 4px solid var(--color-bg);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.28);
}

.auth-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-align: center;
}

.auth-subtitle {
  margin: 0 0 1.75rem;
  font-size: 0.9rem;
  color: #6b6b6b;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.auth-label {
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #3d3d3d;
}

.auth-input {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background-color: #fafafa;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out,
    background-color 0.15s ease-in-out;
}

.auth-input::placeholder {
  color: #a5a5a5;
}

.auth-input:focus {
  outline: none;
  background-color: var(--color-bg);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(26, 26, 26, 0.08);
}

.auth-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.8rem 2rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.18);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-message {
  margin: 0.9rem 0 0;
  min-height: 1.25em;
  font-size: 0.875rem;
  text-align: center;
  color: #6b6b6b;
}

.auth-message.is-error {
  color: #b3261e;
}

.auth-back {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.875rem;
}

.auth-back a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease-in-out;
}

.auth-back a:hover {
  border-bottom-color: currentColor;
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .auth {
    animation: none;
  }
}

/* Protected app page (placeholder for the web UI) */
.app {
  max-width: 52rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.app-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #3d3d3d;
}

.app-logout {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

.app-body {
  padding-top: 1.5rem;
  color: #3d3d3d;
}

.app-note {
  font-size: 0.9rem;
  color: #6b6b6b;
}

code {
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
  background-color: #f3f3f3;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

@media (max-width: 480px) {
  .projects {
    padding: 2.5rem 1.25rem;
  }

  .page-title {
    margin-bottom: 1.75rem;
    font-size: 1.625rem;
  }

  .project {
    padding: 1.25rem;
  }

  .project-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .button {
    padding: 0.7rem 1.75rem;
  }

  .home-note {
    font-size: 1.75rem;
  }

  .auth {
    padding: 1.5rem 1.25rem;
  }

  .app {
    padding: 2rem 1.25rem;
  }
}
