/* ==========================================
   Webcraft — main.css
   RESTORED baseline + additive-only tweaks
========================================== */

/* =========================
   Reset
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body,
h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ol,
ul {
  margin: 0;
  padding: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================
   Skip link (a11y)
========================= */
.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.92);
  color: var(--text);
}

.skip-link:focus {
  left: 12px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================
   Tokens / Design System
========================= */
:root {
  --bg: #121212;
  --panel: rgba(32, 32, 32, 0.65);
  --panel-strong: rgba(32, 32, 32, 0.8);
  --field: rgba(18, 18, 18, 0.6);
  --border: rgba(255, 255, 255, 0.08);

  --text: #ffffff;
  --muted: #a1a1a1;
  --accent: #00fff5;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;

  --s1: 8px;
  --s2: 12px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 48px;

  /* Constraint: fixed sidebar width */
  --sidebar-w: 420px;

  --content-max: 1200px;
  --main-pad: clamp(22px, 3.4vw, 52px);
}

/* =========================
   Base
========================= */
body {
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

p {
  color: var(--muted);
}

/* =========================
   Layout
========================= */
.app {
  display: flex;
  height: 100vh;
}

/* =========================
   Sidebar
========================= */
.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  padding: var(--s5) var(--s4);
  border-right: 1px solid var(--border);
  background: rgba(28, 28, 28, 0.65);

  /* allow sidebar to scroll if content gets long */
  overflow-y: auto;
}

.sidebar__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  min-height: 0;
}

/* =========================
   Profile block
========================= */
.profile {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--s3);
  align-items: center;
}

.profile__meta {
  min-width: 0;
}

.profile__avatar {
  width: 88px;
  height: 88px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.5);
}

