/* ═══════════════════════════════════════════
   DIGITAL BUSINESS CARD — Styles
   ═══════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────── */

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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d1a;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Page Wrapper ─────────────────────── */

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.15);
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ─── Card Container (perspective) ─────── */

.card-container {
  width: min(500px, 88vw);
  aspect-ratio: 3.5 / 2;
  perspective: 1200px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  animation: fadeInUp 0.6s ease-out;
  transition: transform 0.3s ease;
}

.card-container:hover {
  transform: translateY(-4px);
}

.card-container:focus-visible {
  outline: 2px solid rgba(100, 160, 255, 0.5);
  outline-offset: 6px;
  border-radius: 14px;
}

/* ─── Card (flip element) ──────────────── */

.card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
  will-change: transform;
}

.card.flipped {
  transform: rotateY(180deg);
}

/* ─── Card Faces (shared) ──────────────── */

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 25px 60px -10px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}


/* ═══════════════════════════════════════════
   FRONT SIDE — Terminal Identity Card
   ═══════════════════════════════════════════ */

.card-front {
  background: linear-gradient(150deg, #262640 49.5%, #1b1b30 50.5%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(18px, 5vw, 28px) clamp(20px, 5.5vw, 32px);
}

/* ─── Front: Name ──────────────────────── */

.front-name {
  font-size: clamp(2.5rem, 5vw, 1.65rem);
  font-weight: 700;
  color: #9cdcfe;
  letter-spacing: -0.5px;
  z-index: 1;
}

/* ─── Front: URL ───────────────────────── */

.front-url {
  align-self: flex-end;
  font-size: clamp(0.85rem, 1.8vw, 0.72rem);
  color: #d4d4d4;
  letter-spacing: 0.3px;
  z-index: 1;
  text-decoration: none;
}

.front-url:hover {
  color: #e8e8e8;
  text-decoration: underline;
}

/* ─── Card Links (back side) ──────────── */

.card-link {
  color: inherit;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

/* ─── Front: Diagonal Icons ────────────── */

.front-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.front-icon {
  position: absolute;
  left: calc(10% + var(--i) * 25%);
  top: calc(85% - var(--i) * 25%);
  transform: translate(-50%, -50%);
  color: rgba(180, 200, 255, 0.10);
  line-height: 0;
  pointer-events: auto;
  transition: color 0.3s ease, filter 0.3s ease;
}

.card-container:hover .front-icon {
  color: rgba(180, 200, 255, 0.16);
}

.front-icon:hover {
  color: rgba(180, 200, 255, 0.35);
  filter: drop-shadow(0 0 6px rgba(125, 224, 231, 0.4));
}


/* ═══════════════════════════════════════════
   BACK SIDE — VS Code Editor
   ═══════════════════════════════════════════ */

.card-back {
  transform: rotateY(180deg);
  background: #1e1e1e;
  display: flex;
  flex-direction: column;
}

/* ─── Back: Title Bar ──────────────────── */

.editor-titlebar {
  display: flex;
  align-items: center;
  height: clamp(26px, 6vw, 32px);
  background: #323233;
  padding: 0 12px;
  position: relative;
  flex-shrink: 0;
  border-bottom: 1px solid #2a2a2a;
}

.window-controls {
  display: flex;
  gap: 6px;
  z-index: 1;
}

.dot {
  width: clamp(8px, 2vw, 10px);
  height: clamp(8px, 2vw, 10px);
  border-radius: 50%;
}

.dot-close    { background: #ff5f57; }
.dot-minimize { background: #febc2e; }
.dot-maximize { background: #28c840; }

.editor-filename {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(15px, 2vw, 11px);
  color: #aaaaaa;
  letter-spacing: 0.3px;
}

/* ─── Back: Editor Body ────────────────── */

.editor-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(10px, 3vw, 18px);
  font-size: clamp(12px, 2.3vw, 11.5px);
  line-height: 1.7;
  overflow: hidden;
}

.code-line {
  display: flex;
  white-space: pre;
}

.ln {
  flex: 0 0 clamp(16px, 4vw, 22px);
  text-align: right;
  color: #858585;
  padding-right: clamp(8px, 2vw, 14px);
  user-select: none;
}

.code {
  flex: 1;
  min-width: 0;
}

/* ─── Back: Syntax Colors ──────────────── */

.bracket { color: #ffd700; }
.key     { color: #9cdcfe; }
.str     { color: #ce9178; }
.punct   { color: #d4d4d4; }

/* ─── Back: Status Bar ─────────────────── */

.editor-statusbar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(20px, 5vw, 26px);
  background: #007acc;
  flex-shrink: 0;
}

.statusbar-icons {
  display: flex;
  align-items: center;
  gap: clamp(10px, 3vw, 18px);
  color: rgba(255, 255, 255, 0.85);
  line-height: 0;
}

.statusbar-icons svg {
  transition: filter 0.3s ease, color 0.3s ease;
}

.statusbar-icons svg:hover {
  color: #ffffff;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}


/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 400px) {
  .front-icon svg {
    width: 48px;
    height: 48px;
  }

  .statusbar-icons svg {
    width: 12px;
    height: 12px;
  }
}

@media (hover: none) {
  .card-container:hover {
    transform: none;
  }
}
