:root {
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --space-1: 0.5rem;
  --space-2: 0.9rem;
  --space-3: 1.4rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --max-width: 1600px;
  --widget-width: 480px;
  --grid-gap: 1.6rem;
  --widget-focus-scale: 1.015;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-sans: "Avenir Next", "Gill Sans", "Trebuchet MS", "Segoe UI", sans-serif;
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #303030;
  --page-bg-accent: #17130e;
  --page-text: #f5f1ea;
  --surface-bg: #15110d;
  --surface-text: #f5f1ea;
  --muted-text: #b2aa9f;
  --border-color: rgba(255, 255, 255, 0.12);
  --accent: #9eb1bd;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --overlay-bg: rgba(6, 5, 4, 0.6);
  --pill-bg: rgba(20, 16, 12, 0.75);
  --pill-border: rgba(255, 255, 255, 0.12);
  --expand-bg: rgba(20, 16, 12, 0.82);
  --expand-border: rgba(255, 255, 255, 0.45);
  --widget-focus-shadow: 0 26px 58px rgba(0, 0, 0, 0.45);
  --widget-focus-border: rgba(255, 255, 255, 0.18);
}

:root[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f7f5ef;
  --page-bg-accent: #f0ece3;
  --page-text: #1a1815;
  --surface-bg: #f7f5ef;
  --surface-text: #1a1815;
  --muted-text: #6a6359;
  --border-color: rgba(0, 0, 0, 0.16);
  --accent: #3f4f5a;
  --shadow: 0 20px 50px rgba(32, 28, 20, 0.12);
  --overlay-bg: rgba(17, 15, 11, 0.45);
  --pill-bg: rgba(247, 245, 239, 0.78);
  --pill-border: rgba(0, 0, 0, 0.12);
  --expand-bg: rgba(26, 24, 21, 0.85);
  --expand-border: rgba(255, 255, 255, 0.65);
  --widget-focus-shadow: 0 24px 54px rgba(32, 28, 20, 0.18);
  --widget-focus-border: rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: radial-gradient(circle at top, var(--page-bg-accent) 0%, var(--page-bg) 60%);
  color: var(--page-text);
  line-height: 1.6;
  min-height: 100vh;
}

body.overlay-open {
  overflow: hidden;
}

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

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: var(--space-3);
  background: var(--page-text);
  color: var(--page-bg);
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  font-size: 0.85rem;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--space-2);
}

.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin: 0 auto;
}


.site-main {
  padding: var(--space-5) 0 var(--space-6);
}

.widget-grid {
  display: flex;
  gap: var(--grid-gap);
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

.widget-column {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  width: var(--widget-width);
  min-width: 0;
}

.widget-grid[data-columns="1"] .widget-column,
.widget-grid[style*="--column-count: 1"] .widget-column {
  width: min(100%, var(--widget-width));
}

.widget {
  position: relative;
  background: var(--widget-bg, var(--surface-bg));
  border-radius: var(--radius-md);
  border: 1px solid var(--widget-border, var(--border-color));
  padding: var(--space-3);
  box-shadow: var(--widget-base-shadow, var(--shadow));
  display: flex;
  flex-direction: column;
  min-height: 160px;
  color: var(--widget-text, var(--surface-text));
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.widget:hover,
.widget:focus-within {
  border-color: var(--widget-focus-border);
  box-shadow: var(--widget-focus-shadow);
  transform: scale(var(--widget-focus-scale));
  z-index: 2;
}

.widget--no-hover-shadow:hover,
.widget--no-hover-shadow:focus-within {
  box-shadow: var(--widget-base-shadow, var(--shadow));
}

.widget--title {
  min-height: 0;
}

.widget--media {
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

.widget--frameless {
  --widget-base-shadow: none;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.widget-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted-text);
  margin: 0 0 var(--space-2);
}

.widget-body {
  display: grid;
  gap: var(--space-2);
}

.widget-expand {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--expand-border);
  background: var(--expand-bg);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.widget:hover .widget-expand,
.widget:focus-within .widget-expand {
  opacity: 1;
  pointer-events: auto;
}

.widget-expand:hover {
  transform: translateY(-1px);
}

.widget-expand:focus-visible {
  border-color: #ffffff;
  background: var(--expand-bg);
}

.widget-expand-icon {
  width: 18px;
  height: 18px;
}

.title-widget {
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.1;
}

.svg-widget {
  display: flex;
  align-items: center;
  justify-content: center;
}

.svg-widget-image {
  height: auto;
}

.text-widget p {
  margin: 0;
  color: var(--muted-text);
}

.text-widget a {
  color: var(--accent);
  text-decoration: underline;
}

.text-widget .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface-text);
  font-size: 0.9rem;
  text-decoration: none;
}

.about-me-widget {
  display: grid;
  gap: var(--space-2);
}

.about-me-header {
  display: grid;
  gap: 0.1rem;
}

.about-me-name {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.about-me-subtitle,
.about-me-bio,
.about-me-meta {
  margin: 0;
}

.about-me-subtitle {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
}

.about-me-bio {
  color: var(--muted-text);
  font-size: 0.96rem;
  line-height: 1.5;
}

.about-me-focus-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.about-me-focus-list li {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--widget-text, var(--surface-text));
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.34rem 0.65rem;
}