.profile__name {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Desktop: allow 2 lines instead of ellipsis */
.profile__role {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  overflow-wrap: anywhere;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* 2 lines */
  line-clamp: 2;
}

/*
   MOBILE: Sidebar profile role
*/
@media (max-width: 820px) {
  .profile {
    grid-template-columns: 72px 1fr;
    gap: 14px;
  }

  .profile__avatar {
    width: 72px;
    height: 72px;
  }

  .profile__name {
    font-size: 1.35rem;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.15;
  }

  .profile__role {
    font-size: 0.95rem;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.35;

    /* helps long words / pipes wrap nicely */
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

.sidebar__divider {
  height: 1px;
  background: var(--border);
  width: 100%;
}

.sidebar__block {
  display: grid;
  gap: var(--s3);
}

/* =========================
   Shared label style
========================= */
.sidebar__label,
.meta__label,
.techstack__title,
.softwares__title {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* =========================
   Meta list
========================= */
.meta {
  display: grid;
  gap: var(--s2);
}

.meta__row {
  display: grid;
  gap: 6px;
}

.meta__value {
  font-size: 0.95rem;
}

.link {
  color: var(--accent);
}

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

/* =========================
   Social icons
========================= */
.social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social__btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.5);
  display: grid;
  place-items: center;
}

.social__btn:hover {
  border-color: rgba(0, 255, 245, 0.35);
  background: rgba(0, 255, 245, 0.06);
}

.sidebar__footer {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.85rem;
}

/* =========================
   Tech Stack (Sidebar Icons)
========================= */
.techstack {
  display: grid;
  gap: 10px;
}

.techstack__icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.techstack__btn {
  cursor: default;
}

.techstack__btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.techstack__btn:hover img {
  opacity: 1;
}

/* =========================
   Softwares (Sidebar Icons)
========================= */
.softwares {
  display: grid;
  gap: 10px;
}

.softwares__icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.softwares__btn {
  cursor: default;
}

.softwares__btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.softwares__btn:hover img {
  opacity: 1;
}

/* =========================
   Main
========================= */
.main {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  height: 100vh;
  overflow-y: auto;
  padding: var(--main-pad);
}

.main__inner {
  max-width: var(--content-max);
  margin-inline: auto;
}

/* =========================
   Topbar
========================= */
.topbar {
  margin-bottom: clamp(22px, 3vw, 40px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(18px, 2.3vw, 28px);
  box-shadow: var(--shadow);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}

.topbar__left {
  display: grid;
  gap: 10px;
}

.topbar__title {
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.topbar__underline {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(0, 255, 245, 0.25);
}

/* =========================
   Tabs
========================= */
.tabs {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.4);
  flex-shrink: 0;
}

.tabs__btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  min-height: 44px;
  white-space: nowrap;
}

.tabs__btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

.tabs__btn.is-active {
  color: var(--accent);
  border-color: rgba(0, 255, 245, 0.4);
  background: rgba(0, 255, 245, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 255, 245, 0.08);
}

/* =========================
   Mobile Dropdown Tabs
========================= */
.navToggle {
  display: none; /* desktop hidden */
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.45);
  color: var(--text);
  cursor: pointer;
  place-items: center;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 120ms ease;
}

.navToggle:hover {
  border-color: rgba(0, 255, 245, 0.35);
  background: rgba(0, 255, 245, 0.06);
}

.navToggle:active {
  transform: translateY(1px);
}

.navToggle__icon {
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  color: var(--accent);
}

/* Mobile behavior hamburger */
@media (max-width: 820px) {
  .topbar {
    position: relative;
    z-index: 1000;

    /* stack title + hamburger + dropdown nicely */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  /* show hamburger */
  .navToggle {
    display: flex; /* was grid */
    width: 100%; /* FULL WIDTH */
    height: 48px; /* nicer tap target */
    border-radius: 16px;

    align-items: center;
    justify-content: center; /* center icon */
  }

  /* keep icon centered */
  .navToggle__icon {
    font-size: 20px;
    line-height: 1;
  }

  /* turn tabs into dropdown panel */
  .tabs {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    left: 0;

    display: grid;
    gap: 10px;

    padding: 12px;
    border-radius: var(--r-xl);
    border: 1px solid var(--border);
    background: rgba(18, 18, 18, 0.92);
    box-shadow: var(--shadow);
    z-index: 1000;

    /* hidden by default */
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
      opacity 160ms ease,
      transform 160ms ease;
  }

  /* open state */
  .topbar.is-menu-open .tabs {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* make buttons full-width */
  .tabs__btn {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    border-radius: 14px;
  }
}

/* =========================
   Pages (Tab panels)
========================= */
.page {
  display: none;
}

.page.is-active {
  display: block;
}

/* =========================
   Sections
========================= */
.section {
  margin: 0 0 clamp(26px, 3vw, 44px);
}

.section__title {
  font-size: 1.25rem;
  font-weight: 900;
  margin-bottom: 12px;
}

.section__lead {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.section__text {
  max-width: 84ch;
  margin-bottom: 14px;
}

/* =========================
   About badges + bullets
========================= */
.about__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 14px;
}

.badge {
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid rgba(0, 255, 245, 0.35);
  background: rgba(0, 255, 245, 0.08);
  padding: 7px 12px;
  border-radius: 999px;
}

.about__bullets {
  margin: 6px 0 16px;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.about__bullets li {
  color: var(--muted);
}

/* =========================
   Cards grid
========================= */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin-top: var(--s3);
  align-items: start;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(16px, 2vw, 24px);
  box-shadow: var(--shadow);
  align-self: start;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.card:hover {
  border-color: rgba(0, 255, 245, 0.22);
  background: rgba(32, 32, 32, 0.78);
}

.card__title {
  font-weight: 900;
  margin-bottom: 8px;
}

.card__text {
  color: var(--muted);
}

/* =========================
   Accordion layout (Option 2)
========================= */
.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card__copy {
  min-width: 0;
}

.card__toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.45);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.card__toggle:hover {
  border-color: rgba(0, 255, 245, 0.35);
  background: rgba(18, 18, 18, 0.6);
}

.card__toggle:active {
  transform: translateY(1px);
}

.card__chev {
  display: inline-block;
  transition: transform 180ms ease;
}

.card__more[hidden] {
  display: none !important;
}

.card--expand .card__toggle[aria-expanded='true'] {
  border-color: rgba(0, 255, 245, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 255, 245, 0.08);
}

.card__divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0 12px;
}

.card__list {
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.card__list li {
  color: var(--muted);
}

/* =========================
   Testimonials Slider
========================= */
.tslider {
  position: relative;
  margin-top: var(--s3);
  padding: clamp(14px, 2vw, 20px);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.35);
  box-shadow: var(--shadow);
}

.tslider__viewport {
  overflow: hidden;
  border-radius: calc(var(--r-xl) - 2px);
  touch-action: pan-y;
}

.tslider__track {
  display: flex;
  align-items: stretch;
  gap: clamp(14px, 2vw, 22px);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.titem {
  flex: 0 0 auto;
  width: clamp(250px, 28vw, 340px);
}

/* Card box */
.tbox {
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(16px, 2vw, 22px);
  box-shadow: var(--shadow);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.tbox__head {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.tbox__avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.5);
}

.tbox__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tbox__name {
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
}

.tbox__meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.2;
}

.tbox__quote {
  color: var(--muted);
  margin: 0;
}

.titem.is-center .tbox {
  transform: scale(1.06);
  border-color: rgba(0, 255, 245, 0.35);
  background: rgba(32, 32, 32, 0.8);
  box-shadow:
    var(--shadow),
    0 0 0 3px rgba(0, 255, 245, 0.08),
    0 0 28px rgba(0, 255, 245, 0.08);
}

/* Arrows */
.tslider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.55);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.tslider__arrow:hover {
  border-color: rgba(0, 255, 245, 0.35);
  background: rgba(0, 255, 245, 0.06);
}

.tslider__arrow:active {
  transform: translateY(-50%) scale(0.98);
}

.tslider__arrow--prev {
  left: 12px;
}

.tslider__arrow--next {
  right: 12px;
}

/* Dots */
.tslider__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.tslider__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.tslider__dot:hover {
  border-color: rgba(0, 255, 245, 0.25);
}

.tslider__dot.is-active {
  background: rgba(0, 255, 245, 0.28);
  border-color: rgba(0, 255, 245, 0.5);
  transform: scale(1.2);
}

@media (max-width: 820px) {
  .tslider__arrow {
    display: none;
  }

  .titem {
    width: min(86vw, 360px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tslider__track {
    transition: none !important;
  }
  .tbox {
    transition: none !important;
  }
}

/* =========================
   Resume page
========================= */
/* Timeline */
.timeline {
  list-style: none;
  display: grid;
  gap: var(--s4);
  margin-top: var(--s3);
}

.timeline__item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: var(--s3);
  align-items: start;
}

.timeline__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 255, 245, 0.5);
  border: 1px solid rgba(0, 255, 245, 0.35);
  margin-top: 6px;
}

