/*
 * Portfolio styles based on Harkaran-Gill/Personal-Portfolio/styles.css.
 * Original sections and layout preserved. New rules for actual project images
 * and links appear at the bottom of this file.
 */

:root {
  --paper: #f5f3ed;
  --white: #fffefa;
  --ink: #19293b;
  --secondary: #405061;
  --quiet: #627080;
  --line: #d4d9d9;
  --blue: #2459a6;
  --rust: #d96842;
  --navy: #192b40;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 115px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

::selection {
  background: #f3c5aa;
  color: var(--ink);
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.shell {
  width: min(1200px, calc(100% - 64px));
  margin-inline: auto;
}

.micro {
  font: 700 11px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.skip {
  position: absolute;
  top: -90px;
  left: 16px;
  z-index: 30;
  padding: 11px 17px;
  background: var(--ink);
  color: white;
}

.skip:focus {
  top: 10px;
}

/* Sticky masthead */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f5f3edf2;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.logo {
  justify-self: start;
  text-decoration: none;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.055em;
  white-space: nowrap;
}

.logo::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 0 1px 4px;
  border-radius: 50%;
  background: var(--rust);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.6vw, 34px);
}

.nav a {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.nav a:hover,
.contact-links a:hover {
  color: var(--blue);
}

.nav-resume {
  justify-self: end;
  padding: 9px 13px;
  border: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.nav-resume:hover {
  background: var(--ink);
  color: white;
}

/* Hero and ray-tracing pipeline */
.hero {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  min-height: 670px;
  border-bottom: 1px solid var(--ink);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(76px, 8vw, 118px) 7% 36px 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 29px;
  color: var(--blue);
}

.eyebrow::before {
  content: "";
  width: 23px;
  height: 2px;
  background: var(--rust);
}

h1 {
  max-width: 730px;
  margin: 0 0 28px;
  font-size: clamp(53px, 6.15vw, 90px);
  font-weight: 700;
  line-height: 1.09;
  letter-spacing: -0.08em;
}

/* Reserve space for two lines so rotating copy does not move the buttons. */
.rotator {
  display: block;
  min-height: 2.09em;
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.069em;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.rotator.leaving {
  opacity: 0;
  transform: translateY(8px);
}

.hero-description {
  max-width: 530px;
  margin-bottom: 28px;
  color: var(--secondary);
  font-size: clamp(17px, 1.65vw, 19px);
  line-height: 1.65;
}

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

.button {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  min-height: 49px;
  padding: 12px 17px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s;
}

.button:hover {
  transform: translateY(-2px);
  background: #29476e;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
}

.button.secondary:hover {
  color: white;
}

.hero-bottom {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
  margin-top: auto;
  padding-top: 38px;
  color: var(--quiet);
}

.hero-bottom .arrow {
  color: var(--rust);
  font-size: 26px;
  line-height: 1;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border-left: 1px solid var(--ink);
  background: #e5ebeb;
}

.visual-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #b9c6c9;
  color: #34546a;
}

.visual-bar.bottom {
  margin-top: auto;
  border-top: 1px solid #b9c6c9;
  border-bottom: 0;
}

.diagram {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 22px clamp(20px, 3vw, 36px);
  background-image:
    linear-gradient(#7d9ca71b 1px, transparent 1px),
    linear-gradient(90deg, #7d9ca71b 1px, transparent 1px);
  background-size: 26px 26px;
}

.pipeline {
  width: 100%;
  max-width: 470px;
  margin: auto;
}

.diagram-label {
  display: block;
  margin-bottom: 17px;
  color: #3b5967;
}

.step {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 63px;
  padding: 9px 13px;
  border: 1px solid #b3c2c5;
  background: #f9faf5;
  box-shadow: 3px 3px 0 #c4d2d1;
}

.step .number {
  color: var(--blue);
}

.step strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.step small {
  display: block;
  color: #526677;
  font-size: 11px;
  line-height: 1.35;
}

.step .glyph {
  color: var(--rust);
  font: 20px Georgia, serif;
}

.connector {
  position: relative;
  height: 26px;
  margin-left: 29px;
  border-left: 2px solid #547b90;
}

.connector::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -5px;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 6px solid #547b90;
}

.diagram-note {
  width: 100%;
  max-width: 470px;
  margin: 15px auto 0;
  color: #3e5d68;
  font-size: 11px;
  line-height: 1.5;
}

.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}

.strip > span:first-child {
  color: var(--blue);
}

.strip p {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
}

.strip strong {
  color: var(--ink);
}

/* Sections and project case studies */
section {
  padding: 93px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr minmax(255px, 0.62fr);
  align-items: end;
  gap: 38px;
  margin-bottom: 35px;
}

.section-heading .micro {
  display: block;
  margin-bottom: 17px;
  color: var(--blue);
}

.section-heading p {
  margin: 0 0 4px;
  color: var(--secondary);
  line-height: 1.75;
}

h2 {
  margin: 0;
  font-size: clamp(43px, 5vw, 68px);
  font-weight: 760;
  line-height: 1.07;
  letter-spacing: -0.073em;
}

h2 em {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 385px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: var(--white);
}

.project:last-child {
  margin-bottom: 0;
}

.project-art {
  display: flex;
  flex-direction: column;
  min-height: 355px;
  padding: 26px 28px;
  overflow: hidden;
}

.art-inner {
  display: grid;
  flex: 1;
  place-items: center;
}

.art-inner svg {
  width: min(100%, 480px);
  height: auto;
  max-height: 275px;
}

.art-ray {
  background: #182c43;
  color: #b7d4e5;
}

.art-model {
  background: #e3eadf;
  color: #385b52;
}

.art-sort {
  background: #ebe3d6;
  color: #62584d;
}

/* Alternate the second project's illustration without changing reading order. */
.project:nth-of-type(2) .project-art {
  order: 2;
}

.project-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(27px, 3.5vw, 49px);
}

.project-kicker {
  margin-bottom: 15px;
  color: var(--blue);
}

.project-copy h3 {
  margin: 0 0 14px;
  font-size: clamp(29px, 3vw, 41px);
  line-height: 1.13;
  letter-spacing: -0.053em;
}

.project-copy > p {
  max-width: 490px;
  margin: 0 0 22px;
  color: var(--secondary);
  line-height: 1.72;
}

.project-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  margin-top: auto;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.project-facts dt {
  margin-bottom: 6px;
  color: var(--blue);
}

.project-facts dd {
  margin: 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.55;
}

.project-stack {
  margin-top: 24px;
  color: var(--quiet);
}

/* Education, experience, and skills */
.background-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 66px;
}

.column-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 15px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}

