/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main Body Style */
body {
    background-color: #0D1117;
    color: #FFFFFF;
    font-family: 'Iceland', cursive;
}


/* ========== Base Styles (Desktop Default) ========== */

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.625rem 2.1875rem 3.5rem;
    position: relative;
    min-height: auto;
}

.header-row {
    display: contents;
    /* behaves as if wrapper doesn’t exist */
}

.header-item {
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1;
    color: #FFFFFF;
    z-index: 2;
    position: relative;
}

.portfolio-title {
    position: absolute;
    top: 1.875rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-weight: 400;
    font-size: clamp(3rem, 7vw, 7.1875rem);
    line-height: 1;
    text-align: center;
    color: #FFFFFF;
}

.geometric-line-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3.5rem;
    padding: 0;
    z-index: 1;
    min-height: auto;
}

.geometric-line {
    width: 100%;
    height: 100%;
    display: block;
    color: #FFFFFF;
    overflow: visible;
}


/* ========== Tablet Styles (768px – 1023px) ========== */

@media (max-width: 1023px) {
    .main-header {
        padding: 1rem 1.5rem 3rem;
    }

    .header-item {
        font-size: clamp(1.5rem, 3vw, 3rem);
    }

    .portfolio-title {
        font-size: clamp(2.5rem, 6vw, 5rem);
        top: 2rem;
    }

    .geometric-line-container {
        height: 2.5rem;
    }
}


/* ========= MOBILE (≤767px) ========= */
@media (max-width: 768px) {
    .main-header {
        padding: 0.75rem 1rem 0;
        padding-bottom: 1.25rem;
        min-height: 7rem;
    }

    .header-item {
        font-size: clamp(1rem, 2.5vw, 2.5rem);
    }

    .portfolio-title {
        font-size: clamp(1.5rem, 5vw, 4rem);
        top: 1.25rem;
    }

    .geometric-line-container {
        height: 3rem;
        bottom: 3.5rem;
    }

    /* Adjust SVG viewBox for shallower dip */
    .geometric-line {
        transform: scaleY(0.5);
        transform-origin: bottom;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 0.5rem 1rem 0;
        padding-bottom: 1rem;
    }

    .header-item {
        font-size: clamp(0.875rem, 2vw, 2rem);
    }

    .portfolio-title {
        font-size: clamp(1.25rem, 4vw, 3rem);
        top: 1rem;
    }

    .geometric-line-container {
        height: 3rem;
        bottom: 3.5rem;
    }

    .geometric-line {
        transform: scaleY(0.4);
        transform-origin: bottom;
    }
}




/* ========== Base Styles (Desktop Default) ========== */

/* Main Content */
.main-content {
    width: 100%;
}

/* Terminal & Welcome Grid */
.terminal-welcome-wrapper {
    padding: 5rem 3rem;
    display: grid;
    grid-template-columns: 7fr 3fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    align-items: start;
}

/* Terminal */
.terminal-section {
    grid-column: 1;
    grid-row: 1 / 3;
}

.terminal-container {
    position: relative;
    width: 100%;
    aspect-ratio: 880 / 679;
}

.terminal-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #FFFFFF;
    pointer-events: none;
    z-index: 2;
}

/* Terminal Header - Percentage Based */
.terminal-header {
    position: absolute;
    top: -0.15%;
    /* Distance from top border */
    left: 1.5%;
    /* Distance from left border */
    right: 1.5%;
    /* Distance from right border */
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1%;
    /* Gap scales with terminal width */
    height: 6.5%;
    /* Height as percentage of terminal */
    z-index: 3;
}

/* Terminal Label */
.terminal-label {
    font-size: clamp(1rem, 2.5vw, 2.25rem);
    font-family: 'Iceland', cursive;
    color: #FFFFFF;
    white-space: nowrap;
    padding-right: 1%;
    /* Space before buttons */
    padding-top: 2%;
}

/* Terminal Commands Container */
.terminal-commands {
    display: flex;
    gap: 1%;
    /* No gap, we use negative margin for overlap */
    align-items: center;
}

/* Terminal Buttons - Scale with Container */
.command-button {
    background: #FFFFFF;
    border: 2px solid #FFFFFF;
    color: #000000;
    font-family: 'Iceland', cursive;
    font-size: clamp(0.875rem, 2vw, 2.25rem);
    font-weight: 400;
    padding: 0.5% 40%;
    /* Percentage padding */
    cursor: pointer;
    min-width: 8%;
    /* Minimum width relative to terminal */
    width: clamp(6rem, 12%, 12rem);
    height: 100%;
    /* 85% of header height */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    clip-path: polygon(0.5% 0%, 77% 0%, 100% 100%, 23% 100%);
    flex-shrink: 0;
    margin-right: 5%;
}

.command-button:not(:first-child) {
    margin-left: clamp(-2.5rem, -2%, -1.5rem);
    /* Responsive overlap */
}

.command-button:hover {
    background: #000;
    color: #fff;
    border-color: #fff;
    transform: scale(1.05);
    z-index: 10;
}

.command-button:active {
    transform: scale(0.98);
}

/* Terminal Content Area */
.terminal-content-area {
    position: absolute;
    top: 7.5%;
    /* Below header */
    left: 0.5%;
    right: 0.5%;
    bottom: 0.5%;
    background: rgba(255, 255, 255, .15);
    padding: 2%;
    overflow-y: auto;
    z-index: 1;
    clip-path: polygon(1% 2%, 99% 2%, 99% 99%, 3.5% 99%, 1% 95.75%);
}

.terminal-output {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: clamp(0.75rem, 1.4vw, 1.25rem);
    color: #FFFFFF;
}

.terminal-line {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
}

.prompt {
    color: #33FF33;
    margin-right: 0.5rem;
}

