@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap');

:root{
    --bg: #000000;
    --bg-alt: #0d0d0d;
    --panel: #161616;
    --text: #ffffff;
    --text-dim: #b3b3b3;
    --accent: #b74b4b;
    --accent-soft: rgba(183, 75, 75, 0.15);
    --border: #b74b4b;
}

body.light-theme{
    --bg: #ffffff;
    --bg-alt: #ffffff;
    --panel: #ffffff;
    --text: #1a1414;
    --text-dim: #5c5252;
    --accent: #b74b4b;
    --accent-soft: rgba(183, 75, 75, 0.1);
    --border: #b74b4b;
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

html{
    font-size: 62.5%;
    scroll-behavior: smooth;
}

html, body {
    overflow-x: hidden;
}

body{
    width: 100%;
    height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.4s ease, color 0.4s ease;
}

#site-view{
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

span{
    color: #b74b4b;
}

/* ===================== Header ===================== */
header{
    width: 100%;
    padding: 1.6rem 5%;
    background-color: var(--bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.brand{
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 0.05rem;
    color: var(--text);
}

#theme-toggle{
    background: transparent;
    color: var(--accent);
    border: 0.15rem solid var(--accent);
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
}

#theme-toggle:hover{
    background-color: var(--accent);
    color: var(--bg);
    transform: rotate(20deg);
}

/* ===================== Footer ===================== */
footer {
    background-color: var(--bg);
    color: var(--text);
    text-align: center;
    padding: 1 rem 0;
    font-size: 1 rem;
    border-top: 1px solid var(--accent-soft);
}

/* ===================== Home ===================== */
.home{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8rem;
    background-color: var(--bg);
    flex: 1 0 auto;
    padding: 5rem 9%;
}

header, footer{
    flex-shrink: 0;
}

.justify{
    text-align: justify;
}

.home .home-content h1{
    font-size: 6rem;
    font-weight: 700;
    line-height: 1.3;
}

.home-content h3{
    font-size: 4rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.home-content p{
    font-size: 1.6rem;
    color: var(--text);
}

.home-img{
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

.home-img img{
    position: relative;
    width: 28vw;
    max-width: 38rem;
    border-radius: 50%;
    box-shadow: 0 0 25px var(--accent-soft);
    cursor: pointer;
    transition: 0.2s linear;
    object-fit: cover;
}

.typing-text{
    font-size: 30px;
    font-weight: 600;
    min-width: 280px;
    max-width: 100%;
    overflow-wrap: break-word;
}

.typing-text span{
    position: relative;
}

.typing-text span::before{
    content: "an SAP ABAP Developer";
    color: var(--accent);
}

.social-icons{
    margin-top: 1rem;
}

.social-icons a{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background-color: transparent;
    border: 0.2rem solid var(--accent);
    font-size: 2rem;
    border-radius: 50%;
    margin: 1rem 1.5rem 1rem 0;
    transition: 0.3s ease;
    color: var(--accent);
}

.social-icons a:hover{
    color: var(--bg);
    transform: scale(1.3) translateY(-5px);
    background-color: var(--accent);
    box-shadow: 0 0 25px var(--accent-soft);
}

.btn{
    display: inline-block;
    padding: 1rem 2.8rem;
    background-color: var(--bg);
    border-radius: 4rem;
    font-size: 1.6rem;
    color: var(--accent);
    letter-spacing: 0.15rem;
    font-weight: 600;
    border: 2px solid var(--accent);
    transition: 0.3s ease;
    cursor: pointer;
}

.btn:hover{
    transform: scale(1.03);
    background-color: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 25px var(--accent-soft);
}

.terminal-cta{
    margin-top: 1.6rem;
    font-family: 'Courier New', monospace;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.terminal-cta-hint{
    margin-top: 1rem;
    font-size: 1.3rem !important;
    color: var(--text-dim) !important;
}

@media (max-width: 1000px){
    .home{
        gap: 4rem;
    }
}

@media (max-width: 995px) {
    .home {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.6rem;
        padding: 2.4rem 6%;
    }

    .home .home-content h1 {
        font-size: 2.6rem;
        line-height: 1.25;
        word-wrap: break-word;
    }

    .home .home-content h3 {
        font-size: 1.8rem;
        margin: 0.6rem 0;
    }

    .home-content{
        width: 100%;
        box-sizing: border-box;
    }

    .home-img img {
        width: 40vw;
        max-width: 180px;
    }

    .home-content p {
        font-size: 1.4rem;
        line-height: 1.45;
    }

    .social-icons{
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 0.4rem;
    }

    .social-icons a{
        width: 3.4rem;
        height: 3.4rem;
        margin: 0.6rem 0.8rem 0.6rem 0;
        font-size: 1.6rem;
    }

    .terminal-cta{
        margin-top: 1rem;
    }
}

@media (max-width: 480px){
    .home .home-content h1{
        font-size: 2.1rem;
    }

    .home .home-content h3{
        font-size: 1.5rem;
    }

    .home-content p{
        font-size: 1.3rem;
    }

    .home-img img{
        width: 32vw;
        max-width: 130px;
    }
}

/* ===================== Full-page Terminal ===================== */
#terminal-view{
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #0a0a0a;
    padding: 2rem;
    flex-direction: column;
}

body.terminal-mode #site-view{
    display: none;
}

body.terminal-mode #terminal-view{
    display: flex;
}

body.terminal-mode{
    overflow: hidden;
}

.terminal-window{
    max-width: 110rem;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 0 40px var(--accent-soft);
    border: 1px solid var(--accent-soft);
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
}

.terminal-titlebar{
    background: var(--panel);
    padding: 1rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(183,75,75,0.2);
    flex-shrink: 0;
}

.terminal-titlebar .dot{
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    display: inline-block;
}
.dot.red{ background: #ff5f56; }
.dot.yellow{ background: #ffbd2e; }
.dot.green{ background: #27c93f; }

.terminal-title{
    margin-left: 1rem;
    font-size: 1.3rem;
    color: var(--text-dim);
    font-family: 'Courier New', monospace;
}

.terminal-back-btn{
    margin-left: auto;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--accent-soft);
    border-radius: 2rem;
    padding: 0.5rem 1.4rem;
    font-size: 1.3rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.terminal-back-btn:hover{
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.terminal-body{
    flex: 1;
    overflow-y: auto;
    padding: 1.8rem;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    color: #d6d6d6;
    background: #0a0a0a;
}

.terminal-body::-webkit-scrollbar{ width: 0.8rem; }
.terminal-body::-webkit-scrollbar-thumb{ background: var(--accent); border-radius: 1rem; }
.terminal-body::-webkit-scrollbar-track{ background: transparent; }

@keyframes term-line-in{
    from{ opacity: 0; transform: translateY(8px); }
    to{ opacity: 1; transform: translateY(0); }
}

.terminal-line{
    margin-bottom: 1rem;
    line-height: 1.55;
    word-break: break-word;
    animation: term-line-in 0.3s ease both;
}

p.terminal-line{
    white-space: pre-wrap;
}

.terminal-line.echoed{
    color: var(--accent);
    margin-top: 2.2rem;
}

.terminal-line.echoed:first-child{
    margin-top: 0;
}

.terminal-line.error{
    color: #ff6b6b;
}

.term-cmd{
    color: var(--accent);
    font-weight: 600;
}

.terminal-body a{
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.2rem;
    transition: 0.2s ease;
}

.terminal-body a:hover{
    opacity: 0.75;
}

/* rich content blocks printed inside the terminal (logos, galleries) */
.term-media{
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.term-thumb{
    width: 7rem;
    height: 7rem;
    object-fit: contain;
    background: #141414;
    border: 1px solid var(--accent-soft);
    border-radius: 0.8rem;
    padding: 0.6rem;
    flex-shrink: 0;
}

.term-media-text{
    font-size: 1.4rem;
    line-height: 1.6;
    color: #d6d6d6;
}

.term-list{
    list-style: none;
    margin: 0.8rem 0 0;
    padding-left: 1.6rem;
}

.term-list li{
    position: relative;
    margin-bottom: 0.9rem;
    line-height: 1.55;
}

.term-list li::before{
    content: "-";
    position: absolute;
    left: -1.5rem;
    color: var(--accent);
}

/* ---- help command: fixed-width grid so descriptions always align ---- */
.term-help-title{
    color: #d6d6d6;
    margin-bottom: 1rem;
}

.term-help-tip{
    color: var(--text-dim);
    font-size: 1.2rem;
    opacity: 0.75;
}

.term-help-row{
    display: grid;
    grid-template-columns: 13rem 1fr;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.term-help-cmd{
    color: var(--accent);
    font-weight: 600;
}

.term-help-desc{
    color: #d6d6d6;
}

@media (max-width: 995px){
    .term-help-row{
        grid-template-columns: 1fr;
        gap: 0.2rem;
        margin-bottom: 1.2rem;
    }
}

/* ---- tech stack: SAP featured tier + secondary logo grid ---- */
.term-tech-tier-label{
    font-size: 1.2rem;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 600;
}

.term-tech-tier-secondary{
    color: var(--text-dim);
    margin-top: 2rem;
}

.term-sap-feature{
    display: flex;
    align-items: flex-start;
    gap: 1.6rem;
    background: #141414;
    border: 1px solid var(--accent-soft);
    border-radius: 1rem;
    padding: 1.6rem;
    margin-bottom: 0.4rem;
}

.term-sap-logo{
    flex-shrink: 0;
    width: 7rem;
    height: 7rem;
    border-radius: 0.8rem;
    background: #ffffff;
    border: 1px solid var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.1rem;
}

.term-sap-logo img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.term-sap-pills{
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1rem;
}

.term-sap-pill{
    font-size: 1.2rem;
    color: var(--accent);
    border: 1px solid var(--accent-soft);
    border-radius: 2rem;
    padding: 0.4rem 1rem;
    background: rgba(183,75,75,0.08);
}

.term-tech-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 1.4rem;
}

.term-tech-item{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    text-align: center;
}

.term-tech-icon-wrap{
    position: relative;
    width: 4.4rem;
    height: 4.4rem;
    background: #141414;
    border: 1px solid var(--accent-soft);
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
}

.term-tech-icon{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.term-tech-fallback{
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border-radius: 0.7rem;
}

.term-tech-name{
    font-size: 1.2rem;
    color: #d6d6d6;
}

@media (max-width: 995px){
    .term-sap-feature{ flex-direction: column; align-items: flex-start; }
    .term-tech-grid{ grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); }
}

/* ---- blog command ---- */
.term-blog-list{
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.term-blog-row{
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #d6d6d6;
    font-size: 1.35rem;
    text-decoration: none;
    border: 1px solid var(--accent-soft);
    border-radius: 0.7rem;
    padding: 1rem 1.2rem;
    transition: 0.2s ease;
}

.term-blog-row:hover{
    border-color: var(--accent);
    background: rgba(183,75,75,0.08);
}

.term-blog-row i{
    color: var(--accent);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.term-gallery{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1.4rem;
    margin-bottom: 1.4rem;
}

.term-gallery-item{
    display: block;
    background: #141414;
    border: 1px solid var(--accent-soft);
    border-radius: 0.8rem;
    overflow: hidden;
    transition: 0.25s ease;
    animation: term-line-in 0.3s ease both;
}

.term-gallery-item:nth-child(1){ animation-delay: 0.03s; }
.term-gallery-item:nth-child(2){ animation-delay: 0.09s; }
.term-gallery-item:nth-child(3){ animation-delay: 0.15s; }
.term-gallery-item:nth-child(4){ animation-delay: 0.21s; }
.term-gallery-item:nth-child(5){ animation-delay: 0.27s; }
.term-gallery-item:nth-child(6){ animation-delay: 0.33s; }

.term-gallery-item:hover{
    border-color: var(--accent);
    transform: translateY(-3px);
}

.term-gallery-item img{
    width: 100%;
    height: 12rem;
    object-fit: cover;
    display: block;
}

.term-gallery-caption{
    padding: 0.8rem 1rem;
    font-size: 1.2rem;
    color: #d6d6d6;
    line-height: 1.4;
}

.term-gallery-caption .term-num{
    color: var(--accent);
    font-weight: 700;
    margin-right: 0.4rem;
}

.term-single-project img{
    max-width: 100%;
    border-radius: 0.8rem;
    border: 1px solid var(--accent-soft);
    margin-bottom: 1rem;
    display: block;
}

.term-contact{
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    margin-top: 0.6rem;
}

.term-contact-row{
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.term-contact-row i{
    width: 4rem;
    height: 4rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    color: var(--accent);
    background: #141414;
    border: 1px solid var(--accent-soft);
    border-radius: 50%;
}

.term-contact-text{
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.term-contact-text strong{
    color: #d6d6d6;
    font-size: 1.4rem;
    font-weight: 600;
}

.term-contact-text a{
    font-size: 1.3rem;
}

.terminal-input-row{
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.8rem;
    background: #0a0a0a;
    border-top: 1px solid rgba(183,75,75,0.2);
    flex-shrink: 0;
}

.terminal-prompt{
    font-family: 'Courier New', monospace;
    color: var(--accent);
    font-size: 1.5rem;
    white-space: nowrap;
}

.terminal-input-wrap{
    position: relative;
    flex: 1;
    min-width: 0;
}

.terminal-ghost{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    white-space: pre;
    pointer-events: none;
    overflow: hidden;
}

.terminal-ghost .ghost-typed{
    color: transparent;
}

.terminal-ghost .ghost-rest{
    color: var(--text-dim);
    opacity: 0.55;
}

#terminal-input{
    position: relative;
    display: block;
    width: 100%;
    background: transparent;
    color: #f1f1f1;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    caret-color: var(--accent);
}

.terminal-tab-hint{
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: var(--text-dim);
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.15s ease;
    border: 1px solid var(--accent-soft);
    border-radius: 0.4rem;
    padding: 0.2rem 0.6rem;
    flex-shrink: 0;
}

.terminal-tab-hint.visible{
    opacity: 0.8;
}

@media (max-width: 995px){
    .terminal-tab-hint{ display: none; }
}

.terminal-suggestions{
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.4rem 1.8rem;
    background: var(--panel);
    border-top: 1px solid rgba(183,75,75,0.15);
    flex-shrink: 0;
}

.terminal-suggestions button{
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: 0.25s ease;
}

.terminal-suggestions button:hover{
    background: var(--accent);
    color: var(--bg);
}

@media (max-width: 995px){
    #terminal-view{ padding: 0; }
    .terminal-window{ border-radius: 0; }
    .terminal-body{ font-size: 1.3rem; }
    .terminal-back-btn span{ display: none; }
    .term-thumb{ width: 5.4rem; height: 5.4rem; }
}

.term-certificate-btn {
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.term-certificate-btn:hover {
  background: var(--accent);
  color: #000;
}

.certificate-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 2rem;

  background: rgba(0, 0, 0, 0.85);

  animation: certificateFadeIn 0.2s ease;
}

.certificate-modal-content {
  position: relative;

  max-width: min(90vw, 1000px);
  max-height: 90vh;

  animation: certificateZoomIn 0.2s ease;
}

.certificate-modal-content img {
  display: block;

  max-width: 100%;
  max-height: 90vh;

  object-fit: contain;

  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.certificate-modal-close {
  position: absolute;

  top: -45px;
  right: 0;

  width: 36px;
  height: 36px;

  border: none;
  background: transparent;

  color: #fff;
  font-size: 2rem;
  line-height: 1;

  cursor: pointer;

  transition: opacity 0.2s ease;
}

.certificate-modal-close:hover {
  opacity: 0.7;
}

@keyframes certificateFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes certificateZoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}
