/* Portfolio page: extra styles only.
   Navbar, footer, buttons and animations come from style.css */

html { scroll-padding-top: 100px; }
.section { scroll-margin-top: 100px; }

/* ---------- Hero: centred, with jump links ---------- */
.portfolio-hero { position: relative; overflow: hidden; min-height: 80vh; text-align: center; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.portfolio-hero .hero-overlay { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(8, 29, 47, 0.78) 0%, rgba(8, 29, 47, 0.68) 50%, rgba(8, 29, 47, 0.85) 100%); }
.portfolio-hero .hero-content { position: relative; z-index: 2; }
.portfolio-hero::after { z-index: 1; }
.portfolio-hero::after { content: ""; position: absolute; left: 50%; top: 50%; width: 780px; height: 780px; margin: -390px; border: 2px dashed rgba(243, 180, 41, 0.25); border-radius: 50%; animation: spin 60s linear infinite; }
.portfolio-hero h1, .portfolio-hero .hero-description { margin-inline: auto; }
.jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 44px; }
.jump a { padding: 13px 24px; border: 1.5px solid rgba(255, 255, 255, 0.35); border-radius: var(--radius); font: 600 14px "Montserrat", sans-serif; transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s; }
.jump a:hover { background: var(--yellow); color: var(--navy); border-color: var(--yellow); transform: translateY(-4px); }

/* ---------- Shared bits ---------- */
.sub-title { margin: 50px 0 24px; font: 700 13px "Montserrat", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
.sub-title:first-of-type { margin-top: 0; }
.sub-title small { display: block; margin-top: 6px; font-size: 13px; letter-spacing: 0; text-transform: none; opacity: 0.6; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips span { padding: 10px 16px; border: 1.5px solid rgba(128, 128, 128, 0.5); border-radius: var(--radius); font: 600 13px "Montserrat", sans-serif; transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s; }
.chips span:hover { background: var(--yellow); color: var(--navy); border-color: var(--yellow); transform: translateY(-3px); }

.media { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: rgba(128, 128, 128, 0.15); }
.media > * { width: 100%; height: 100%; }
.media img { display: block; object-fit: cover; border-radius: var(--radius); transition: transform 0.6s; }
.media:hover img { transform: scale(1.05); }

/* ---------- Project cards with "View details" ---------- */
.project { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 40px; margin-bottom: 20px; padding: 24px; background: var(--card); border-radius: var(--radius); transition: transform 0.3s, box-shadow 0.3s; }
.project:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(8, 29, 47, 0.12); }
.project-main { align-self: center; padding-right: 16px; }
.project .num { color: var(--yellow-hover); font: 700 12px "Montserrat", sans-serif; letter-spacing: 0.1em; }
.project h3 { margin: 14px 0 18px; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; }
.challenge { line-height: 1.7; opacity: 0.8; }
.challenge b { display: block; margin-bottom: 4px; font: 700 12px "Montserrat", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; }

.toggle { display: inline-flex; align-items: center; gap: 12px; margin-top: 26px; padding: 13px 24px; background: none; border: 1.5px solid var(--navy); border-radius: var(--radius); color: var(--navy); font: 700 14px "Montserrat", sans-serif; cursor: pointer; transition: background 0.3s, color 0.3s, transform 0.3s; }
.toggle:hover { background: var(--navy); color: var(--white); transform: translateY(-3px); }
.toggle i { transition: transform 0.4s; }
.project.open .toggle i { transform: rotate(135deg); }

/* smooth open / close */
.details { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s ease; }
.project.open .details { grid-template-rows: 1fr; }
.fields { overflow: hidden; display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.project.open .fields { padding: 14px 8px 8px; border-top: 1px solid rgba(8, 8, 8, 0.15); }
.field.full { grid-column: 1 / -1; }
.field h4, .panel h4 { margin-bottom: 10px; font: 700 12px "Montserrat", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--yellow-hover); }
.field p { line-height: 1.7; opacity: 0.8; }

/* ---------- Field systems: photo cards, text appears on hover ---------- */
.ways-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.way { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; min-height: 340px; padding: 32px; background: rgba(255, 255, 255, 0.08); border-radius: var(--radius); color: #fff; outline-offset: 4px; transition: transform 0.3s; }
.way:hover, .way:focus-visible { transform: translateY(-6px); }
.way-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.6); transform: scale(1.05); transition: filter 0.5s, transform 0.6s; }
.way::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8, 29, 47, 0.85), rgba(8, 29, 47, 0.3)); }
.way:hover .way-bg, .way:focus-visible .way-bg { filter: blur(4px) brightness(0.55); transform: scale(1.12); }
.way > span { position: absolute; top: 28px; left: 32px; color: var(--yellow); font: 700 12px "Montserrat", sans-serif; letter-spacing: 0.1em; }
.way h3 { font-size: 24px; line-height: 1.2; }
.way p { max-height: 0; margin-top: 0; overflow: hidden; font-size: 15px; line-height: 1.6; opacity: 0; transition: max-height 0.5s ease, margin-top 0.5s ease, opacity 0.5s ease; }
.way:hover p, .way:focus-visible p { max-height: 140px; margin-top: 12px; opacity: 0.95; }
@media (hover: none) { .way p { max-height: none; margin-top: 12px; opacity: 0.95; } }

