import type { ComponentProps } from "react";

/**
 * Inline SVG marks exported from the Figma "Portfolio" library.
 * All paths use currentColor so they follow --text across themes.
 * Glyphs that don't fill the 16×16 design box keep their Figma offsets
 * via a transform, so the outer box stays uniform for layout.
 */

type IconProps = ComponentProps<"svg">;

function iconDefaults(props: IconProps): IconProps {
  return { "aria-hidden": true, focusable: false, fill: "currentColor", ...props };
}

/** Spiral-D brand mark (32×32). */
export function LogoMark(props: IconProps) {
  return (
    <svg viewBox="0 0 32 32" {...iconDefaults(props)}>
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16C32 24.8366 24.8366 32 16 32H0V29.3333H16C23.3638 29.3333 29.3333 23.3638 29.3333 16C29.3333 8.6362 23.3638 2.66667 16 2.66667C8.6362 2.66667 2.66667 8.6362 2.66667 16V21.3333H0V16ZM5.33333 16C5.33333 10.109 10.109 5.33333 16 5.33333C21.891 5.33333 26.6667 10.109 26.6667 16C26.6667 21.891 21.891 26.6667 16 26.6667H0V24H16C20.4183 24 24 20.4183 24 16C24 11.5817 20.4183 8 16 8C11.5817 8 8 11.5817 8 16V21.3333H5.33333V16ZM10.6667 16C10.6667 13.0545 13.0545 10.6667 16 10.6667C18.9455 10.6667 21.3333 13.0545 21.3333 16C21.3333 18.9455 18.9455 21.3333 16 21.3333H10.6667V16ZM13.3333 18.6667H16C17.4728 18.6667 18.6667 17.4728 18.6667 16C18.6667 14.5272 17.4728 13.3333 16 13.3333C14.5272 13.3333 13.3333 14.5272 13.3333 16V18.6667Z"
      />
    </svg>
  );
}

export function LinkedInIcon(props: IconProps) {
  return (
    <svg viewBox="0 0 16 16" {...iconDefaults(props)}>
      <path d="M0 1.146C0 0.513 0.526 0 1.175 0H14.825C15.474 0 16 0.513 16 1.146V14.854C16 15.487 15.474 16 14.825 16H1.175C0.526 16 0 15.487 0 14.854V1.146ZM4.943 13.394V6.169H2.542V13.394H4.943ZM3.743 5.182C4.58 5.182 5.101 4.628 5.101 3.934C5.086 3.225 4.581 2.686 3.759 2.686C2.937 2.686 2.4 3.226 2.4 3.934C2.4 4.628 2.921 5.182 3.727 5.182H3.743ZM8.651 13.394V9.359C8.651 9.143 8.667 8.927 8.731 8.773C8.904 8.342 9.299 7.895 9.963 7.895C10.832 7.895 11.179 8.557 11.179 9.529V13.394H13.58V9.25C13.58 7.03 12.396 5.998 10.816 5.998C9.542 5.998 8.971 6.698 8.651 7.191V7.216H8.635L8.651 7.191V6.169H6.251C6.281 6.847 6.251 13.394 6.251 13.394H8.651Z" />
    </svg>
  );
}

