  :root{
    --bg: #000000;
    --panel: #0c0c0c;
    --panel-2: #0a0a0a;
    --border: rgba(120, 200, 150, 0.14);
    --border-strong: rgba(140, 220, 170, 0.28);
    --back: #1f7a3f;
    --back-dark: #175c2f;
    --front: #2fae5b;
    --front-light: #3fc96c;
    --front-edge: #257f43;
    --paper: #f3f0e6;
    --paper-line: #d8d2c0;
    --shadow: rgba(0,0,0,0.6);
    --text: #ffffff;
    --text-soft: #f5f5f5;
    --text-muted: #8a8a8a;
    --accent: #4ed389;
  }
  *{ box-sizing:border-box; }
  html,body{
    margin:0; padding:0; min-height:100%;
    background: var(--bg);
    font-family: 'JetBrains Mono', ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color: var(--text);
    position: relative;
    overflow-x: hidden;
  }
  header{
    position: relative;
    z-index: 2;
  }
  main{
    position: relative;
    z-index: 1;
  }

  /* ---------- Header ---------- */
  header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    padding: 28px 36px 0 28px;
  }

  .back-btn{
    display:flex;
    align-items:center;
    justify-content:center;
    width: 40px;
    height: 40px;
    background: rgba(78, 211, 137, 0.08);
    border: 1px solid var(--border);
    color: var(--text-soft);
    text-decoration:none;
    border-radius: 50%;
    transition: background .2s ease, transform .2s ease, border-color .2s ease, color .2s ease;
  }
  .back-btn:hover{
    background: rgba(78, 211, 137, 0.16);
    border-color: var(--border-strong);
    color: var(--text);
    transform: translateX(-2px);
  }
  .back-btn svg{
    width:18px; height:18px;
    flex-shrink:0;
  }

  /* ---------- CV viewer ---------- */
  main{
    display:flex;
    justify-content:center;
    padding: 20px 24px 80px;
    perspective: 1600px;
  }

  .term-window{
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    border-radius: 10px;
    background: rgba(10, 18, 13, 0.62);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(140, 220, 170, 0.18);
    box-shadow:
      0 30px 70px -20px rgba(0,0,0,0.7),
      0 0 0 1px rgba(0,0,0,0.3),
      inset 0 1px 0 rgba(255,255,255,0.04);
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform, box-shadow;
    backface-visibility: hidden;
  }

  .term-titlebar{
    display:flex;
    align-items:center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(140, 220, 170, 0.14);
  }
  .term-dot{
    width: 11px; height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .term-dot.red{ background: #ff5f57; }
  .term-dot.yellow{ background: #febc2e; }
  .term-dot.green{ background: #28c840; }
  .term-titlebar-name{
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: .02em;
    margin-right: 44px;
  }

  .nano-headbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 6px 16px;
    background: rgba(78, 211, 137, 0.9);
    color: #06170d;
    font-size: 12px;
    font-weight: 700;
  }

  .term-body{
    padding: 22px 26px 26px;
  }

  .nano-footer{
    display:flex;
    flex-wrap: wrap;
    background: rgba(78, 211, 137, 0.9);
    color: #06170d;
    font-size: 11.5px;
    font-weight: 700;
  }
  .nano-footer .shortcut{
    display:flex;
    align-items:center;
    gap: 6px;
    padding: 5px 14px;
    white-space: nowrap;
  }
  .nano-footer .key{
    background: #06170d;
    color: #4ed389;
    padding: 0 5px;
    border-radius: 2px;
  }

  .cv-body{
    width: 100%;
    max-width: 800px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-soft);
    perspective: 600px;
  }

  ::selection{
    background: rgba(78, 211, 137, 0.55);
    color: #ffffff;
  }

  .term-line{
    position: relative;
    display: block;
    padding: 3px 10px;
    margin: 0 -10px;
    border-radius: 4px;
    transform-style: preserve-3d;
    transition: background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
  }
  .term-line:hover{
    background: rgba(78, 211, 137, 0.2);
    color: #ffffff;
    transform: translateX(5px) translateZ(14px);
    box-shadow:
      inset 3px 0 0 var(--accent),
      0 10px 18px -10px rgba(0,0,0,0.7);
  }
  .term-line:hover *{
    color: #ffffff !important;
  }
  .term-line:hover .cv-entry-date,
  .term-line:hover .cv-entry-sub{
    color: rgba(255,255,255,0.75) !important;
  }
  li.term-line{
    padding-left: 10px;
  }
  li.term-line::marker{
    color: var(--accent);
  }
  .cv-entry-head.term-line{
    margin: 0 -10px 4px;
  }
  .cv-name{
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
    display: inline-block;
  }
  .cv-cursor{
    display:inline-block;
    color: var(--accent);
    animation: blink 1.1s steps(1) infinite;
  }
  @keyframes blink{
    50%{ opacity: 0; }
  }
  .cv-role{
    font-size: 14px;
    color: var(--accent);
    margin: 0 0 16px;
    letter-spacing: 0;
    font-weight: 500;
  }
  .cv-contact{
    display:flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 26px;
  }
  .cv-summary{
    color: var(--text-soft);
    margin-bottom: 30px;
    max-width: 62ch;
  }
  .cv-section{
    margin-bottom: 28px;
  }
  .cv-section-title{
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--accent);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }
  .cv-entry{
    margin-bottom: 18px;
  }
  .cv-entry:last-child{ margin-bottom:0; }
  .cv-entry-head{
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    gap: 12px;
    flex-wrap: wrap;
  }
  .cv-entry-title{
    color: var(--text);
    font-size: 14.5px;
    font-weight: 500;
  }
  .cv-entry-sub{
    color: var(--text-muted);
    font-size: 12.5px;
  }
  .cv-entry-date{
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
  }
  .cv-entry ul{
    margin: 8px 0 0;
    padding-left: 18px;
  }
  .cv-entry li{
    margin-bottom: 4px;
    color: var(--text-soft);
  }
  .cv-entry li::marker{
    color: var(--accent);
  }
  .cv-skills{
    display:flex;
    flex-wrap:wrap;
    gap: 8px;
  }
  .cv-skill{
    font-size: 12.5px;
    color: var(--text-soft);
    background: rgba(78, 211, 137, 0.1);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 999px;
  }

  /* ---------- Download folder (top right) ---------- */
  .folder-slot{
    display:flex;
    justify-content:flex-end;
  }
  .stage{
    perspective: 1200px;
    padding: 4px 10px 40px;
  }
  .folder{
    position: relative;
    width: 132px;
    height: 97px;
    transform-style: preserve-3d;
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
  }
  .front, .papers, .paper{
    backface-visibility: hidden;
  }

  .shadow{
    position:absolute;
    left: 8%;
    right: 8%;
    bottom: -12px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, var(--shadow) 0%, transparent 72%);
    transform-origin: center;
  }

  .back{
    position:absolute;
    left:0; right:0; bottom:0;
    height: 84px;
    background: linear-gradient(180deg, var(--back) 0%, var(--back-dark) 100%);
    border-radius: 7px;
    box-shadow: 0 10px 18px -8px var(--shadow);
  }
  .back::before{
    content:"";
    position:absolute;
    top:-11px; left:8px;
    width: 42%;
    height: 18px;
    background: var(--back);
    border-radius: 6px 8px 0 0;
  }

  .papers{
    position:absolute;
    left: 12px; right: 12px;
    bottom: 20px;
    height: 60px;
    transform-style: preserve-3d;
  }
  .paper{
    position:absolute;
    inset: 0;
    background: var(--paper);
    border-radius: 4px;
    box-shadow: 0 4px 8px -4px var(--shadow);
    padding: 8px 9px;
    will-change: transform;
  }
  .paper .line{
    height: 4px;
    border-radius: 2px;
    background: var(--paper-line);
    margin-bottom: 6px;
  }
  .paper .line:nth-child(1){ width: 70%; }
  .paper .line:nth-child(2){ width: 90%; }
  .paper .line:nth-child(3){ width: 55%; }
  .paper .line:nth-child(4){ width: 80%; }
  .paper.p2, .paper.p3{ padding:0; }
  .paper.p2 .line, .paper.p3 .line{ display:none; }

  .front{
    position:absolute;
    left:0; right:0; bottom:0;
    height: 56px;
    background: linear-gradient(180deg, var(--front-light) 0%, var(--front) 100%);
    border-radius: 7px;
    box-shadow: 0 8px 16px -6px var(--shadow);
    transform-origin: bottom center;
    transform-style: preserve-3d;
    will-change: transform;
  }
  .front::after{
    content:"";
    position:absolute;
    left:0; right:0; top:0;
    height: 2px;
    background: var(--front-edge);
    border-radius: 7px 7px 0 0;
    opacity:.6;
  }

  .download-icon{
    position:absolute;
    left: 50%; top: 50%;
    width: 26px; height: 26px;
    transform: translate(-50%, -50%);
    display:flex; align-items:center; justify-content:center;
    background: rgba(255,255,255,0.16);
    border-radius: 50%;
    will-change: transform;
  }
  .download-icon svg{
    width: 14px; height: 14px;
    display:block;
  }

  .cv-tag{
    position:absolute;
    left: 50%;
    bottom: -22px;
    transform: translateX(-50%);
    font-size: 9px;
    letter-spacing: .03em;
    color: #b9d9c4;
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
  }
  .folder:hover .cv-tag{
    opacity: 1;
    transform: translateX(-50%) translateY(2px);
  }

  @media (max-width: 640px){
    header{ padding: 20px 16px 0; }
    .stage{ padding: 0 4px 24px; }
    .folder{ width: 100px; height: 74px; }
    .back{ height: 64px; }
    .front{ height: 42px; }
    main{ padding: 14px 12px 60px; }
    .term-body{ padding: 16px 16px 20px; }
    .nano-footer{ font-size: 10.5px; }
    .nano-footer .shortcut{ padding: 5px 10px; }
    .cv-name{ font-size: 32px; }
  }

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