.timeline__content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(16px, 2vw, 24px);
  box-shadow: var(--shadow);
}

.timeline__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: 8px;
}

.timeline__title {
  font-weight: 900;
}

.timeline__date {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.timeline__desc {
  color: var(--muted);
}

.bullets {
  margin-top: 10px;
  padding-left: 18px;
}

.bullets__item {
  color: var(--muted);
  margin: 6px 0;
}

/* Cards grid - resume page */
.rgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin-top: var(--s3);
}

.rcard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(16px, 2vw, 24px);
  box-shadow: var(--shadow);
}

.rcard__title {
  font-weight: 900;
  margin-bottom: 10px;
}

.rcard__text {
  color: var(--muted);
  margin-top: 10px;
}

.rcard__text--strong {
  color: var(--text);
  font-weight: 700;
  margin-top: 0;
}

.rlist {
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.rlist li {
  color: var(--muted);
}

.rskills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin-top: var(--s3);
}

.rchips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.rchips__item {
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid rgba(0, 255, 245, 0.35);
  background: rgba(0, 255, 245, 0.08);
  padding: 7px 12px;
  border-radius: 999px;
}

@media (max-width: 1100px) {
  .rgrid,
  .rskills {
    grid-template-columns: 1fr;
  }
}

/* download button style */
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section__head .btn {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .section__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================
   PORTFOLIO PAGE
========================= */
#panel-portfolio {
  padding: 22px 22px 28px;
}

#panel-portfolio .portfolio {
  max-width: 1120px;
  margin: 0 auto;
}

#panel-portfolio .portfolio__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

#panel-portfolio .portfolio__intro {
  max-width: 560px;
}

#panel-portfolio .portfolio__title {
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 8px 0;
}

#panel-portfolio .portfolio__lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1.55;
}