/** Sun ("light-mode"). */
export function SunIcon(props: IconProps) {
  return (
    <svg viewBox="0 0 16 16" {...iconDefaults(props)}>
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M8 2.8C7.73478 2.8 7.48043 2.69464 7.29289 2.50711C7.10536 2.31957 7 2.06522 7 1.8V1C7 0.734784 7.10536 0.48043 7.29289 0.292893C7.48043 0.105357 7.73478 0 8 0C8.26522 0 8.51957 0.105357 8.70711 0.292893C8.89464 0.48043 9 0.734784 9 1V1.8C9 2.06522 8.89464 2.31957 8.70711 2.50711C8.51957 2.69464 8.26522 2.8 8 2.8ZM11.68 4.32C11.5871 4.22714 11.5134 4.11689 11.4632 3.99554C11.4129 3.8742 11.387 3.74414 11.387 3.6128C11.387 3.48146 11.4129 3.3514 11.4632 3.23006C11.5134 3.10871 11.5871 2.99846 11.68 2.9056L12.2464 2.3392C12.434 2.15164 12.6883 2.04627 12.9536 2.04627C13.2189 2.04627 13.4732 2.15164 13.6608 2.3392C13.8484 2.52676 13.9537 2.78115 13.9537 3.0464C13.9537 3.31165 13.8484 3.56604 13.6608 3.7536L13.0912 4.32C12.9038 4.50662 12.6501 4.61139 12.3856 4.61139C12.1211 4.61139 11.8674 4.50662 11.68 4.32ZM14.2 7C13.9348 7 13.6804 7.10536 13.4929 7.29289C13.3054 7.48043 13.2 7.73478 13.2 8C13.2 8.26522 13.3054 8.51957 13.4929 8.70711C13.6804 8.89464 13.9348 9 14.2 9H15C15.2652 9 15.5196 8.89464 15.7071 8.70711C15.8946 8.51957 16 8.26522 16 8C16 7.73478 15.8946 7.48043 15.7071 7.29289C15.5196 7.10536 15.2652 7 15 7H14.2ZM11.68 11.68C11.7729 11.5871 11.8831 11.5134 12.0045 11.4632C12.1258 11.4129 12.2559 11.387 12.3872 11.387C12.5185 11.387 12.6486 11.4129 12.7699 11.4632C12.8913 11.5134 13.0015 11.5871 13.0944 11.68L13.6608 12.2464C13.8484 12.434 13.9537 12.6883 13.9537 12.9536C13.9537 13.2189 13.8484 13.4732 13.6608 13.6608C13.4732 13.8484 13.2189 13.9537 12.9536 13.9537C12.6883 13.9537 12.434 13.8484 12.2464 13.6608L11.68 13.0912C11.4934 12.9038 11.3886 12.6501 11.3886 12.3856C11.3886 12.1211 11.4934 11.8674 11.68 11.68ZM8.7072 13.4928C8.56735 13.3529 8.38915 13.2576 8.19514 13.219C8.00114 13.1804 7.80004 13.2002 7.61729 13.2759C7.43454 13.3516 7.27835 13.4798 7.16847 13.6443C7.05859 13.8088 6.99996 14.0022 7 14.2V15C7 15.2652 7.10536 15.5196 7.29289 15.7071C7.48043 15.8946 7.73478 16 8 16C8.26522 16 8.51957 15.8946 8.70711 15.7071C8.89464 15.5196 9 15.2652 9 15V14.2C9.00002 14.0687 8.97418 13.9386 8.92394 13.8173C8.8737 13.6959 8.80005 13.5857 8.7072 13.4928ZM4.32 11.68C4.41289 11.7729 4.48657 11.8831 4.53684 12.0045C4.58711 12.1258 4.61299 12.2559 4.61299 12.3872C4.61299 12.5185 4.58711 12.6486 4.53684 12.7699C4.48657 12.8913 4.41289 13.0015 4.32 13.0944L3.7536 13.6608C3.56604 13.8484 3.31165 13.9537 3.0464 13.9537C2.78115 13.9537 2.52676 13.8484 2.3392 13.6608C2.15164 13.4732 2.04627 13.2189 2.04627 12.9536C2.04627 12.6883 2.15164 12.434 2.3392 12.2464L2.9088 11.68C3.09621 11.4934 3.34992 11.3886 3.6144 11.3886C3.87888 11.3886 4.13259 11.4934 4.32 11.68ZM2.7232 8.384C2.78639 8.23206 2.81111 8.06687 2.79516 7.90308C2.77921 7.73929 2.72309 7.58198 2.63177 7.44508C2.54045 7.30818 2.41676 7.19593 2.27167 7.11829C2.12657 7.04065 1.96456 7.00002 1.8 7H1C0.734784 7 0.48043 7.10536 0.292893 7.29289C0.105357 7.48043 0 7.73478 0 8C0 8.26522 0.105357 8.51957 0.292893 8.70711C0.48043 8.89464 0.734784 9 1 9H1.8C1.9977 8.99984 2.19091 8.94109 2.35523 8.83116C2.51955 8.72124 2.6476 8.56507 2.7232 8.3824V8.384ZM4.32 4.32C4.22714 4.41289 4.11689 4.48657 3.99554 4.53684C3.8742 4.58711 3.74414 4.61299 3.6128 4.61299C3.48146 4.61299 3.3514 4.58711 3.23006 4.53684C3.10871 4.48657 2.99846 4.41289 2.9056 4.32L2.3392 3.7536C2.15164 3.56604 2.04627 3.31165 2.04627 3.0464C2.04627 2.78115 2.15164 2.52676 2.3392 2.3392C2.52676 2.15164 2.78115 2.04627 3.0464 2.04627C3.31165 2.04627 3.56604 2.15164 3.7536 2.3392L4.32 2.9056C4.41289 2.99846 4.48657 3.10871 4.53684 3.23006C4.58711 3.3514 4.61299 3.48146 4.61299 3.6128C4.61299 3.74414 4.58711 3.8742 4.53684 3.99554C4.48657 4.11689 4.41289 4.22714 4.32 4.32ZM12 8C12 9.06087 11.5786 10.0783 10.8284 10.8284C10.0783 11.5786 9.06087 12 8 12C6.93913 12 5.92172 11.5786 5.17157 10.8284C4.42143 10.0783 4 9.06087 4 8C4 6.93913 4.42143 5.92172 5.17157 5.17157C5.92172 4.42143 6.93913 4 8 4C9.06087 4 10.0783 4.42143 10.8284 5.17157C11.5786 5.92172 12 6.93913 12 8Z"
      />
    </svg>
  );
}