.cursor {
    color: #33FF33;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Terminal Input Field (Add to your existing terminal CSS) */
.terminal-input-wrapper {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.terminal-input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: clamp(0.75rem, 1.4vw, 1.25rem);
    padding: 0;
    margin: 0;
    caret-color: #ffffff;
}

.terminal-input-field::placeholder {
    color: rgba(51, 255, 51, 0.3);
}

.terminal-input-field:focus {
    outline: none;
}

/* Make prompt same size as text */
.prompt {
    color: white;
    margin-right: 0.5rem;
    font-family: 'Courier New', 'Consolas', monospace;
    /* ADDED: Match font size */
    font-size: clamp(0.75rem, 1.4vw, 1.25rem);
}

/* Make output read-only */
.terminal-output {
    user-select: text;
    pointer-events: none;
}

.terminal-output a {
    pointer-events: auto;  /* Allow clicks ONLY on links */
    cursor: pointer;
}

.terminal-input-wrapper {
    pointer-events: all;
}


/* ========== Tablet (768px – 1023px) ========== */
@media (max-width: 1023px) and (min-width: 769px) {
    .terminal-welcome-wrapper {
        padding: 3rem 2rem;
        gap: 1.5rem;
    }

    .terminal-header {
        top: -.5%;
        left: 2%;
        right: 2%;
        height: 7.5%;
    }

    .terminal-label {
        font-size: clamp(0.875rem, 2.2vw, 1.75rem);
        padding-right: 0%;
    }

    .command-button {
        font-size: clamp(0.75rem, 1.8vw, 1.5rem);
        width: clamp(5rem, 13%, 10rem);
        padding: 0.1rem 3.5rem;
        transform: scaleY(0.6);
        transform: scaleX(0.75);
        margin-right: -5%;
    }

    .command-button:not(:first-child) {
        margin-left: clamp(-2rem, -2.2%, -1.5rem);
    }

    .terminal-content-area {
        top: 7.5%;
    }
}

/* Skull */
.skull-section {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.skull-image {
    width: 100%;
    max-width: 50rem;
    height: auto;
    transform: scale(1.25);
}

/* Welcome */
.welcome-section {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    align-self: end;
}

.welcome-container {
    position: relative;
    width: 100%;
    max-width: 20rem;
    aspect-ratio: 401 / 498;
}

.welcome-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #fff;
    pointer-events: none;
    z-index: 2;
}

.welcome-header {
    position: absolute;
    top: .75rem;
    left: .75rem;
    right: .75rem;
    height: 4rem;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.welcome-header h2 {
    font-size: clamp(2rem, 2.5vw, 3rem);
    font-weight: 400;
    color: #000;
    margin: 0;
    letter-spacing: .1em;
}

.welcome-content {
    position: absolute;
    top: 5.25rem;
    left: .75rem;
    right: .75rem;
    bottom: .75rem;
    background: rgba(255, 255, 255, .15);
    padding: .65rem;
    overflow-y: auto;
    z-index: 1;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    line-height: 1.6;
    color: #33FF33;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 71% 100%, 63% 93%, 4% 93%, 0 89%);
}

.welcome-content p {
    color: #33FF33;
    margin-bottom: .75rem;
}

.welcome-content .welcome-greeting {
    color: #FFFFFF !important;
    margin-bottom: .75rem;
    font-weight: bold;
    font-size: clamp(0.7rem, 2vw, 0.85rem);
}

.welcome-content .welcome-greeting span {
    color: #00BFFF;
}

/* ========== Mobile (≤768px) ========== */
@media (max-width: 768px) {
    .main-content {
        margin-top: -2.5rem;
    }

    /* Grid layout - skull and welcome side by side, terminal below */
    .terminal-welcome-wrapper {
        padding: 2rem 1rem;
        display: grid;
        grid-template-columns: 1fr 1fr !important;
        /* Two equal columns */
        grid-template-rows: auto auto !important;
        /* Two rows only */
        gap: 2rem;
    }

    /* Skull - Top Left  image in the center of the cell*/
    .skull-section {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
    }

    .skull-image {
        max-width: 100%;
        transform: scale(1.5);
    }

    /* Welcome - Top Right */
    .welcome-section {
        grid-column: 2;
        grid-row: 1;
    }

    .welcome-container {
        max-width: 100%;
    }

    .welcome-content .welcome-greeting {
        font-size: clamp(0.7rem, 2vw, 1.75rem);
    }

    .welcome-content {
        font-size: clamp(0.7rem, 2vw, 1.75rem);
        top: clamp(3rem, 14vw, 5rem);
    }

    .welcome-header {
        height: clamp(2rem, 10vw, 4rem);
    }

    .welcome-header h2 {
        font-size: clamp(.5rem, 6vw, 3.5rem);
    }

    .terminal-section {
        grid-column: 1 / 3;
        grid-row: 2;
    }

    /* Terminal styling */
    .terminal-header {
        top: 0%;
        left: 3%;
        right: 0;
        height: 7%;
        gap: 1%;
    }

    .terminal-label {
        font-size: clamp(0.5rem, 3vw, 1.5rem);
        padding-right: 0.5%;
    }

    .command-button {
        font-size: clamp(0.7rem, 2.5vw, 1.25rem);
        width: clamp(7.5rem, 25%, 10rem);
        height: clamp(1.25rem, 5.5%, 1.5rem);
        padding: 0.35rem 1rem;
        /* transform: scaleY(0.95); */
        transform-origin: center;
        clip-path: polygon(7% 0%, 70% 0%, 93% 100%, 30% 100%);
        margin-right: -10%;
    }

    .command-button:not(:first-child) {
        margin-left: clamp(-1.5rem, -8%, -0.8rem);
    }

    .terminal-content-area {
        top: 7.5%;
        padding: 3%;
    }

    .terminal-output {
        font-size: clamp(0.7rem, 2vw, 1rem);
    }
}

@media (max-width: 600px) {
    .terminal-header {
        left: clamp(1%, 4vw, 3%);
        gap: 0;
    }

    .command-button {
        height: clamp(1rem, 5vw, 2rem);
        width: clamp(6rem, 60%, 8rem);
        margin-bottom: clamp(0.125rem, 0.75vw, 0.2rem);
        /* clip-path: polygon(10% 0%, 70% 0%, 90% 100%, 30% 100%); */
        aspect-ratio: 5 / 2;
        margin-right: -10%;
    }
}

@media (max-width: 480px) {
    .welcome-header {
        top: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
    }

    .welcome-greeting {
        display: none;
    }

    .welcome-content {
        top: clamp(2.75rem, 12.5vw, 4rem);
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
    }

    .command-button {
        clip-path: polygon(11% 0%, 70% 0%, 89% 100%, 30% 100%);
        padding: 0.25rem 0.5rem;
        font-size: clamp(0.75rem, 2.5vw, 1rem);
        width: clamp(5rem, 70%, 7rem);
        height: clamp(1rem, 4.5vw, 1.5rem);
        margin-right: -15%;
    }
}



/* ========== Skills Section - Base (Desktop) ========== */

.skills-section {
    padding: 3rem 3rem 5rem;
    width: 100%;
}

.skills-container {
    position: relative;
    width: 100%;
    max-width: none;
    aspect-ratio: 1340 / 337;
    margin: 0 auto;
    min-height: 380px;
    /* Prevent too small on large screens */
}

.skills-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: #fff;
    pointer-events: none;
    z-index: 2;
}

.skills-label {
    position: absolute;
    top: 1.75rem;
    left: 0.25rem;
    font-size: clamp(2.5rem, 3.5vw, 4rem);
    font-weight: 400;
    color: #fff;
    z-index: 3;
    padding: 0 1.5rem;
    background: transparent;
    transform: translateY(-50%);
}

.skills-decoration-top {
    position: relative;
    top: 9%;
    /* Match label position */
    left: 15%;
    /* Responsive left position */
    width: clamp(30rem, 55%, 55rem);
    /* Responsive width */
    height: 2rem;
    background: #fff;
    z-index: 1;
    transform: translateY(-50%);
    clip-path: polygon(1.8% 0, 85% 0, 89.3% 100%, 6.1% 100%);
}

.skills-decoration-bottom {
    position: absolute;
    bottom: .25rem;
    right: 0;
    width: clamp(8rem, 15%, 15rem);
    height: clamp(2rem, 10%, 4rem);
    background: #fff;
    z-index: 1;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 20% 100%);
}