/* ---------- Research tabs ---------- */
.tabs-layout { display: grid; grid-template-columns: 0.55fr 1.45fr; gap: 40px; align-items: start; }
.tab-list { position: sticky; top: 120px; display: grid; gap: 10px; }
.tab { display: flex; gap: 16px; padding: 18px 22px; background: var(--card); border: 0; border-radius: var(--radius); color: var(--dark); font: 700 16px "Montserrat", sans-serif; text-align: left; cursor: pointer; transition: background 0.3s, color 0.3s, transform 0.3s; }
.tab span { color: var(--yellow-hover); font-size: 12px; line-height: 24px; }
.tab:hover { transform: translateX(6px); background: var(--muted); }
.tab.active { background: var(--navy); color: var(--white); transform: translateX(6px); }

.panel { display: none; padding: 40px; background: var(--card); border-radius: var(--radius); }
.panel.active { display: block; animation: rise 0.6s both; }
.panel small { color: var(--yellow-hover); font: 700 12px "Montserrat", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
.panel h3 { margin: 12px 0 20px; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; }
.panel p { line-height: 1.8; opacity: 0.8; }
.panel p + p { margin-top: 14px; }
.panel .lead { font: 500 18px/1.6 "Montserrat", sans-serif; opacity: 1; }
.panel h4 { margin-top: 30px; }
.ticks { list-style: none; }
.ticks li { position: relative; padding: 12px 0 12px 30px; border-top: 1px solid rgba(8, 8, 8, 0.12); line-height: 1.6; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--yellow-hover); font-weight: 700; }

/* ---------- Collaboration: logo cards ---------- */
.logo-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.org { position: relative; overflow: hidden; grid-column: span 2; display: flex; flex-direction: column; background: #fff; color: var(--navy); border-radius: var(--radius); transition: transform 0.4s, box-shadow 0.4s; }
.org:nth-child(n+4) { grid-column: span 3; }
.org-logo { position: relative; height: 180px; background: #fff; }
.org-logo img { position: absolute; inset: 28px; width: calc(100% - 56px); height: calc(100% - 56px); object-fit: contain; transition: transform 0.5s; }
.org-info { flex: 1; padding: 22px 26px 30px; border-top: 1px solid rgba(8, 29, 47, 0.1); }
.org h3 { margin-bottom: 8px; font: 700 17px/1.3 "Montserrat", sans-serif; }
.org h3 small { display: block; margin-top: 4px; font-size: 13px; font-weight: 500; opacity: 0.6; }
.org p { font-size: 14px; line-height: 1.6; opacity: 0.8; }
.org::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 5px; background: var(--yellow); transform: scaleX(0); transform-origin: left; transition: transform 0.5s; }
.org:hover { transform: translateY(-8px); box-shadow: 0 22px 40px rgba(0, 0, 0, 0.35); }
.org:hover::after { transform: scaleX(1); }
.org:hover .org-logo img { transform: scale(1.08); }

/* ---------- Recognition: image on top (photos fill, logos fit), text below ---------- */
.award-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.award { overflow: hidden; display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); transition: transform 0.3s, box-shadow 0.3s; }
.award:hover { transform: translateY(-6px); box-shadow: 0 16px 32px rgba(8, 29, 47, 0.14); }
.award-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--navy); }
.award-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* blurred copy of the same image fills any empty space around logos */
.award-fill {
    object-fit: cover;
    filter: blur(22px) brightness(2.2) saturate(0.45);
    transform: scale(1.25);
    opacity: 0.9;
    background: #dce8ed;
}

.award-img {
    object-fit: contain;
    transition: transform 0.6s;
}

.award-img.contain {
    object-fit: contain;
    inset: 20px;
    width: calc(100% - 40px);
    height: calc(100% - 40px);
}

.award:hover .award-img {
    transform: scale(1.05);
}

.award-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 26px 28px 30px;
}

.award-body i {
    margin-bottom: 14px;
    color: var(--yellow-hover);
    font-size: 24px;
}

.award-body p {
    font: 600 17px/1.5 "Montserrat", sans-serif;
}

/* first card is wider: photo left, text right */
.award-feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr; }
.award-feature .award-media { aspect-ratio: auto; min-height: 340px; }
.award-feature .award-body { padding: 40px; }
.award-feature .award-body p { font-size: clamp(20px, 2vw, 26px); line-height: 1.45; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .project, .tabs-layout, .fields { grid-template-columns: 1fr; }
    .tab-list { position: static; grid-template-columns: repeat(2, 1fr); }
    .ways-grid { grid-template-columns: repeat(2, 1fr); }
    .logo-grid { grid-template-columns: repeat(2, 1fr); }
    .org, .org:nth-child(n+4) { grid-column: auto; }
    .org:last-child { grid-column: 1 / -1; }
    .award-grid { grid-template-columns: repeat(2, 1fr); }
    .award-feature { grid-template-columns: 1fr; }
    .award-feature .award-media { aspect-ratio: 16 / 9; min-height: 0; }
    .award-feature .award-body { padding: 28px; }
}

@media (max-width: 650px) {
    .portfolio-hero::after { width: 480px; height: 480px; margin: -240px; }
    .ways-grid, .award-grid, .tab-list, .logo-grid { grid-template-columns: 1fr; }
    .org:last-child { grid-column: auto; }
    .panel { padding: 26px; }
}