/** Moon ("dark-mode") — glyph is 14.8×16, kept at its designed x-offset. */
export function MoonIcon(props: IconProps) {
  return (
    <svg viewBox="0 0 16 16" {...iconDefaults(props)}>
      <path
        transform="translate(0.6 0)"
        d="M14.6917 11.5995C14.6259 11.465 14.5202 11.354 14.3891 11.2815C14.258 11.2091 14.1078 11.1788 13.9589 11.1947C13.8357 11.2091 13.7205 11.2091 13.6021 11.2091C12.4424 11.2102 11.3042 10.8964 10.309 10.3011C9.31374 9.70578 8.49887 8.85138 7.95134 7.8291C7.40381 6.80681 7.14418 5.65502 7.20018 4.4967C7.25618 3.33837 7.6257 2.217 8.26929 1.2523C8.35155 1.12874 8.39781 0.984731 8.40289 0.836384C8.40798 0.688036 8.37169 0.541199 8.29809 0.412297C8.22898 0.278398 8.12171 0.168008 7.98984 0.0950967C7.85797 0.0221853 7.70744 -0.00997112 7.55729 0.00269661C6.19516 0.0789659 4.87512 0.502106 3.72248 1.23195C2.56985 1.96179 1.62288 2.97411 0.971459 4.17281C0.320042 5.37152 -0.0142003 6.71682 0.00046245 8.08101C0.0151252 9.4452 0.378206 10.783 1.05524 11.9674C1.73227 13.1519 2.70078 14.1436 3.86884 14.8485C5.03689 15.5534 6.36572 15.9481 7.72918 15.995C9.09265 16.042 10.4455 15.7397 11.6593 15.1169C12.8731 14.494 13.9076 13.5713 14.6645 12.4363C14.7464 12.3129 14.7925 12.1692 14.7976 12.0212C14.8027 11.8731 14.7666 11.7266 14.6933 11.5979L14.6917 11.5995Z"
      />
    </svg>
  );
}

/** Cloud ("cloud-on") — glyph is 16×11.2, vertically centered per the design. */
export function CloudIcon(props: IconProps) {
  return (
    <svg viewBox="0 0 16 16" {...iconDefaults(props)}>
      <path
        transform="translate(0 2.4)"
        d="M11.9978 3.2C11.5722 3.2 11.1514 3.2672 10.7498 3.4C10.3524 2.46994 9.71064 1.66484 8.89255 1.0702C8.07445 0.475554 7.11059 0.113563 6.1033 0.0226654C5.09602 -0.0682325 4.08292 0.115356 3.17159 0.553935C2.26025 0.992514 1.4847 1.66971 0.92729 2.51362C0.36988 3.35752 0.0514176 4.33663 0.00572028 5.34698C-0.039977 6.35732 0.188797 7.36118 0.667748 8.25196C1.1467 9.14274 1.85795 9.88718 2.72597 10.4062C3.59399 10.9253 4.58638 11.1996 5.59776 11.2H11.9978C13.0586 11.2 14.076 10.7786 14.8262 10.0284C15.5763 9.27828 15.9978 8.26087 15.9978 7.2C15.9978 6.13914 15.5763 5.12172 14.8262 4.37157C14.076 3.62143 13.0586 3.2 11.9978 3.2Z"
      />
    </svg>
  );
}