.skills-content {
    position: absolute;
    top: 15%;
    left: 5%;
    right: 5%;
    bottom: 15%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: clamp(1.5rem, 3vw, 3rem) clamp(2rem, 4vw, 4rem);
    /* Responsive gaps */
    z-index: 1;
    padding: clamp(1rem, 3vw, 2rem);
}

.skill-icon {
    width: clamp(2.5rem, 5.5vw, 5rem);
    /* Responsive icon size */
    height: clamp(2.5rem, 5.5vw, 5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s ease;
    position: relative;
    cursor: pointer;
}

.skill-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: grayscale(100%) brightness(.8);
    transition: filter .3s ease, transform .3s ease;
}

.skill-icon:hover img {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.15);
}

.skill-tooltip {
    position: absolute;
    bottom: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #000;
    font-family: 'Iceland', cursive;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    padding: .5rem 1rem;
    border-radius: .25rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 10;
    pointer-events: none;
}

.skill-tooltip::before {
    content: '';
    position: absolute;
    top: -.5rem;
    left: 50%;
    transform: translateX(-50%);
    border-left: .5rem solid transparent;
    border-right: .5rem solid transparent;
    border-bottom: .5rem solid #FFFFFF;
}

.skill-icon:hover .skill-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ========== Tablet (769px - 1023px) ========== */
@media (max-width: 1023px) and (min-width: 769px) {
    .skills-section {
        padding: 2.5rem 2rem 4rem;
    }

    .skills-container {
        aspect-ratio: 1340 / 400;
        /* Taller on tablets */
        min-height: 380px;
    }

    .skills-label {
        font-size: clamp(1.5rem, 3.5vw, 3.5rem);
        left: 0rem;
    }

    .skills-decoration-top {
        position: relative;
        width: clamp(25rem, 50%, 45rem);
        left: 15.25%;
        top: 9%;
        height: 2rem;
    }

    .skills-decoration-bottom {
        bottom: 2%;
    }

    .skills-content {
        gap: clamp(1.5rem, 3.5vw, 2.5rem) clamp(2rem, 4.5vw, 3.5rem);
    }

    .skill-icon {
        width: clamp(3rem, 6.5vw, 4.5rem);
        height: clamp(3rem, 6.5vw, 4.5rem);
    }
}

/* ========== Small Tablet/Large Mobile (≤768px) ========== */
@media (max-width: 768px) {
    .skills-section {
        padding: 2rem 0 3rem;
    }

    .skills-container {
        aspect-ratio: 1140 / 500;
        min-height: 275px;
        width: calc(100% - 4rem);
        max-width: calc(100% - 4rem);
        margin: 0 auto;
    }

    .skills-label {
        font-size: clamp(0.25rem, 3.5vw, 2.5rem);
        left: 0rem;
        padding: 0 1rem;
    }

    .skills-decoration-top {
        position: relative;
        left: 15.8%;
        top: 8.75%;
        ;
        width: clamp(18rem, 45%, 35rem);
        height: clamp(1.5rem, 8%, 2.5rem);
        clip-path: polygon(0 0, 85% 0, 89.3% 100%, 5.5% 100%);
    }

    .skills-decoration-bottom {
        width: clamp(6rem, 18%, 10rem);
        height: clamp(1rem, 10%, 3rem);
    }

    .skills-content {
        top: 15%;
        bottom: 15%;
        gap: .05rem 2.5rem;
        padding: clamp(0.75rem, 2.5vw, 1.5rem);
    }

    .skill-icon {
        /* transform: scale(0.75); */
        margin: -0.75rem;
    }

    .skill-tooltip {
        font-size: clamp(0.75rem, 2vw, 0.9rem);
        padding: .4rem .8rem;
        bottom: -2rem;
    }
}

@media (max-width: 600px) {
    .skills-decoration-top {
        left: 15.65%;
        height: clamp(1rem, 10%, 2rem);
        width: clamp(10rem, 60%, 30rem);
    }

    .skills-label {
        font-size: clamp(.25rem, 3.75vw, 1.5rem);
        left: -1%;
    }
}

@media (max-width: 400px) {
    .skills-label {
        left: -2.5%;
    }
}


/* ========== Cipher Section - Base (Desktop 1024px+) ========== */

.cipher-section {
    padding: 3rem 3rem 6rem;
    width: 100%;
}

.cipher-frame-desktop {
    display: block;
}

.cipher-frame-mobile {
    display: none;
}

.cipher-frame-small-mobile {
    display: none;
}

.cipher-frame-smaller-mobile {
    display: none;
}

.cipher-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1340 / 847;
    margin: 0 auto;
    min-height: 500px;
    max-height: 800px;
}

.cipher-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: #fff;
    pointer-events: none;
}

.cipher-frame * {
    fill: none;
}

.cipher-frame text {
    fill: white;
}

