:root{
  --footer-h: 44px;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.40);
  --glass-shadow: 0 18px 55px rgba(0, 0, 0, 0.12);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: #f8f8fa;
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  margin: 0;
  text-align: center;

  display: flex;
  justify-content: center;
  align-items: center;

  padding-bottom: calc(var(--footer-h) + 18px);
}

#matrix-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Profile wrapper (image + eyes) */
.profile-wrap{
  position: fixed;
  top: 20px;
  right: 20px;
  width: 100px;
  height: 100px;
  z-index: 6;
}

.profile-img {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: block;
}

/* Eyes overlay (desktop only; hidden on mobile below) */
.profile-eyes{
  position: absolute;
  inset: 0;
  pointer-events: none;

  --eye-top: 46%;
  --eye-left: 50%;

  --pupil-x: 0px;
  --pupil-y: 0px;
}

.profile-eyes::after,
.profile-eyes::before{
  content: '';
  position: absolute;

  width: 14px;   /* smaller */
  height: 14px;  /* smaller */

  background-color: rgba(255,255,255,0.95);
  background-image: radial-gradient(circle 3px, #0d161b 100%, transparent 0); /* smaller pupil */
  background-repeat: no-repeat;
  border-radius: 50%;

  background-position: calc(50% + var(--pupil-x)) calc(50% + var(--pupil-y));
  animation: eyeBlink 4s infinite;
  will-change: background-position, height;

  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.profile-eyes::before{
  top: var(--eye-top);
  left: calc(var(--eye-left) - 12px);
  transform: translate(-50%, -50%);
}
.profile-eyes::after{
  top: var(--eye-top);
  left: calc(var(--eye-left) + 12px);
  transform: translate(-50%, -50%);
}

@keyframes eyeBlink{
  0%, 45%, 50%, 100% { height: 14px; }
  48% { height: 2px; }
}

.content {
  width: 90%;
  max-width: 650px;
  padding: 46px 54px;

  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);

  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);

  border-radius: 24px;
}

h1 {
  font-size: 3.5rem;
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -1px;
}

#bio-text {
  font-size: 1.25rem;
  color: #555;
  line-height: 1.7;
  margin: 0 0 2.7rem;
  font-weight: 400;
  min-height: 84px;
}

#typewriter-cursor {
  display: inline-block;
  width: 2px;
  background-color: #555;
  animation: typewriterBlink 1s step-end infinite;
}

@keyframes typewriterBlink {
  0%, 100% { background-color: transparent; }
  50% { background-color: #555; }
}

/* Buttons */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 0;
  flex-wrap: wrap;
}

.action-buttons a,
.action-buttons button {
  background-color: rgba(255, 255, 255, 0.86);
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 10px 20px;

  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;

  display: flex;
  align-items: center;
  gap: 8px;

  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);

  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.action-buttons a:hover,
.action-buttons button:hover {
  border-color: rgba(0,0,0,0.18);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.10);
}

.action-buttons i { font-size: 1.2rem; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.show { display: flex; opacity: 1; }

.modal-content {
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 500px;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  text-align: left;
}

.modal-overlay.show .modal-content { transform: scale(1); }

.modal-content h2 {
  margin: 0 0 8px;
  color: #1d1d1f;
  font-size: 2rem;
  font-weight: 600;
}

.modal-subtitle {
  font-size: 1rem;
  color: #666;
  margin: 0 0 25px;
  line-height: 1.5;
}

.modal-subtitle a {
  color: #007aff;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-subtitle a:hover,
.modal-subtitle a:focus-visible {
  color: #005ecb;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2.5rem;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s;
}

.close-btn:hover { color: #333; }

.contact-form .form-group { margin-bottom: 20px; }

.contact-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background-color: #f9f9f9;
  font-family: inherit;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.contact-form textarea { min-height: 120px; resize: vertical; }

.contact-form button {
  width: 100%;
  background-color: #007aff;
  color: white;
  font-weight: 600;
  border: none;
  padding: 14px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;

  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.contact-form button:hover { background-color: #005ecb; }
.contact-form button:disabled { background-color: #cce4ff; cursor: not-allowed; }

.form-group-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.form-group-consent input { width: auto; margin-top: 3px; }

.form-group-consent label {
  margin-bottom: 0;
  font-size: 0.8rem;
  color: #666;
}

.form-group-consent label a {
  color: #007aff;
  text-decoration: none;
}

.form-group-consent label a:hover { text-decoration: underline; }

/* Footer */
footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 1100;
  background: transparent;
}

footer small {
  font-size: 0.8rem;
  color: #888;
  padding: 0 10px;
}

footer a {
  color: #555;
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover { color: #007aff; }

.footer-status i{
  font-size: 0.9em;
  margin-right: 6px;
  color: #2aa745;
}

.online-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: #2aa745;
  box-shadow: 0 0 6px rgba(42, 167, 69, 0.7);
  vertical-align: middle;
}

/* Language toggle wrapper */
.lang-toggle {
  position: fixed;
  right: 14px;
  bottom: calc(var(--footer-h) + 8px);
  z-index: 1200;

  display: flex;
  align-items: center;
  gap: 10px;

  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 6px 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lang-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #444;
  letter-spacing: 0.3px;
}

/* Smaller switch */
.switch {
  --a: 0.42s ease-out;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  height: 1.05em;
  border-radius: 2em;
  box-shadow: 0 0 0 0.34em #aaa;
  aspect-ratio: 212.4992/84.4688;
  background-color: #aaa;
}

#check {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch svg { height: 100%; }

.switch svg path {
  color: #fff;
  stroke-width: 16;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 130 230;
  transition: all var(--a), 0s transform;
  transform-origin: center;
}

#check:checked ~ .switch svg path {
  stroke-dashoffset: 180;
  transform: scaleY(-1);
}

/* Mobile */
@media (max-width: 768px) {
  .profile-wrap { z-index: 1; width: 78px; height: 78px; top: 18px; right: 18px; }

  /* Eyes OFF on phone */
  .profile-eyes { display: none !important; }

  /* Ensure the card is above */
  .content { position: relative; z-index: 3; padding: 36px 24px; }

  h1 { font-size: 2.5rem; }

  #bio-text { margin-bottom: 2.5rem; min-height: 100px; }

  .action-buttons {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .action-buttons a,
  .action-buttons button {
    width: 100%;
    max-width: 300px;
    justify-content: center;
    box-sizing: border-box;
  }

  .modal-content { padding: 30px 25px; }

  .lang-toggle {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: calc(var(--footer-h) + 8px);
  }
}
