/*
 * Visual structure based on abhn/portfolio (GPL-3.0).
 * Adapted for Sanghyeon Ju's portfolio.
 */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
:root {
  --theme-bg: url("https://raw.githubusercontent.com/abhn/portfolio/master/assets/images/background.png");
  --blue: #3498db;
  --ink: #222;
  --text: #404040;
  --line: #d9d9d9;
}
body {
  min-width: 320px;
  margin: 0;
  font-family: 'PT Sans', 'Pretendard', Arial, Helvetica, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
}
a { color: inherit; }
button { font: inherit; }
img { display: block; max-width: 100%; }

.animated { animation: fade-in-down .55s; animation-delay: .18s; animation-fill-mode: both; }
@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.theme-button {
  display: inline-flex;
  min-width: 118px;
  min-height: 38px;
  padding: 8px 14px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: transparent;
  border: 1px solid #fff;
  border-radius: 2px;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.theme-button:hover,
.theme-button:focus-visible,
.theme-button.is-current { color: #333; background: #fff; }

/* Home */
.home-layout {
  height: calc(100vh - 34px);
  min-height: 690px;
  display: grid;
  grid-template-rows: 32% 68%;
}
.home-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background-image: var(--theme-bg);
  background-repeat: repeat;
}
.home-hero__content {
  width: min(960px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.home-profile {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 50%;
}
.home-title-block { text-align: center; }
.home-hero h1 { margin: 2px 0 5px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }
.home-hero p { margin: 0; font-size: clamp(1rem, 1.8vw, 1.25rem); }
.home-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}
.home-about {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 20px 42px;
  background: #fff;
}
.about-panel { width: min(760px, 92vw); text-align: center; }
.about-panel h2 { margin: 0 0 26px; font-size: 2.45rem; }
.about-panel p { margin: 7px 0; font-size: 1.15rem; line-height: 1.55; }
.about-panel .about-school { font-size: 1.3rem; }
.about-background { max-width: 690px; margin: 28px auto 18px !important; color: var(--text); text-align: justify; }
.text-link { display: inline-block; margin-top: 8px; text-underline-offset: 4px; }

/* Subpages */
.subpage-head {
  min-height: 178px;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background-image: var(--theme-bg);
  background-repeat: repeat;
}
.subpage-head__inner { width: min(980px, 94vw); text-align: center; }
.subpage-head h1 { margin: 0 0 18px; font-size: 2.6rem; }
.subpage-menu { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.page-main { min-height: calc(100vh - 212px); padding: 56px 20px 70px; }
.page-container { width: min(980px, 94vw); margin: 0 auto; }

/* Skills */
.skills-page-main { padding-top: 48px; }
.skills-list {
  width: min(760px, 94vw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.skill-row {
  min-height: 58px;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  background: var(--blue);
  border-radius: 3px;
  box-shadow: -4px 8px 16px rgba(0,0,0,.2);
  text-align: center;
  transition: min-height .2s ease, padding .2s ease, background .2s ease;
}
.skill-row:not(.skill-row--empty):hover {
  min-height: 94px;
  padding-top: 18px;
  padding-bottom: 18px;
  background: #2d89c4;
}
.skill-row__title { font-size: 1.16rem; font-weight: 700; }
.skill-related {
  max-height: 0;
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height .2s ease, margin-top .2s ease, opacity .16s ease, transform .2s ease;
}
.skill-row:hover .skill-related {
  max-height: 70px;
  margin-top: 11px;
  opacity: 1;
  transform: translateY(0);
}
.related-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  color: #111;
  background: #f0f1f3;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
}
.related-pill:hover { background: #fff; }
.related-pill--experience { background: #e7edf2; }
.skill-note { margin: 24px 0 0; color: #666; text-align: center; }

/* Projects */
.project-technologies {
  margin: 0 auto 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.filter-button {
  min-width: 110px;
  padding: 8px 14px;
  color: #222;
  background: transparent;
  border: 1px solid #222;
  border-radius: 2px;
  cursor: pointer;
}
.filter-button:hover,
.filter-button.is-active { color: #fff; background: #222; }
.projects-wrapper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 28px;
  align-items: stretch;
}
.project-wrapper { min-width: 0; height: 100%; }
.project-card-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.card {
  height: 100%;
  min-height: 570px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 2px;
  box-shadow: -4px 8px 16px rgba(0,0,0,.24);
}
.card__image {
  flex: 0 0 210px;
  height: 210px;
  overflow: hidden;
  background: #eee;
  border-bottom: 1px solid var(--line);
}
.card__image img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s ease; }
.card__content { flex: 1; padding: 22px 28px 26px; display: flex; flex-direction: column; }
.card__article h2 { min-height: 3.2em; margin: 0 0 14px; font-size: 1.48rem; line-height: 1.25; }
.card__article p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-info {
  width: 100%;
  margin-top: auto;
  padding-top: 18px;
  border-collapse: collapse;
  font-size: .9rem;
}
.project-info tr { border-top: 1px solid #ddd; }
.project-info th,
.project-info td { padding: 8px 4px; vertical-align: top; }
.project-info th { width: 72px; text-align: left; color: #555; font-weight: 700; }
.project-info td { color: #222; line-height: 1.4; }
.project-card-link:hover .card__article h2 { color: #2980b9; }
.project-card-link:hover .card__image img { transform: scale(1.04); }
.project-card-link:focus-visible { outline: 3px solid #2980b9; outline-offset: 4px; }

/* Experience */
.empty-state {
  max-width: 650px;
  margin: 80px auto 0;
  padding: 42px;
  border: 1px solid #ccc;
  text-align: center;
  line-height: 1.65;
}
.empty-state h2 { margin-top: 0; }
.experience-card {
  display: block;
  margin-bottom: 20px;
  padding: 28px;
  color: inherit;
  border: 1px solid #ddd;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  text-decoration: none;
}

/* Contact */
.contact-page-main { display: flex; align-items: center; }
.contact-list {
  width: min(700px, 94vw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-item {
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 26px;
  color: inherit;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: -4px 8px 16px rgba(0,0,0,.12);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.contact-item:hover { transform: translateY(-2px); box-shadow: -4px 10px 20px rgba(0,0,0,.17); }
.contact-label { min-width: 90px; font-size: 1.12rem; font-weight: 700; }
.contact-value { color: #333; overflow-wrap: anywhere; }

.footer {
  min-height: 34px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background-image: var(--theme-bg);
  background-repeat: repeat;
  font-size: .86rem;
  text-align: center;
}

@media (hover: none) {
  .skill-row:not(.skill-row--empty) { min-height: 94px; }
  .skill-row .skill-related { max-height: 70px; margin-top: 11px; opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .home-layout { height: auto; min-height: auto; grid-template-rows: auto auto; }
  .home-hero { min-height: 390px; padding: 34px 20px; }
  .home-profile { width: 92px; height: 92px; }
  .home-menu { max-width: 430px; }
  .theme-button { min-width: 132px; }
  .home-about { min-height: 500px; }
  .about-background { text-align: left; }
  .projects-wrapper { grid-template-columns: 1fr; }
  .card { min-height: 540px; }
}

@media (max-width: 500px) {
  .home-menu, .subpage-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-button { min-width: 0; width: 100%; }
  .subpage-head h1 { font-size: 2.15rem; }
  .page-main { padding-left: 14px; padding-right: 14px; }
  .card__content { padding: 20px; }
  .card__article h2 { min-height: auto; }
  .contact-item { align-items: flex-start; flex-direction: column; gap: 8px; }
  .contact-label { min-width: 0; }
}