/* Cipher title scaling */
.cipher-frame [href="#title-brackets-shape"]~g text {
    font-size: clamp(2.5rem, 3.5vw, 3.5rem);
    /* Responsive from the start */
    letter-spacing: clamp(2px, 0.5vw, 4px);
    dominant-baseline: middle;
}

.cipher-frame .title-line-top {
    transform: translateY(clamp(-1.5rem, -2vw, -2rem));
}

.cipher-frame .title-line-bottom {
    transform: translateY(clamp(1.5rem, 2vw, 2rem));
}

.cipher-frame svg {
    overflow: visible;
}

/* Wrapper for 70-30 split */
.cipher-input-wrapper {
    position: absolute;
    top: 20%;
    left: 5%;
    right: 5%;
    width: 90%;
    height: clamp(11rem, 16%, 13.6rem);
    /* Responsive height */
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

/* Cipher Input Container */
.cipher-input-container {
    position: relative;
    width: 70%;
    height: 100%;
}

.cipher-input-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #FFFFFF;
    pointer-events: none;
    z-index: 2;
}

.cipher-input-label {
    position: absolute;
    top: 12%;
    left: 0;
    font-size: clamp(0.6rem, 2.5vw, 2.5rem);
    font-weight: 400;
    color: #FFFFFF;
    padding: 0 1rem;
    z-index: 3;
    transform: translateY(-50%);
    line-height: 1;
}

.cipher-input-decoration-top {
    position: absolute;
    top: 4.8%;
    left: 15.75%;
    width: 60%;
    height: 10%;
    background: #FFFFFF;
    z-index: 1;
    clip-path: polygon(0 0, 95.5% 0, 100% 100%, 4.5% 100%);
}

.cipher-input-decoration-bottom {
    position: absolute;
    bottom: -9.25%;
    right: 0;
    width: 20%;
    height: 10%;
    background: #FFFFFF;
    z-index: 1;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 13% 100%);
}

.cipher-input-area {
    position: absolute;
    top: 20%;
    left: 1.25%;
    right: 1.25%;
    bottom: 5.5%;
    background: rgba(255, 255, 255, 0.12);
    padding: clamp(0.75rem, 1.5vw, 1rem) clamp(1rem, 2vw, 1.5rem);
    z-index: 1;
    clip-path: polygon(0 0, 97% 0, 100% 14%, 100% 100%, 8.5% 100%, 0% 65.5%);
    overflow: hidden;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    gap: 0.5rem 0.5rem;
}

.cipher-prompt {
    color: #33FF33;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: clamp(0.9rem, 1.3vw, 1.3rem);
    white-space: nowrap;
    line-height: 1.5;
    grid-column: 1;
    grid-row: 1;
    align-self: start;
}

.cipher-text-input {
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: clamp(0.9rem, 1.3vw, 1.3rem);
    line-height: 1.5;
    resize: none;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    white-space: pre-wrap;
    padding: 0;
    margin: 0;
    grid-column: 2;
    grid-row: 1 / 3;
    min-height: 1.5rem;
}

.cipher-text-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

.cipher-text-input:focus {
    outline: none;
}

.cipher-text-input::-webkit-scrollbar {
    width: 0.5rem;
}

.cipher-text-input::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
}

.cipher-text-input::-webkit-scrollbar-thumb {
    background: rgba(51, 255, 51, 0.3);
    border-radius: 0.25rem;
}

.cipher-text-input::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 255, 51, 0.5);
}

/* Run Button Area */
.cipher-run-area {
    position: relative;
    width: 30%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cipher-run-button {
    position: relative;
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-family: 'Iceland', cursive;
    font-size: clamp(1.75rem, 2.5vw, 3rem);
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: clamp(9rem, 15vw, 12rem);
    aspect-ratio: 177 / 106;
    padding: 0;
    outline: none;
}

.cipher-run-button:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(0, 191, 255, 0.6));
}

.cipher-run-button:hover .run-button-svg path {
    fill: #00BFFF;
}

.cipher-run-button:hover .run-button-svg path[opacity] {
    stroke: #00BFFF;
}

.cipher-run-button:active {
    transform: scale(0.98);
}

.run-button-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    transition: all 0.3s ease;
}

.run-button-text {
    position: relative;
    z-index: 2;
    letter-spacing: 0.08em;
    line-height: 1;
    user-select: none;
}

/* Cipher Output Boxes Wrapper */
.cipher-output-wrapper {
    position: absolute;
    bottom: 8%;
    left: 5%;
    right: 5%;
    width: 90%;
    height: 38%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1.5rem, 2.5vw, 2.25rem);
    /* Responsive gap */
    align-items: stretch;
}

/* Individual Cipher Box */
.cipher-box {
    position: relative;
    width: 100%;
    height: 100%;
}

.cipher-box-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #FFFFFF;
    pointer-events: none;
    z-index: 2;
}

.cipher-box-label-container {
    position: absolute;
    left: -8%;
    top: 36.5%;
    width: 13%;
    height: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.cipher-box-label-hexagon {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #FFFFFF;
    clip-path: polygon(50% 0, 100% 12%, 100% 88%, 50% 100%, 0 88%, 0 12%);
    z-index: 1;
}

.cipher-box-label-text {
    position: relative;
    color: #0D1117;
    font-family: 'Iceland', cursive;
    font-size: clamp(0.9rem, 1.5vw, 2rem);
    /* Scales with screen */
    font-weight: 400;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.1em;
    z-index: 2;
    transform: rotate(180deg);
}

.cipher-box-line-top {
    position: absolute;
    top: 2.5%;
    left: 3%;
    width: 28.5%;
    height: 29%;
    color: #FFFFFF;
    pointer-events: none;
    z-index: 1;
}

.cipher-box-line-bottom {
    position: absolute;
    bottom: 2.5%;
    right: 3%;
    width: 11%;
    height: 10.3%;
    color: #FFFFFF;
    pointer-events: none;
    z-index: 1;
}

.cipher-box-decoration-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 21%;
    height: 17%;
    background: #FFFFFF;
    z-index: 1;
    clip-path: polygon(0 0, 17% 25%, 17% 60%, 42% 83%, 75% 83%, 100% 100%, 0 100%);
}

.cipher-box-content {
    position: absolute;
    top: 8%;
    left: 7%;
    right: 4%;
    bottom: 6%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    z-index: 1;
}