.column-title h2 {
  font-size: clamp(32px, 3.5vw, 47px);
}

.column-title .micro,
.entry .micro,
.skill-row .micro {
  color: var(--blue);
}

.entry {
  margin-bottom: 24px;
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line);
}

.entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border: 0;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px 15px;
  margin-bottom: 7px;
}

.entry h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

.entry time {
  color: var(--quiet);
}

.entry .micro {
  display: block;
  margin-bottom: 10px;
}

.entry p {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.7;
}

.skill-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.skill-row:first-of-type {
  border-top: 1px solid var(--line);
}

.skill-row span:last-child {
  color: var(--secondary);
}

/* Résumé and contact */
#resume {
  padding: 70px 0;
}

.resume-band {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 25px;
  padding: 39px 43px;
  background: var(--navy);
  color: white;
}

.resume-band .micro {
  color: #a9c9ed;
}

.resume-band h2 {
  margin: 7px 0 8px;
  font-size: clamp(32px, 4vw, 52px);
}

.resume-band p {
  margin: 0;
  color: #cad6df;
}

.resume-band .button {
  border-color: white;
  background: white;
  color: var(--ink);
}

.resume-band .button:hover {
  background: #d9e8f2;
}

.contact {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: end;
  gap: 45px;
}

.contact .micro {
  color: var(--blue);
}

.contact h2 {
  margin: 17px 0 20px;
}

.contact p {
  max-width: 425px;
  margin: 0;
  color: var(--secondary);
  line-height: 1.75;
}

.contact-links {
  border-top: 1px solid var(--ink);
}

.contact-links a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 17px 3px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  font-weight: 720;
  text-decoration: none;
}

.contact-links a span {
  font-size: 15px;
}

.contact-links small {
  display: block;
  margin-top: 13px;
  color: var(--quiet);
  font-size: 12px;
}

footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 25px 0 42px;
  color: var(--quiet);
}

footer a {
  text-underline-offset: 4px;
}

/* Tablet: stack hero and project panels; keep navigation accessible. */
@media (max-width: 950px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
    padding: 14px 0;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    padding: 3px 0;
  }

  .hero,
  .project {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 580px;
    padding: 75px 0 36px;
  }

  .hero-visual {
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .diagram {
    min-height: 455px;
  }

  .project-art {
    min-height: 290px;
  }

  .project:nth-of-type(2) .project-art {
    order: 0;
  }

  .background-grid {
    gap: 35px;
  }
}

/* Phone: preserve readable labels, two-column facts, and usable tap targets. */
@media (max-width: 630px) {
  .shell {
    width: calc(100% - 36px);
  }

  .topbar-inner {
    gap: 12px;
  }

  .nav {
    gap: 18px;
  }

  .nav a {
    font-size: 12px;
  }

  .nav-resume {
    padding: 7px 9px;
    font-size: 11px;
  }

  .hero-copy {
    min-height: 550px;
    padding-top: 60px;
  }

  h1 {
    font-size: clamp(51px, 12vw, 76px);
  }

  .rotator {
    min-height: 2.1em;
  }

  .diagram {
    min-height: 450px;
    padding: 22px 16px;
  }

  .step {
    grid-template-columns: 25px 1fr auto;
    gap: 8px;
    padding: 8px;
  }

  .step strong {
    font-size: 13px;
  }

  .connector {
    margin-left: 20px;
  }

  .strip {
    grid-template-columns: 1fr 1fr;
    gap: 13px;
  }

  .strip > span:first-child {
    grid-column: 1 / -1;
  }

  section {
    padding: 67px 0;
  }

  .section-heading,
  .background-grid,
  .contact {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-art {
    min-height: 235px;
  }

  .project-copy {
    padding: 27px;
  }

  .project-facts {
    gap: 14px;
  }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .resume-band {
    grid-template-columns: 1fr;
    padding: 30px;
  }

  .resume-band .button {
    justify-self: start;
  }

  .contact-links {
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rotator,
  .button,
  .nav-resume {
    transition: none;
  }
}

/* Actual project artifacts and repository links. */
.project-proof {
  width: 100%;
  margin: 0;
  text-align: center;
}

.project-proof img {
  display: block;
  max-width: 100%;
  max-height: 260px;
  margin-inline: auto;
  object-fit: contain;
}

.project-proof figcaption,
.chess-proof figcaption {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.project-link {
  display: inline-block;
  margin-top: 19px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 750;
  text-underline-offset: 5px;
}

.art-chess {
  background: #e3e9e6;
  color: #315056;
}

.chess-proof {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: auto 0;
}

.chess-proof img {
  width: 100%;
  max-height: 255px;
  object-fit: contain;
}

.chess-proof figcaption {
  grid-column: 1 / -1;
}