.about-me-meta {
  color: var(--muted-text);
  font-size: 0.86rem;
}

.about-me-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.about-me-links a {
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.app-showcase-widget {
  display: grid;
  gap: var(--space-3);
}

.app-showcase-description {
  margin: 0;
  color: var(--muted-text);
}

.app-showcase-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: stretch;
}

.app-showcase-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  min-width: 0;
}

.app-showcase-section--website {
  justify-content: flex-end;
}

.app-showcase-icon {
  width: 75%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 24%;
  object-fit: cover;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.app-showcase-icon--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--surface-bg));
  border: 1px solid var(--border-color);
  color: var(--surface-text);
  font-weight: 700;
}

html[data-theme="dark"] .app-showcase-website-icon--invert-dark {
  filter: invert(1);
}

.app-showcase-website-icon {
  box-shadow: none;
}

.app-showcase-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 75%;
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--surface-bg);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.app-showcase-button--secondary {
  border-color: var(--border-color);
  background: transparent;
  color: var(--widget-text, var(--surface-text));
}

.app-showcase-button:hover,
.website-showcase-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.app-showcase-button--secondary:hover {
  border-color: var(--accent);
  filter: none;
}

.website-showcase-widget {
  display: grid;
  gap: var(--space-3);
}

.website-showcase-description {
  margin: 0;
  color: var(--muted-text);
}

.website-showcase-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-width: 132px;
  min-height: 42px;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--surface-bg);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.quote-widget {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.quote-widget-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 400;
  line-height: 1.25;
}

.quote-widget-author {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.quote-widget-author::before {
  content: "- ";
}

.photo-widget {
  padding: 0;
  overflow: hidden;
}

.photo-frame {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.photo-image {
  width: 100%;
  display: block;
  height: auto;
  border-radius: var(--radius-md);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.78));
  color: #ffffff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.photo-frame:hover .photo-overlay,
.photo-frame:focus-visible .photo-overlay {
  opacity: 1;
  transform: translateY(0);
}

.photo-overlay-title,
.photo-overlay-description,
.photo-meta {
  margin: 0;
}

.photo-overlay-title {
  font-size: 1.1rem;
  line-height: 1.2;
}

.photo-overlay-description {
  font-size: 0.92rem;
  line-height: 1.4;
}

.photo-meta {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  line-height: 1.3;
}

.photo-large {
  display: grid;
  gap: var(--space-2);
}

.photo-large-title {
  margin: 0;
  padding-right: 3rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.2;
}

.photo-large-frame {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.photo-large-image {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.photo-large-details {
  display: grid;
  gap: 0.3rem;
}

.photo-large-meta,
.photo-large-description {
  margin: 0;
}

.photo-large-meta {
  color: var(--muted-text);
  font-size: 0.9rem;
}

.photo-large-description {
  color: var(--widget-text, var(--surface-text));
  font-size: 0.96rem;
  line-height: 1.45;
}

.spotify-widget iframe {
  border-radius: var(--radius-md);
}

.spotify-widget iframe {
  width: 100%;
  max-width: 100%;
  border: 0;
  display: block;
}

.social-links-widget {
  display: grid;
  gap: var(--space-2);
}

.social-links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--surface-bg);
  padding: 0.55rem;
  text-decoration: none;
}

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

.social-link-icon {
  width: 28px;
  height: 28px;
  display: block;
}

.overlay-root {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: var(--overlay-bg);
  backdrop-filter: blur(6px);
  z-index: 30;
}

.overlay-root.is-active {
  display: flex;
}

.overlay-panel {
  background: var(--surface-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  max-width: min(90vw, 960px);
  max-height: 85vh;
  overflow: auto;
  padding: var(--space-4);
  position: relative;
}

.overlay-panel--photo-widget {
  background: transparent;
  border: none;
  box-shadow: none;
}

.overlay-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--expand-border);
  background: var(--expand-bg);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.overlay-close:hover {
  transform: translateY(-1px);
}

.overlay-close:focus-visible {
  border-color: #ffffff;
  background: var(--expand-bg);
}

.overlay-content {
  display: grid;
  gap: var(--space-3);
}

.theme-switcher {
  position: fixed;
  right: var(--space-3);
  bottom: var(--space-3);
  display: inline-flex;
  gap: var(--space-2);
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  backdrop-filter: blur(10px);
  z-index: 40;
}

.theme-button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-button--dark {
  background: #0e0d0b;
  border-color: rgba(255, 255, 255, 0.2);
}

.theme-button--light {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .theme-button--dark,
html[data-theme="light"] .theme-button--light {
  box-shadow: 0 0 0 2px var(--accent);
}

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

@media (max-width: 640px) {
  .app-showcase-actions {
    grid-template-columns: 1fr;
  }

  .app-showcase-section--website {
    justify-content: center;
  }

  .theme-switcher {
    right: var(--space-2);
    bottom: var(--space-2);
    padding: 0.35rem 0.5rem;
  }

  .theme-button {
    width: 24px;
    height: 24px;
  }
}


@media (prefers-reduced-motion: reduce) {
  :root {
    --widget-focus-scale: 1;
  }

  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