.cipher-output-text {
    margin: 0;
    color: #33FF33;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: clamp(0.7rem, 0.95vw, 1rem);
    /* Responsive */
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.cipher-box-content::-webkit-scrollbar {
    width: 0.4rem;
}

.cipher-box-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.cipher-box-content::-webkit-scrollbar-thumb {
    background: rgba(51, 255, 51, 0.3);
    border-radius: 0.2rem;
}

.cipher-box-content::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 255, 51, 0.5);
}

.cipher-hexagon-decoration {
    position: absolute;
    bottom: 1.75%;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(22%, 28vw, 28%);
    height: 4%;
    background: #FFFFFF;
    z-index: 1;
    clip-path: polygon(4% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0 50%);
}

/* ========== Tablet (769px - 1023px) ========== */
@media (max-width: 1023px) and (min-width: 769px) {
    .cipher-section {
        padding: 2.5rem 2rem 5rem;
    }

    .cipher-container {
        aspect-ratio: 1340 / 1000;
        /* Taller for more space */
        min-height: 600px;
    }

    .cipher-input-wrapper {
        top: 18%;
    }

    .cipher-output-wrapper {
        bottom: 8%;
        height: 40%;
        /* More space for output */
        gap: clamp(1.25rem, 2vw, 1.75rem);
    }
}

/* ========== Small Tablet (≤768px) ========== */
@media (max-width: 768px) {
    .cipher-section {
        padding: 2rem 2rem 4rem;
    }

    .cipher-frame-desktop {
        display: none;
    }

    .cipher-frame-mobile {
        display: block;
    }

    .cipher-container {
        aspect-ratio: 1340 / 1300;
        /* Much taller */
        min-height: 1000px;
        width: calc(100% - 2rem);
        margin: 0 auto;
    }

    .title-dual-line {
        display: block;
    }

    .title-single-line {
        display: none;
    }

    .cipher-frame use[href="#title-brackets-shape"] {
        display: none;
    }

    /* Reduce title text size and spacing */
    .cipher-frame-mobile .title-line-top,
    .cipher-frame-mobile .title-line-bottom {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
        font-weight: 600;
        letter-spacing: clamp(25px, 0.6vw, 5px);
    }

    .cipher-frame .title-line-top {
        transform: translateY(clamp(-0.75rem, -1.5vw, -1rem));
        /* Less vertical spacing */
    }

    .cipher-frame .title-line-bottom {
        transform: translateY(clamp(0.75rem, 1.5vw, 1rem));
        /* Less vertical spacing */
    }

    /* Stack input and button */
    .cipher-input-wrapper {
        top: 17.5%;
        flex-direction: row;
        height: auto;
        gap: 1rem;
    }

    .cipher-input-container {
        width: 75%;
        height: 8rem;
    }

    .cipher-input-label {
        left: -0.5rem;
    }

    .cipher-input-decoration-top {
        left: 16%;
        width: 55%;
    }

    .cipher-text-input {
        font-size: clamp(0.75rem, 1.5vw, 1.1rem);
    }

    .cipher-prompt {
        font-size: clamp(0.75rem, 1.5vw, 1.1rem);
    }

    .cipher-run-area {
        width: 25%;
        height: 8rem;
        transform: scale(0.75);
    }

    /* 2x2 grid for output boxes */
    .cipher-output-wrapper {
        left: 6.5%;
        bottom: 8%;
        height: 55%;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 3rem;
    }

    .cipher-box-label-container {
        left: -10%;
        width: 16%;
        height: 32%;
        top: 40%;
        transform: scaleY(1.25);
    }

    .cipher-hexagon-decoration {
        bottom: 2.95%;
        width: 34%;
        height: 2.5%;
        /* Inverted trapezium shape */
        clip-path: polygon(5% 0,
                /* Top left */
                95% 0,
                /* Top right */
                87.5% 70%,
                /* Bottom right */
                12.5% 70%
                /* Bottom left */
            );
    }

    .cipher-frame-mobile {
        display: block;
    }

    .cipher-frame-small-mobile {
        display: none;
    }

}

@media (max-width: 600px) {
    .cipher-frame-small-mobile {
        display: none;
    }
    
    .run-button-text {
        font-size: 0;
    }

    .run-button-text::before {
        content: attr(data-text-full);
        font-size: clamp(1.5rem, 4vw, 2rem);
        /* Restore font size */
    }

    .title-dual-line {
        display: none;
    }

    .title-single-line {
        display: block;
        font-size: clamp(1.85rem, 6vw, 2.5rem);
        letter-spacing: clamp(25px, 0.1vw, 6px);
    }

    .cipher-frame-mobile {
        display: none;
    }

    .cipher-frame-small-mobile {
        display: block;
    }


}