/* ===== Filter Nav (clean + professional) ===== */
#panel-portfolio .pnav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 20, 20, 0.55);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#panel-portfolio .pnav__btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
  white-space: nowrap;
}

#panel-portfolio .pnav__btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 255, 220, 0.35);
}

#panel-portfolio .pnav__btn.is-active {
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 255, 220, 0.6);
  box-shadow: 0 0 0 3px rgba(0, 255, 220, 0.12);
  background: rgba(0, 255, 220, 0.1);
}

/* Portfolio Filters — Mobile Optimized (FIXED + Scoped, no discoloration overlays) */
@media (max-width: 820px) {
  #panel-portfolio .pnav {
    position: relative;

    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;

    /* edge hint without gray overlay */
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      #000 8%,
      #000 92%,
      transparent 100%
    );
    mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  }

  #panel-portfolio .pnav::-webkit-scrollbar {
    display: none;
  }

  #panel-portfolio .pnav__btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* ===== Grid ===== */
#panel-portfolio .portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

/* Hide filtered items */
#panel-portfolio .pitem.is-hidden {
  display: none;
}

/* ===== Card ===== */
#panel-portfolio .pitem {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(25, 25, 25, 0.95), rgba(12, 12, 12, 0.92));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

#panel-portfolio .ppreview {
  display: block;
  margin: 14px 14px 0 14px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#panel-portfolio .ppreview img {
  display: block;
  width: 100%;
  height: 158px;
  object-fit: cover;
}

.ppreview__placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(0, 255, 245, 0.18), rgba(255, 255, 255, 0.06));
}

/* Body */
#panel-portfolio .pbody {
  padding: 14px 16px 16px;
}

#panel-portfolio .ptitle {
  margin: 4px 0 4px 0;
  font-size: 20px;
  line-height: 1.2;
}

#panel-portfolio .psub {
  margin: 0 0 10px 0;
  font-weight: 700;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

/* Pills (your JS injects .ptag into .ptags) */
#panel-portfolio .ptags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 12px 0;
  min-height: 22px;
}

#panel-portfolio .ptag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 220, 0.35);
  background: rgba(0, 255, 220, 0.08);
  color: rgba(210, 255, 252, 0.95);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: lowercase;
}

/* Description */
#panel-portfolio .pdesc {
  margin: 0 0 12px 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
  font-size: 14px;
  min-height: 44px;
}

/* Bottom meta row */
#panel-portfolio .pmeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

#panel-portfolio .ptools {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 650;
  font-size: 13px;
}

#panel-portfolio .ptools strong {
  color: rgba(255, 255, 255, 0.85);
}

/* Button on RIGHT */
#panel-portfolio .pbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
  white-space: nowrap;
}

#panel-portfolio .pbtn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 255, 220, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 255, 220, 0.1);
  background: rgba(0, 255, 220, 0.08);
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  #panel-portfolio .portfolio__head {
    flex-direction: column;
    align-items: flex-start;
  }

  #panel-portfolio .pnav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  #panel-portfolio .pnav::-webkit-scrollbar {
    display: none;
  }

  #panel-portfolio .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #panel-portfolio {
    padding: 18px 16px 22px;
  }

  #panel-portfolio .portfolio-grid {
    grid-template-columns: 1fr;
  }

  #panel-portfolio .ppreview img {
    height: 170px;
  }
}

/* =========================
   Contact
========================= */
.contact {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(480px, 1.35fr);
  gap: clamp(18px, 2.2vw, 30px);
  align-items: start;
  margin-top: clamp(14px, 1.8vw, 24px);
}

.info-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(18px, 2.2vw, 28px);
  box-shadow: var(--shadow);
}

.info-card__title {
  font-weight: 900;
  margin-bottom: 10px;
}

.info-card__text {
  color: var(--muted);
  margin-bottom: var(--s4);
}

.info-list {
  display: grid;
  gap: var(--s3);
}

.info-list__row {
  display: grid;
  gap: 6px;
}

.info-list__label {
  font-size: 0.85rem;
  color: var(--muted);
}

.info-list__value {
  font-size: 0.95rem;
}

/* Form */
.form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(18px, 2.2vw, 28px);
  box-shadow: var(--shadow);
}

.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
}

.form__row {
  display: grid;
  gap: 8px;
  margin-bottom: var(--s3);
}

