/* ============================================================
   Giorgi Nikolaishvili — shared styles
   ------------------------------------------------------------
   This one file styles every page. Change a value in :root
   below and it will update across the site.
   ============================================================ */

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #5a5a5a;
  --line: #e6e6e6;
  --hover: #6a6a6a;

  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 44rem;      /* reading width for the research page */
  --page: 58rem;         /* wider width for the homepage photo layout */
  --header-h: 4.5rem;
}

/* --- Reset --- */

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

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.011em;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  color: var(--hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

/* --- Layout --- */

.wrap {
  width: min(var(--measure), calc(100% - 2.5rem));
  margin-inline: auto;
}

.wrap-wide {
  width: min(var(--page), calc(100% - 2.5rem));
}

main {
  flex: 1;
  padding: 2.5rem 0 4.5rem;
}

/* --- Header --- */

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
  padding-block: 1.1rem;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.site-logo:hover {
  color: var(--fg);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.28em;
}

/* --- Homepage --- */

.home-page {
  background: #f8f7f3;
}

.hero {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 3.5rem;
  align-items: start;
  padding-top: 1.5rem;
}

.portrait {
  width: 100%;
  background: #f2f2f2;
}

.identity h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.byline {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0 0 1.5rem;
}

.title,
.affiliation {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

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

.fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
}

.fields li {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--fg);
  padding: 0.28rem 0.55rem;
}

.bio {
  max-width: 36rem;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.bio strong {
  font-weight: 600;
}

.bio a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

.contact a {
  text-decoration: none;
  border-bottom: 1px solid var(--fg);
}

.contact a:hover {
  border-bottom-color: var(--hover);
}

/* --- Research --- */

.research-page {
  --research-accent: #355e55;
  --research-accent-soft: #e8efec;
  --research-panel: #f1efe8;
  background: #f8f7f3;
}

.research-page main {
  padding-block: 3.25rem 5rem;
}

.research-intro {
  max-width: 49rem;
  margin-bottom: 2.5rem;
}

.page-title {
  margin: 0 0 1rem;
  font-size: clamp(2.8rem, 7vw, 4.75rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.research-deck {
  max-width: 45rem;
  margin-bottom: 0;
  color: #383936;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.5;
}

.paper-link,
.publication-link {
  color: var(--research-accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.section {
  margin-bottom: 4.75rem;
  scroll-margin-top: 2rem;
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--fg);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2rem);
}

/* Working papers use open, detailed editorial rows. */

.paper {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 1.35rem 0 1.45rem;
  border-bottom: 1px solid var(--line);
}

.paper-number {
  padding-top: 0.3rem;
  color: #888982;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.paper-content {
  min-width: 0;
}

.paper-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.paper h3 {
  max-width: 40rem;
  margin: 0;
  font-size: clamp(1.18rem, 2.2vw, 1.35rem);
  font-weight: 500;
  line-height: 1.32;
}

.status {
  flex: 0 0 auto;
  border: 1px solid #b9ccc6;
  border-radius: 999px;
  padding: 0.2rem 0.55rem 0.16rem;
  color: var(--research-accent);
  background: var(--research-accent-soft);
  font-size: 0.63rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-revision {
  border-color: #cbbf9a;
  color: #6d5822;
  background: #f3eedc;
}

.status-request {
  border-color: #d4d2cb;
  color: #666761;
  background: #f2f1ed;
}

.paper-meta {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.paper-meta a,
.publication-authors a,
.work-list a {
  text-decoration: underline;
  text-decoration-color: #a7a8a2;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  align-items: flex-start;
  margin-top: 0.75rem;
}

.paper-link,
.paper summary {
  padding-block: 0.15rem;
}

.paper-link {
  border-bottom: 1px solid currentColor;
}

.paper details {
  min-width: 0;
}

.paper details[open] {
  flex-basis: 100%;
}

.paper summary {
  cursor: pointer;
  width: fit-content;
  color: var(--research-accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  list-style: none;
}

.paper summary::-webkit-details-marker {
  display: none;
}

.paper summary::after {
  content: "+";
  display: inline-block;
  width: 0.8em;
  margin-left: 0.25rem;
  text-align: right;
}

.paper details[open] summary::after {
  content: "–";
}

.paper summary:hover {
  color: var(--fg);
}

.abstract {
  max-width: 48rem;
  margin-top: 0.9rem;
  border-left: 2px solid var(--research-accent);
  padding: 1rem 1.15rem;
  color: #555650;
  background: var(--research-panel);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.62;
}

/* Publications stay a compact, journal-style bibliography. */

.publications {
  border: 1px solid #dad7ce;
  padding: 1.9rem 2.2rem 0.9rem;
  background: var(--research-panel);
}

.publications .section-heading {
  border-bottom-color: #aaa89f;
}

.pub-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pub-list li {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.2rem 0 1.3rem;
  border-bottom: 1px solid #d6d3ca;
}

.pub-list li:last-child {
  border-bottom: 0;
}

.pub-year {
  padding-top: 0.16rem;
  color: var(--research-accent);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.publication-title {
  max-width: 43rem;
  margin-bottom: 0.4rem;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 500;
  line-height: 1.35;
}

.publication-authors,
.venue {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.venue {
  margin-bottom: 0.6rem;
}

.publication-link {
  display: inline-block;
  border-bottom: 1px solid currentColor;
}

/* Works in progress are intentionally lighter and more provisional. */

.work-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-list li {
  display: grid;
  grid-template-columns: 0.5rem minmax(0, 1fr);
  gap: 0.8rem;
  padding: 1rem 1.5rem 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.work-list li:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.work-list li:nth-child(even) {
  padding-left: 1.5rem;
}

.work-marker {
  width: 0.34rem;
  height: 0.34rem;
  margin-top: 0.58rem;
  border-radius: 50%;
  background: var(--research-accent);
}

.work-list strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
}

.work-list div > span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* --- Footer --- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.15rem 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* --- Small screens --- */

@media (max-width: 860px) {
  html {
    font-size: 16px;
  }

  .wrap,
  .wrap-wide {
    width: min(var(--page), calc(100% - 1.75rem));
  }

  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    padding-block: 1rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .portrait {
    width: min(16rem, 70%);
  }

  .bio {
    font-size: 1.1rem;
  }

  .research-page main {
    padding-block: 2.5rem 3.75rem;
  }

  .publications {
    padding: 1.8rem 1.6rem 0.8rem;
  }
}

@media (max-width: 620px) {
  .research-intro {
    margin-bottom: 2rem;
  }

  .page-title {
    font-size: 3rem;
  }

  .section {
    margin-bottom: 3.5rem;
  }

  .paper {
    grid-template-columns: 1.4rem minmax(0, 1fr);
    gap: 0.6rem;
    padding-block: 1.15rem 1.25rem;
  }

  .paper-heading {
    flex-direction: column;
    gap: 0.7rem;
  }

  .status {
    align-self: flex-start;
  }

  .publications {
    margin-inline: -0.35rem;
    padding: 1.5rem 1.25rem 0.5rem;
  }

  .pub-list li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .work-list {
    grid-template-columns: 1fr;
  }

  .work-list li,
  .work-list li:nth-child(even) {
    padding-inline: 0;
  }

  .work-list li:nth-child(odd) {
    border-right: 0;
  }
}
