:root {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    color: #222;
}

/* Dark theme overrides (applied when `body.dark` is present) */
body.dark {
    background: #0b0b0d;
    color: #e6e6e6;
}
body.dark header,
body.dark main,
body.dark footer {
    color: inherit;
}
body.dark footer {
    background: #060608;
    color: #bfbfbf;
}
body.dark .placeholder { color: #9ea3a8; }
body.dark .btn { background: #16171a; color: #e6e6e6; border-color: #2a2a2a; }
body.dark .btn.primary { background: #1f6fff; border-color: #1f6fff; color: #fff; }
body.dark .feedback-input,
body.dark .name-input { background: #0f1113; color: #e6e6e6; border-color: #2b2b2b; }
body.dark .feedback-list li.feedback-card,
body.dark .cert-card,
body.dark .project-card {
    background: linear-gradient(180deg,#0f1113 0%, #0b0d0f 100%);
    border: 1px solid #1f1f22;
    box-shadow: 0 8px 22px rgba(0,0,0,0.6);
}

/* Ensure text inside cards and related components is visible in dark mode */
body.dark .feedback-card strong,
body.dark .project-title {
    color: #cfe6ff;
}
body.dark .feedback-card p,
body.dark .project-desc,
body.dark .cert-title,
body.dark .placeholder,
body.dark .feedback-meta {
    color: #cfcfcf;
}
body.dark .status { color: #9ad17a; }
body.dark .feedback-input::placeholder,
body.dark .name-input::placeholder {
    color: #8f979b;
}

/* Smooth transitions for theme changes */
/* keep a gentle cross-fade of background and text color */
body {
    transition: background-color 420ms ease, color 420ms ease;
}

/* Smooth transitions for cards, inputs and buttons when theme changes */
.feedback-list li.feedback-card,
.cert-card,
.project-card {
    transition: background-color 420ms ease, color 420ms ease, border-color 420ms ease, box-shadow 420ms ease;
}

.feedback-input,
.name-input,
.btn,
.btn.primary {
    transition: background-color 320ms ease, color 320ms ease, border-color 320ms ease;
}




body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 0;
}

header > div {
    margin-top: 10px;
    text-align: center;
}

.portrait {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    /* Smooth, hardware-accelerated transform for hover */
    transition: transform 260ms cubic-bezier(.2,.9,.2,1), box-shadow 260ms ease;
    will-change: transform, box-shadow;
}

/* Hover and focus interaction for portrait (wrapped in an anchor) */
header a:hover .portrait,
header a:focus-visible .portrait {
    transform: translateY(-6px) scale(1.03) rotate(-1deg);
    box-shadow: 0 16px 38px rgba(13, 35, 80, 0.18);
}

/* Keyboard accessibility: visible focus outline on anchor containing the portrait */
header a:focus-visible {
    outline: 3px solid #1f6fff;
    outline-offset: 6px;
    border-radius: 50%;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .portrait,
    header a:hover .portrait,
    header a:focus-visible .portrait {
        transition: none;
        transform: none;
        will-change: auto;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    }
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.content {
    max-width: 760px;
    width: 100%;
}

ul {
    list-style: disc;
    margin-left: 1.25rem;
}

li {
    margin: 1rem 0;
}

li h3 {
    margin: 0.1rem 0 0.4rem 0;
    font-size: 1.1rem;
}

footer {
    background: #f7f7f7;
    padding: 14px 20px;
    text-align: center;
    font-size: 0.95rem;
}

.placeholder {
    color: #555;
}

/* Feedback textarea styles */
.feedback {
    margin-top: 1.5rem;
}

.feedback h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.feedback-input {
    width: 100%;
    min-height: 120px;
    padding: 0.6rem;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #222;
    resize: vertical;
    box-sizing: border-box;
}

/* Feedback controls */
.feedback-controls{
    display:flex;
    gap:0.5rem;
    align-items:center;
    margin-bottom:0.6rem;
}

.name-input{
    flex:1;
    padding:0.45rem 0.6rem;
    border:1px solid #d0d0d0;
    border-radius:6px;
    background:#fafafa;
}

.feedback-actions{margin-top:0.6rem;display:flex;align-items:center;gap:0.75rem}

.btn{
    padding:0.45rem 0.7rem;
    border:1px solid #bbb;
    border-radius:8px;
    background:#fff;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:0.4rem;
    font-weight:600;
    text-decoration:none; /* remove underline for anchor buttons */
    color:inherit; /* keep color consistent */
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
    box-shadow: 0 6px 14px rgba(20,24,28,0.06);
    line-height:1;
}

.btn:focus{
    outline:3px solid rgba(31,111,255,0.18);
    outline-offset:3px;
}

.btn.primary{background:linear-gradient(180deg,#1f6fff 0%, #165cff 100%);color:#fff;border-color:#165cff}
.btn.primary:hover{ transform: translateY(-2px); box-shadow: 0 12px 30px rgba(23,76,170,0.16); }
.btn:hover{ transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,24,28,0.09); }
.btn:active{ transform: translateY(0); box-shadow: 0 6px 14px rgba(20,24,28,0.06); }

/* Ensure anchor elements styled as .btn don't show default link underlines */
.btn, .btn:link, .btn:visited { text-decoration: none; }

.status{color:#2b6a0b;font-size:0.95rem}

.existing-feedbacks{max-width:760px;margin:18px auto;padding:0 12px}
.existing-feedbacks h3{margin:0 0 0.5rem 0}
.existing-feedbacks .placeholder{color:#666}

.visually-hidden{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}

/* Feedback card/grid styles */
.feedback-list{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:16px;
    padding:0;
    margin:0.6rem 0 0 0;
    list-style:none;
}

.feedback-list li.feedback-card{
    background:linear-gradient(180deg,#ffffff 0%, #fbfbfb 100%);
    border:1px solid #e7e7e7;
    border-radius:10px;
    padding:12px 14px;
    box-shadow:0 6px 18px rgba(20,24,28,0.06);
    display:flex;
    flex-direction:column;
    gap:8px;
}

.feedback-card .card-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
}

.feedback-card strong{
    display:block;
    font-size:0.98rem;
    color:#0b2a66;
}

.feedback-meta{
    font-size:0.78rem;
    color:#666;
    white-space:nowrap;
}

.feedback-card p{
    margin:0;
    color:#222;
    line-height:1.35;
    font-size:0.95rem;
    word-break:break-word;
}

@media (max-width:480px){
    .feedback-list{grid-template-columns:1fr}
}

/* Minimal actions layout (no like/comment functionality) */
.card-actions{
    display:flex;
    gap:8px;
    align-items:center;
    margin-top:6px;
}

/* Carousel image adjustments */
.carousel-item img{ 
    max-height:360px;
    object-fit:contain;
    cursor:pointer;
}

/* Certifications grid */
.cert-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
    gap:12px;
    padding:0;
    margin:0.6rem 0 0 0;
    list-style:none;
}

.cert-card{
    background:linear-gradient(180deg,#ffffff 0%, #fbfbfb 100%);
    border:1px solid #e7e7e7;
    border-radius:10px;
    padding:10px;
    box-shadow:0 6px 18px rgba(20,24,28,0.04);
    display:flex;
    flex-direction:column;
    gap:8px;
    align-items:center;
}

.cert-card img{
    width:100%;
    height:120px;
    object-fit:cover;
    border-radius:6px;
    display:block;
}

/* Hover animation for certificate cards */
.cert-card{
    transition: transform 220ms cubic-bezier(.2,.9,.2,1), box-shadow 220ms ease, background-color 220ms ease;
}
.cert-card:hover{
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 14px 30px rgba(20,24,28,0.12);
}
.cert-card:active{
    transform: translateY(-2px) scale(1.01);
}
.cert-card img{cursor:pointer}

.cert-title{font-size:0.85rem;color:#333;text-align:center;padding:4px 2px}

@media (max-width:480px){
    .cert-card img{height:100px}
}

/* Projects grid (matches certificates design without images) */
.project-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:12px;
    padding:0;
    margin:0.6rem 0 0 0;
    list-style:none;
}
.project-card{
    background:linear-gradient(180deg,#ffffff 0%, #fbfbfb 100%);
    border:1px solid #e7e7e7;
    border-radius:10px;
    padding:12px;
    box-shadow:0 6px 18px rgba(20,24,28,0.04);
    display:flex;
    flex-direction:column;
    gap:8px;
    align-items:flex-start;
}
.project-title{font-weight:600;color:#0b2a66;font-size:0.98rem}
.project-desc{font-size:0.92rem;color:#333}
.project-actions{margin-top:6px;width:100%;display:flex;justify-content:flex-end;gap:8px}
.project-actions .btn{padding:0.5rem 0.85rem;font-size:0.95rem;min-width:92px}

/* Responsive: center buttons on small screens and allow full-width tap targets */
@media (max-width:480px){
    .project-actions{justify-content:center}
    .project-actions .btn{width:100%;max-width:380px}
}

@media (max-width:480px){
    .project-grid{grid-template-columns:1fr}
}

/* Timeline styles for Achievements */
.timeline{
    position:relative;
    padding:18px 0 18px 28px;
    margin:8px 0 0 0;
}
.timeline::before{
    content:"";
    position:absolute;
    left:28px;
    top:0;
    bottom:0;
    width:3px;
    background:#e6e6e6;
    border-radius:2px;
}
.timeline-item{
    position:relative;
    margin:12px 0 12px 48px;
    padding:12px 14px;
    background:linear-gradient(180deg,#ffffff 0%, #fbfbfb 100%);
    border:1px solid #e8e8e8;
    border-radius:10px;
    box-shadow:0 8px 20px rgba(20,24,28,0.06);
}
.timeline-item::before{
    content:"";
    position:absolute;
    left:-38px;
    top:18px;
    width:14px;
    height:14px;
    background:#0066cc;
    border-radius:50%;
    border:3px solid #fff;
    box-shadow:0 4px 10px rgba(0,0,0,0.08);
}
.timeline-time{
    display:block;
    font-size:0.82rem;
    color:#6b6f75;
    margin-bottom:6px;
}
.timeline-title{margin:0 0 6px 0;font-size:1rem;color:#0b2a66}
.timeline-desc{margin:0;color:#333;font-size:0.95rem}

@media (min-width:760px){
    /* Use a two-column layout with a centered vertical line */
    .timeline{
        position:relative;
        padding:28px 0;
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:0 20px;
        align-items:start;
    }
    .timeline::before{
        content:"";
        position:absolute;
        left:50%;
        top:0;
        bottom:0;
        width:3px;
        background:#e6e6e6;
        border-radius:2px;
        transform:translateX(-50%);
    }
    .timeline-item{
        width:46%;
        margin:18px 0;
        margin-left:0;
        padding:16px;
        box-sizing:border-box;
        position:relative;
        clear:both;
    }
    /* left column */
    .timeline-item:nth-child(odd){
        justify-self:end;
        text-align:right;
    }
    /* right column */
    .timeline-item:nth-child(even){
        justify-self:start;
        text-align:left;
    }
    .timeline-item::before{
        content:"";
        position:absolute;
        top:26px;
        width:14px;
        height:14px;
        background:#0066cc;
        border-radius:50%;
        border:3px solid #fff;
        box-shadow:0 4px 10px rgba(0,0,0,0.08);
    }
    .timeline-item:nth-child(odd)::before{ right:-9px; left:auto; }
    .timeline-item:nth-child(even)::before{ left:-9px; right:auto; }

    /* ensure the layout doesn't collapse when floats were previously used */
    .timeline:after{ content:""; display:table; clear:both }
}

/* Dark mode adjustments for timeline */
body.dark .timeline::before{background:#1f1f22}
body.dark .timeline-item{background:linear-gradient(180deg,#0f1113 0%, #0b0d0f 100%);border-color:#1f1f22}
body.dark .timeline-item::before{background:#1f6fff}
body.dark .timeline-title{color:#cfe6ff}
body.dark .timeline-desc{color:#cfcfcf}