.form__label {
  font-size: 0.9rem;
  color: var(--muted);
}

.form__control {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  color-scheme: dark;
}

.form__control:focus {
  outline: none;
  border-color: rgba(0, 255, 245, 0.35);
  box-shadow: 0 0 0 3px rgba(0, 255, 245, 0.12);
  background-color: var(--bg);
}

.form__control--textarea {
  resize: vertical;
  min-height: 180px;
}

.form__actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--s3);
  margin-top: var(--s4);
}

.form__hint {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  border: 1px solid var(--border);
  background: rgba(18, 18, 18, 0.5);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
}

.btn--primary {
  border-color: rgba(0, 255, 245, 0.35);
  background: rgba(0, 255, 245, 0.08);
  color: var(--accent);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 255, 245, 0.12);
}

/* CONTACT — Responsive */
/* Tablet: stack to 1 column */
@media (max-width: 980px) {
  .contact {
    grid-template-columns: 1fr;
  }

  .contact__info,
  .contact__form {
    width: 100%;
  }
}

/* Mobile: tighten spacing + make fields easier */
@media (max-width: 640px) {
  .contact {
    gap: 16px;
  }

  .info-card,
  .form {
    padding: 16px;
    border-radius: var(--r-lg);
  }

  /* 2-column inputs -> 1 column */
  .form__grid {
    grid-template-columns: 1fr;
  }

  /* Make controls feel better on mobile */
  .form__control {
    padding: 12px 14px;
  }

  .form__control--textarea {
    min-height: 140px;
  }

  /* Actions wrap nicely */
  .form__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  /* Full-width send button on mobile */
  .form__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .form__hint {
    text-align: center;
  }
}

/* SELECT style (project type dropdown) */
.form__control--select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background: rgba(18, 18, 18, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; /* pill like nav */
  padding: 12px 44px 12px 16px; /* room for arrow */
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);

  /* subtle nav-like glow */
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);

  /* Force native controls to use dark theme where supported */
  color-scheme: dark;
}

/* Chevron arrow (same vibe as nav) */
.form__selectWrap {
  position: relative;
}

.form__selectWrap::after {
  content: '▾';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--accent);
  font-weight: 900;
  font-size: 14px;
  opacity: 0.95;
}

.form__control--select:hover {
  border-color: rgba(0, 255, 245, 0.35);
  background: rgba(0, 255, 245, 0.06);
}

.form__control--select:focus {
  outline: none;
  border-color: rgba(0, 255, 245, 0.55);
  box-shadow:
    0 0 0 3px rgba(0, 255, 245, 0.12),
    0 18px 44px rgba(0, 0, 0, 0.35);
}

/* Improve option readability (works in most Chromium browsers; others may partially ignore) */
.form__control--select option {
  background-color: #121212;
  color: #ffffff;
}

/* Keep placeholder slightly muted */
.form__control--select option[value=''] {
  color: rgba(255, 255, 255, 0.75);
}

/* =========================
   Responsive Styles for mobile entire site
========================= */
@media (max-width: 1100px) {
  :root {
    --content-max: 980px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .phead {
    flex-direction: column;
    align-items: flex-start;
  }

  /* IMPORTANT: scope to portfolio only (prevents other "pnav" from being affected) */
  #panel-portfolio .pnav {
    width: 100%;
    border-radius: var(--r-lg);
  }
}

@media (max-width: 820px) {
  .app {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .main {
    margin-left: 0;
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 24px;
  }

  .tabs {
    flex-wrap: wrap;
    border-radius: var(--r-lg);
  }

  .project__top {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* responsive styles end */

/* Prevent grid children from forcing overflow */
.cards > *,
.rgrid > *,
.rskills > *,
.contact > *,
#panel-portfolio .portfolio-grid > * {
  min-width: 0;
}

/* Make long strings (URLs/tools) wrap instead of breaking layout */
.profile__name,
.profile__role,
.meta__value,
.section__text,
.timeline__desc,
#panel-portfolio .pdesc,
#panel-portfolio .ptools {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Smooth mobile tap targets for buttons (no design change) */
button,
.tabs__btn,
.pnav__btn,
.pbtn,
.btn {
  -webkit-tap-highlight-color: transparent;
}