/** Close ("×") — two 1.6px strokes crossing the 16×16 box, drawn as one
 *  filled path so it takes currentColor like every other mark here. */
export function CloseIcon(props: IconProps) {
  return (
    <svg viewBox="0 0 16 16" {...iconDefaults(props)}>
      <path d="M3.28995 2.15864C2.97753 1.84622 2.47099 1.84622 2.15857 2.15864C1.84615 2.47106 1.84615 2.9776 2.15857 3.29002L6.86855 8L2.15857 12.71C1.84615 13.0224 1.84615 13.5289 2.15857 13.8414C2.47099 14.1538 2.97753 14.1538 3.28995 13.8414L7.99992 9.13137L12.7099 13.8414C13.0223 14.1538 13.5289 14.1538 13.8413 13.8414C14.1537 13.5289 14.1537 13.0224 13.8413 12.71L9.1313 8L13.8413 3.29002C14.1537 2.9776 14.1537 2.47106 13.8413 2.15864C13.5289 1.84622 13.0223 1.84622 12.7099 2.15864L7.99992 6.86863L3.28995 2.15864Z" />
    </svg>
  );
}

/** Crossed-out cloud ("cloud-off"). */
export function CloudOffIcon(props: IconProps) {
  return (
    <svg viewBox="0 0 16 16" {...iconDefaults(props)}>
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M15.7322 11.0314C15.4218 11.8417 14.8563 12.529 14.121 12.9898L15.7674 14.6346C15.8418 14.709 15.9008 14.7973 15.941 14.8945C15.9813 14.9917 16.002 15.0958 16.002 15.201C16.002 15.3062 15.9813 15.4104 15.941 15.5075C15.9008 15.6047 15.8418 15.693 15.7674 15.7674C15.693 15.8418 15.6047 15.9008 15.5075 15.941C15.4104 15.9813 15.3062 16.002 15.201 16.002C15.0958 16.002 14.9917 15.9813 14.8945 15.941C14.7973 15.9008 14.709 15.8418 14.6346 15.7674L0.234611 1.36741C0.084392 1.21719 0 1.01345 0 0.801011C0 0.588569 0.084392 0.384829 0.234611 0.234611C0.384829 0.084392 0.588569 0 0.801011 0C1.01345 0 1.21719 0.084392 1.36741 0.234611L3.82341 2.69061C5.15798 2.24333 6.61205 2.31501 7.89615 2.89139C9.18026 3.46777 10.2002 4.50657 10.753 5.80101C11.4712 5.56621 12.2413 5.53965 12.974 5.72441C13.7067 5.90917 14.3721 6.2977 14.8931 6.845C15.4141 7.39229 15.7694 8.07598 15.9179 8.81688C16.0664 9.55778 16.0021 10.3256 15.7322 11.0314ZM1.36421 4.81221C1.42021 4.83222 1.47104 4.86447 1.51301 4.90661L9.52421 12.9178C9.5803 12.9738 9.61851 13.0451 9.634 13.1228C9.6495 13.2005 9.64157 13.281 9.61124 13.3542C9.5809 13.4274 9.52952 13.4899 9.46361 13.5338C9.3977 13.5778 9.32023 13.6012 9.24101 13.601H5.60101C4.59553 13.6005 3.60875 13.3292 2.74427 12.8157C1.87979 12.3023 1.1695 11.5655 0.687975 10.6828C0.206455 9.80016 -0.0285329 8.80412 0.00768525 7.79929C0.0439034 6.79447 0.349991 5.81793 0.893811 4.97221C0.942696 4.89641 1.01576 4.83936 1.10116 4.81032C1.18655 4.78127 1.27925 4.78194 1.36421 4.81221Z"
      />
    </svg>
  );
}