@media (max-width: 480px) {

    .cipher-frame-small-mobile {
        display: none;
    }

    .cipher-frame-smaller-mobile {
        display: block;
    }

    .cipher-container {
        position: relative;
        width: 100%;
        /* aspect-ratio: 1340 / 2105; */
        min-height: 1400px;
        overflow: visible;
    }

    .cipher-frame-smaller-mobile {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    /* OUTPUT BOXES - SINGLE COLUMN LAYOUT */
    .cipher-output-wrapper {
        top:22%;
        height: 75%;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        gap: 2rem;
        width: 75%;
        max-width: 225px;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Labels now work normally - no stretching! */
    .cipher-box-label-container {
        left: -10%;
        width: 15%;
        height: 40%;
        /* Normal percentage now */
        top: 36.5%;
        transform: none;
    }

    .cipher-box-label-text {
        font-size: clamp(1rem, 2.5vw, 1.5rem);
    }

    /* Change flex direction to stack vertically */
    .cipher-input-wrapper {
        flex-direction: column;
        height: auto;
        gap: 0.25rem;
        top: 6%;
    }

    /* Input takes full width */
    .cipher-input-container {
        width: 100%;
        height: 8rem;
    }

    /* Run button takes full width and appears below */
    .cipher-run-area {
        width: 100%;
        height: 6rem;
        transform: scale(.5);
        /* Reset scale */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Adjust button size for better fit */
    .cipher-run-button {
        top: -10%;
        max-width: 10rem;
        font-size: clamp(1.5rem, 4vw, 2rem);
    }

    .run-button-text {
        font-size: 0;
    }

    .run-button-text::before {
        content: attr(data-text-full);
        font-size: clamp(2.5rem, 4vw, 2rem);
        /* Restore font size */
    }

    .cipher-hexagon-decoration {
        bottom: .35%;
        width: 34%;
        height: 2%;
        /* Inverted trapezium shape */
        clip-path: polygon(5% 30%,
                            95% 30%,
                            87.5% 100%,
                            12.5% 100%);
    }

}


/* ========== Contact Section - Base (Desktop) ========== */

.contact-section {
    padding: 3rem 3rem;
    width: 100%;
}

.contact-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Desktop/Tablet (placeholders hidden; labels visible) */
.form-input::placeholder,
.form-textarea::placeholder {
    color: transparent;
    opacity: 0;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Left Contact Form - 60% */
.contact-form-wrapper {
    position: relative;
    width: 60%;
    aspect-ratio: 750 / 600;
}

.contact-form-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #FFFFFF;
    pointer-events: none;
    z-index: 2;
}

.contact-label {
    position: absolute;
    top: -3%;
    left: 22%;
    font-size: clamp(2rem, 4vw, 4.5rem);
    font-weight: 400;
    color: #FFFFFF;
    padding: 0 1.5rem;
    z-index: 3;
    letter-spacing: 0.15em;
}

.contact-line-top-left {
    position: absolute;
    top: 3%;
    left: 0;
    width: 27%;
    height: 4.3%;
    color: #FFFFFF;
    pointer-events: none;
    z-index: 1;
}

.contact-line-top-right {
    position: absolute;
    top: 2.5%;
    right: 2%;
    width: 28%;
    height: 23%;
    color: #FFFFFF;
    pointer-events: none;
    z-index: 1;
}

.contact-decoration-bottom-right {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26.7%;
    height: 33.3%;
    background: #FFFFFF;
    z-index: 1;
    clip-path: polygon(90% 10%, 100% 0, 100% 100%, 0 100%, 10% 90%, 75% 90%, 90% 75%);
}

.contact-pattern-bottom-left {
    position: absolute;
    bottom: 0;
    left: -0.5%;
    width: 3.3%;
    height: 40.7%;
    color: #FFFFFF;
    pointer-events: none;
    z-index: 1;
}

/* Form Content Area */
.contact-form-content {
    position: absolute;
    top: 15%;
    left: 5%;
    right: 10%;
    /* More space for submit button */
    bottom: 10%;
    padding: clamp(1rem, 2.5vw, 2rem);
    z-index: 1;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2vw, 2rem);
    height: 100%;
}

/* Form Group */
.form-group {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: clamp(0.5rem, 1vw, 1rem);
    align-items: center;
}

.form-group-message {
    align-items: flex-start;
    flex: 1;
    position: relative;
}

/* Form Label - Responsive */
.form-label {
    color: #FFFFFF;
    font-family: 'Iceland', cursive;
    font-size: clamp(1.2rem, 1.8vw, 2rem);
    /* Made responsive */
    white-space: nowrap;
}

/* Colon - Responsive */
.form-colon {
    color: #FFFFFF;
    font-family: 'Iceland', cursive;
    font-size: clamp(1.2rem, 1.8vw, 2rem);
    /* Made responsive */
}

/* Form Input - Responsive */
.form-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #FFFFFF;
    outline: none;
    color: #FFFFFF;
    font-family: 'Iceland', cursive;
    font-size: clamp(1rem, 1.5vw, 1.8rem);
    /* Made responsive */
    padding: 0.5rem 0;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-bottom-color: #00BFFF;
}

/* Form Textarea - Responsive */
.form-textarea {
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1.3rem);
    /* Made responsive */
    padding: 0.5rem 0;
    resize: none;
    --line-height: clamp(1.8rem, 3.5vw, 4.2rem);
    /* Responsive line height */
    line-height: var(--line-height);
    height: calc(var(--line-height) * 4.25);
    /* Approx. 4 lines */
    transition: all 0.3s ease;

    background-size: 100% var(--line-height);
    background-position: 0 0;
    background-repeat: repeat-y;
    background-image: repeating-linear-gradient(to bottom,
            transparent 0,
            transparent calc(100% - 2px),
            #FFFFFF calc(100% - 2px),
            #FFFFFF 100%);
}

.form-textarea:focus {
    background-image: repeating-linear-gradient(to bottom,
            transparent 0,
            transparent calc(100% - 2px),
            #00BFFF calc(100% - 2px),
            #00BFFF 100%);
}

/* Submit Button - Responsive positioning */
.form-submit-button {
    position: absolute;
    bottom: -1rem;
    right: -1rem;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    width: clamp(3.5rem, 6vw, 5rem);
    /* Responsive size */
    height: clamp(3.5rem, 6vw, 5rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-submit-button:hover {
    transform: scale(1.2);
}

.form-submit-button:active {
    transform: scale(0.9);
}

.submit-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: brightness(1) drop-shadow(0 0 0 transparent);
}

.form-submit-button:hover .submit-icon {
    filter:
        brightness(1.2) drop-shadow(0 0 15px rgba(51, 255, 51, 0.8)) drop-shadow(0 0 30px rgba(51, 255, 51, 0.4));
    transform: scale(1.1);
}

/* Right Side - 40% */
.contact-right-wrapper {
    width: 40%;
    display: flex;
    flex-direction: column;
    gap: clamp(2.5rem, 4vw, 4rem);
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2vw, 2rem);
}

/* Hacker Image Container */
.hacker-image-container {
    position: relative;
    width: 100%;
    max-width: clamp(25rem, 35vw, 35rem);
    display: flex;
    justify-content: center;
    align-items: center;
}

.hacker-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    /* filter: drop-shadow(0 0 20px rgba(51, 255, 51, 0.3)); */
    transition: all 0.3s ease;
}

.hacker-image:hover {
    /* filter: drop-shadow(0 0 30px rgba(51, 255, 51, 0.5)); */
    transform: scale(1.02);
}

/* Social Icons Container */
.social-icons-container {
    display: flex;
    gap: clamp(1.5rem, 3vw, 3rem);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;

}

/* Individual Social Icon Links */
.social-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(3.5rem, 5.5vw, 4.5rem);
    height: clamp(3.5rem, 5.5vw, 4.5rem);
    background: transparent;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-icon-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.social-icon-link:hover::before {
    left: 100%;
}

.social-icon-link:hover {
    background: #FFFFFF;
    border-color: #FFFFFF;
    transform: scale(1.1) rotateY(10deg);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.social-icon-link:active {
    transform: scale(0.95);
}

/* Social Icon Images */
.social-icon-img {
    width: 50%;
    height: 50%;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: brightness(0) invert(1);
    /* Makes icons white */
}

.social-icon-link:hover .social-icon-img {
    filter: brightness(0) invert(0);
    /* Makes icons black on hover */
    transform: scale(1.1);
}

/* Individual icon hover colors */
/* LinkedIn Blue */
.social-icon-link:nth-child(1):hover {
    background: #0077B5;
    border-color: #0077B5;
}

.social-icon-link:nth-child(1):hover .social-icon-img {
    filter: brightness(0) invert(1);
    /* Keep white for colored background */
}

/* GitHub Gray */
.social-icon-link:nth-child(2):hover {
    background: #333;
    border-color: #333;
}

.social-icon-link:nth-child(2):hover .social-icon-img {
    filter: brightness(0) invert(1);
    /* Keep white for dark background */
}

/* Twitter/X Blue */
.social-icon-link:nth-child(3):hover {
    background: #1DA1F2;
    border-color: #1DA1F2;
}

.social-icon-link:nth-child(3):hover .social-icon-img {
    filter: brightness(0) invert(1);
    /* Keep white for colored background */
}

/* Email Green */
.social-icon-link:nth-child(4):hover {
    background: #33FF33;
    border-color: #33FF33;
}

.social-icon-link:nth-child(4):hover .social-icon-img {
    filter: brightness(0) invert(0);
    /* Black for bright green background */
}

/* ========== Tablet (769px - 1023px) ========== */
@media (max-width: 1023px) and (min-width: 769px) {
    .contact-section {
        padding: 2.5rem 2rem;
    }

    .contact-container {
        gap: 1.5rem;
    }

    /* Contact Form Wrapper */
    .contact-form-wrapper {
        width: 60%;
        /* Slightly smaller */
    }

    .contact-label {
        font-size: clamp(1.8rem, 3.5vw, 3.5rem);
        left: 20%;
        padding: 0 1.25rem;
    }

    /* Form Content */
    .contact-form-content {
        top: 15%;
        left: 5%;
        right: 12%;
        bottom: 10%;
        padding: clamp(0.85rem, 2vw, 1.75rem);
    }

    .contact-form {
        gap: clamp(0.85rem, 1.8vw, 1.75rem);
    }

    /* Form Elements */
    .form-group {
        gap: clamp(0.4rem, 0.9vw, 0.85rem);
    }

    .form-label,
    .form-colon {
        font-size: clamp(1.1rem, 1.6vw, 1.75rem);
    }

    .form-input {
        font-size: clamp(0.95rem, 1.4vw, 1.6rem);
        padding: 0.4rem 0;
    }

    /* Textarea with adjusted line height */
    .form-textarea {
        font-size: clamp(0.8rem, 1.1vw, 1.2rem);
        --line-height: clamp(1.7rem, 4vw, 4.5rem);
        height: calc(var(--line-height) * 4);
    }

    /* Submit Button */
    .form-submit-button {
        bottom: -1.75rem;
        right: -0.75rem;
        width: clamp(3.25rem, 5.5vw, 4.5rem);
        height: clamp(3.25rem, 5.5vw, 4.5rem);
    }

    /* Right Side */
    .contact-right-wrapper {
        width: 40%;
        /* Slightly larger to fill space */
        gap: clamp(2.25rem, 3.5vw, 3.5rem);
        padding: clamp(0.85rem, 1.75vw, 1.75rem);
    }

    .hacker-image-container {
        max-width: clamp(18rem, 28vw, 30rem);
    }

    .social-icons-container {
        gap: clamp(.75rem, 1.5vw, 2rem);
        flex-wrap: nowrap;
    }

    .social-icon-link {
        width: clamp(2.75rem, 6vw, 4.25rem);
        height: clamp(2.75rem, 6vw, 4.25rem);
    }
}

/* ========== Small Tablet (≤768px) ========== */
@media (max-width: 768px) {
    .contact-section {
        padding: 2rem 5rem;
        /* Increased padding for more space */
    }

    .contact-container {
        flex-direction: column;
        gap: 0;
        /* No gap - icons directly below form */
        position: relative;
        /* For background image positioning */
    }

    /* Contact Form - Full Width with background image */
    .contact-form-wrapper {
        width: 100%;
        aspect-ratio: 750 / 680;
        /* Slightly taller for better proportions */
        min-height: 450px;
        position: relative;
        margin-bottom: 2rem;
        /* Space for icons below */
    }

    /* Hacker Image as Background */
    .hacker-image-container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 75%;
        /* Larger as background */
        max-width: none;
        opacity: 1;
        /* Semi-transparent background */
        z-index: 0;
        pointer-events: none;
    }

    .hacker-image {
        width: 100%;
        /* height: auto; */
    }

    .contact-label {
        font-size: clamp(1rem, 5vw, 2.5rem);
        left: 22.5%;
        padding: 0 clamp(0.75rem, 2vw, 1.5rem);
    }

    .contact-form-content {
        position: absolute;
        top: 15%;
        right: 10%;
        bottom: 8%;
        padding: clamp(0.75rem, 1.8vw, 1.2rem);
        z-index: 1;
        /* Above background image */
        overflow: hidden;
    }

    .contact-form {
        gap: clamp(1.5rem, 4vw, 5.75rem);
        /* Increased gap */
        height: 100%;
    }

    .form-group {
        gap: clamp(0.4rem, 0.8vw, 0.7rem);
    }

    .form-group-message {
        flex: 1;
        min-height: 0;
    }

    .form-label,
    .form-colon {
        font-size: clamp(1.1rem, 2.8vw, 1.6rem);
    }

    .form-input {
        font-size: clamp(1rem, 2.2vw, 1.4rem);
    }

    /* Textarea with increased line height */
    .form-textarea {
        font-size: clamp(0.85rem, 2vw, 1.2rem);
        --line-height: clamp(2rem, 5.5vw, 5rem);
        /* Increased line height */
        /* height: 100%; */
        min-height: calc(var(--line-height) * 4);
    }

    .form-submit-button {
        position: absolute;
        bottom: 2%;
        right: 2%;
        width: clamp(3.5rem, 8vw, 4.5rem);
        height: clamp(3.5rem, 8vw, 4.5rem);
        z-index: 2;
    }

    /* Right Side - Reordered with icons below form */
    .contact-right-wrapper {
        width: 100%;
        gap: 0;
        padding: 0;
        flex-direction: column-reverse;
        /* Icons on top, image below (but image is background) */
    }

    /* Social Icons - Positioned below contact box */
    .social-icons-container {
        gap: clamp(1.25rem, 2.5vw, 2.25rem);
        padding: 0 1rem;
        justify-content: center;
        flex-wrap: nowrap;
        /* Keep in one row */
        order: 2;
        /* Ensure icons appear after form */
    }

    .social-icon-link {
        width: clamp(3rem, 7vw, 4rem);
        /* Slightly larger */
        height: clamp(3rem, 7vw, 4rem);
        border-width: 2px;
    }
}

@media (max-width: 480px) {
    .contact-container {
        width: 100%;
    }
    .contact-line-top-left {
        display: none;
    }

    .contact-label {
        font-size: clamp(1rem, 6vw, 5rem);
        left: 5%;
        /* padding: 0 clamp(0.75rem, 2vw, 1.5rem); */
    }

    .form-input::placeholder,
    .form-textarea::placeholder {
        color: rgba(255, 255, 255, 0.65);
        /* adjust for theme contrast */
        opacity: 1;
    }

    /* Make the form area use the full inner width */
    .contact-form-content {
        left: 5%;
        right: 5%;
        /* was 10% to leave room for button; we’ll move button */
        bottom: 10%;
    }

    /* Hide label + colon to free horizontal space */
    .form-label,
    .form-colon {
        display: none;
    }

    /* Collapse 3-column grid to a single column so input spans full width */
    .form-group {
        display: block !important;
        /* simpler than redefining grid */
        margin-bottom: clamp(0.75rem, 3vw, 1rem);
    }

    /* Inputs / textarea stretch */
    .form-input,
    .form-textarea {
        width: 100%;
    }

    /* Give the textarea a bit more vertical room on small screens */
    .form-textarea {
        --line-height: clamp(1.8rem, 6vw, 2.4rem);
        height: calc(var(--line-height) * 5);
    }

    /* Reposition submit button inside the content edge so we can use full width */
    .form-submit-button {
        bottom: 0;
        right: 0.75rem;
        width: clamp(2.75rem, 8vw, 3.5rem);
        height: clamp(2.75rem, 8vw, 3.5rem);
    }

    /* Optional: tighten overall gaps when labels are hidden */
    .contact-form {
        gap: clamp(0.6rem, 2.25vw, 0.9rem);
    }
}

@media (max-width: 360px) {
    .contact-label {
        transform: scaleX(0.6);
        left: -15%;
        font-size: clamp(0.15rem, 8vw, 3.5rem);
    }
}

/* ========== Footer Section - Base (Desktop) ========== */

.footer-section {
    width: 100%;
    background: #0D1117;
    padding: 0;
    margin-top: 3rem;
}

.footer-container {
    position: relative;
    width: 100%;
    height: clamp(5rem, 8vw, 6.25rem);
    /* Responsive height */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer SVG */
.footer-svg {
    width: 100%;
    height: 100%;
    color: #FFFFFF;
}

/* Footer Text Overlay */
.footer-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Iceland', cursive;
    font-size: clamp(1rem, 4.25vw, 3.75rem);
    /* Responsive font size */
    font-weight: 900;
    color: #0D1117;
    letter-spacing: clamp(0.1em, 0.15vw, 0.15em);
    /* Responsive spacing */
    z-index: 2;
    pointer-events: none;
    text-shadow: 1px 1px 0px #0D1117;
    white-space: nowrap;
    /* Prevent wrapping */
}

/* ========== Tablet (769px - 1023px) ========== */
@media (max-width: 1023px) and (min-width: 769px) {
    .footer-section {
        margin-top: 2.5rem;
    }

    .footer-container {
        height: clamp(4.5rem, 7vw, 5.5rem);
    }

    .footer-text-overlay {
        font-size: clamp(1.8rem, 4.5vw, 3rem);
        letter-spacing: clamp(0.08em, 0.12vw, 0.12em);
    }
}

/* ========== Small Tablet (≤768px) ========== */
@media (max-width: 768px) {
    .footer-section {
        margin-top: 2rem;
    }

    .footer-container {
        height: clamp(2rem, 8vw, 4rem);
        /* Taller on mobile */
    }

    .footer-text-overlay {
        font-size: clamp(0.5rem, 4.5vw, 2.5rem);
        /* Smaller on mobile */
        letter-spacing: clamp(0.05em, 0.1vw, 0.1em);
        font-weight: 800;
        /* Slightly lighter for mobile */
    }
}

/* ========== CONSISTENT SECTION SPACING ========== */

/* Base (Desktop) - 6rem gap between sections */
.terminal-welcome-wrapper {
  padding: 3.5rem 3rem;  /* Changed from 5rem */
}

.skills-section {
  padding: 3.5rem 3rem;  /* Changed from 3rem 3rem 5rem */
}

.cipher-section {
  padding: 3.5rem 3rem;  /* Changed from 3rem 3rem 6rem */
}

.contact-section {
  padding: 3.5rem 3rem;  /* Changed from 3rem 3rem */
}

/* Tablet (769px - 1023px) - 5rem gap */
@media (max-width: 1023px) and (min-width: 769px) {
  .terminal-welcome-wrapper {
    padding: 2.5rem 2rem;
  }
  
  .skills-section {
    padding: 2.5rem 2rem;
  }
  
  .cipher-section {
    padding: 2.5rem 2rem;
  }
  
  .contact-section {
    padding: 2.5rem 2rem;
  }
}

/* Small Tablet (≤768px) - 4rem gap */
@media (max-width: 768px) {
  .terminal-welcome-wrapper {
    padding: 2rem 1rem;
  }
  
  .skills-section {
    padding: 2rem 0 0 0;
  }
  
  .cipher-section {
    padding: 0 2rem 0 2rem;
  }
  
  .contact-section {
    padding: 4rem 5rem 0 5rem;
  }
}

/* Mobile (≤480px) - 3rem gap */
@media (max-width: 480px) {
  .terminal-welcome-wrapper {
    padding: 2rem 1rem;
  }
  
  .skills-section {
    padding: 2rem 0;
  }
  
  .cipher-section {
    padding: 0rem 2rem 2rem 2rem;
  }
  
  .contact-section {
    padding: 2rem 3rem;
  }
}